title: Configuring GWT Code Validation in Eclipse
body: <p>I'm going to lead with some specific questions that I have, and follow them with the context:</p>
  
  <ul>
  <li>How can I control how GWT Code Validation in eclipse is configured?</li>
  <li>What all does GWT Code Validation do?</li>
  <li>When it is scanning java classes, does it do any class loading?</li>
  <li>Why is it scanning classes that are not in client/shared packages? And how can I make it stop?</li>
  </ul>
  
  <p>I am running Eclipse Juno.  Recently another member of my team upgraded our project from GWT 2.4 to 2.5, and the first effect that I noticed was that GWT Code Validation would consume resources, bring my workspace to a halt, and ultimately fail with a java heap error – forcing me to kill eclipse.</p>
  
  <p>Mind you, I had what should be plenty of heap configured in my <code>eclipse.ini</code>, specifically: <code>-Xms256m -Xmx1536m</code></p>
  
  <p>Nevertheless, to regain control over my workspace I unchecked <code>Project --&gt; Build Automatically</code>, configured eclipse to display heap usage using <code>Preferences --&gt; General --&gt; Show Heap Status</code>, and bumped up my heap size in <code>eclipse.ini</code> to <code>-Xms2048m -Xmx3072m</code> just as an experiment to see what would happen.</p>
  
  <p>After doing this, I opened eclipse again and allowed it to build automatically, paying careful attention to the progress bar when it was doing the GWT Code Validation phase, and to the heap size:  it climbed, and climbed, and climbed, finally peaking somewhere north of 2G consumed.  Eventually, it completed (although it took way too long, not at all a reasonable amount of time).  Within a minute after it was done, a huge garbage collection event brought the heap down to a mere 300 megabytes.</p>
  
  <p>What I saw under the progress bar was more interesting:  the GWT Code Validation appeared to be scanning every <code>*.java</code> file in my entire project: not just those that are in <code>client</code> and <code>shared</code> packages, but everything.   I saw class names that the GWT complier would never see in a million years.</p>
  
  <p>So it appears that, while the GWT Compiler is smart enough to start with entry-point GWT module files and search out from there, the GWT Code Validation process appears to do a brute-force search through everything.</p>
  
  <p>And god help it if it's doing any class-loading along the way.  Some of these old server-side classes contain ancient sins of my forefathers, connecting to external resources in static initializers and whatnot. </p>
  
  <p>Is there some way that I can configure this validation to be more parsimonious about what it scans?  </p>