On Thu, Mar 31, 2011 at 6:35 PM, <sco...@google.com> wrote: > > http://gwt-code-reviews.appspot.com/1385810/diff/13011/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java > File dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java (right): > > http://gwt-code-reviews.appspot.com/1385810/diff/13011/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java#newcode323 > dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java:323: public > synchronized CompilationState getCompilationState(TreeLogger logger, > boolean suppressErrors) > Ouch... this is a far-reaching change. :( One that makes me begin to > wonder if the compilation state build should directly log errors at all. > > A different way to refactor, one I've thought about in the past, would > be to never have errors get logged from the comp state build, and always > have the caller log errors if desired, either by exposing a method on > CompState or else making CompUnit.getErrors public. This would remove > the whole burden of error reporting from CompState and remove the need > for the crazy threading of option strict all the way through the system. > > Thoughts, before I look at this in more detail? > > http://gwt-code-reviews.appspot.com/1385810/ >
It was kind of disruptive to pass the suppressErrors setting around through method parameters. I assume that's what you're talking about. The good thing about logging inside of CompilationStateBuilder is that there is a concious decision about what to do with errors when you build the CompliationState. If you're going to move the burden outside of CSB, I think the patch might look just as disruptive if you were to log errors every place I passed 'false'. Another small wrinkle is that in JavaToJavaScript compiler we've ditched the CompilationState to save memory before the time we want to report errors (but we could always just keep it or some subset of the data and log them at a TRACE/DEBUG level like this patch does.) -- Eric Z. Ayers Google Web Toolkit, Atlanta, GA USA -- http://groups.google.com/group/Google-Web-Toolkit-Contributors