http://gwt-code-reviews.appspot.com/34820/diff/1/2 File dev/core/src/com/google/gwt/dev/js/JsInliner.java (right):
http://gwt-code-reviews.appspot.com/34820/diff/1/2#newcode262 Line 262: public ComplexityEstimator() { } Unnecessary constructor. http://gwt-code-reviews.appspot.com/34820/diff/1/2#newcode727 Line 727: private static HashMap<String,Integer> startingCounts = new HashMap<String,Integer>(); The visitors are supposed to be stateless because the compiler may process several permutations in a single VM. Also, if the compiler were to compile several modules in one go, this would produce non-deterministic output. The usual way have interim state is to make the inner visitor types non-static, and save the data in an instance field in the outer type. The outer type's static exec() method creates an instance of the outer type and delegates to the instance's execImpl() method. For example, see JsObfuscateNamer. http://gwt-code-reviews.appspot.com/34820/diff/1/2#newcode975 Line 975: Integer startingCount = startingCounts.get(base); The typical GWT style is to let the compiler auto-unbox the Integers into int variables. http://gwt-code-reviews.appspot.com/34820/diff/1/2#newcode980 Line 980: // TODO - can this loop be removed? How about calculating the starting ident number as f.getName() _ name.getIdent() _ f.getScope().getNames().size() _ localLoopCounter? This would avoid duplicate storage of scope:counter information by using data that's already retained by the scope object. It's unlikely that there would ever be a collision, but the local loop counter would eliminate that. http://gwt-code-reviews.appspot.com/34820/diff/1/2#newcode1117 Line 1117: public InvocationCountingVisitor() { } Remove this. Also, the formatting is wrong. Empty methods should be void foo() { } Do you have the GWT style loaded into your Eclipse formatter? http://gwt-code-reviews.appspot.com/34820/diff/1/2#newcode1527 Line 1527: static int complexity(JsNode<?> toEstimate) { Why are the private modifiers removed? http://gwt-code-reviews.appspot.com/34820 --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---