ordercheck passes. git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@26 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/cfg/Compilation.java b/dev/core/src/com/google/gwt/dev/cfg/Compilation.java index ba62c80..72b2b50 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/Compilation.java +++ b/dev/core/src/com/google/gwt/dev/cfg/Compilation.java
@@ -23,9 +23,23 @@ public class Compilation { + private Map rebindDecisions = new HashMap(); + + private Map sourceHashByGeneratedTypeName = new HashMap(); + + private String strongName; + public Compilation() { } + public String[] getGeneratedTypeNames() { + return Util.toStringArray(sourceHashByGeneratedTypeName.keySet()); + } + + public String[] getRebindInputs() { + return Util.toStringArray(rebindDecisions.keySet()); + } + /** * @return <code>null</code> if there is no answer for this cached * compilation @@ -35,18 +49,20 @@ return out; } - public String[] getGeneratedTypeNames() { - return Util.toStringArray(sourceHashByGeneratedTypeName.keySet()); - } - - public String[] getRebindInputs() { - return Util.toStringArray(rebindDecisions.keySet()); - } - public String getStrongName() { return strongName; } + public String getTypeHash(String generatedTypeName) + throws UnableToCompleteException { + String hash = (String) sourceHashByGeneratedTypeName.get(generatedTypeName); + if (hash != null) { + return hash; + } else { + throw new UnableToCompleteException(); + } + } + public boolean recordDecision(String inputTypeName, String outputTypeName) { // see if we've already recorded this one String recodedOutputName = (String) rebindDecisions.get(inputTypeName); @@ -64,27 +80,11 @@ // this was a new entry return true; } - public void recordGeneratedTypeHash(String generatedTypeName, String sourceHash) { sourceHashByGeneratedTypeName.put(generatedTypeName, sourceHash); } - - public String getTypeHash(String generatedTypeName) - throws UnableToCompleteException { - String hash = (String) sourceHashByGeneratedTypeName.get(generatedTypeName); - if (hash != null) { - return hash; - } else { - throw new UnableToCompleteException(); - } - } - public void setStrongName(String strongName) { this.strongName = strongName; } - - private Map rebindDecisions = new HashMap(); - private Map sourceHashByGeneratedTypeName = new HashMap(); - private String strongName; }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/CompilationSchema.java b/dev/core/src/com/google/gwt/dev/cfg/CompilationSchema.java index 588e9ce..212a3b0 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/CompilationSchema.java +++ b/dev/core/src/com/google/gwt/dev/cfg/CompilationSchema.java
@@ -20,6 +20,13 @@ public class CompilationSchema extends Schema { private final class BodySchema extends Schema { + protected final String __generated_type_hash_1_class = null; + + protected final String __generated_type_hash_2_hash = null; + + protected final String __rebind_decision_1_in = null; + protected final String __rebind_decision_2_out = null; + protected Schema __generated_type_hash_begin(String type, String hash) { compilation.recordGeneratedTypeHash(type, hash); return null; @@ -29,13 +36,10 @@ compilation.recordDecision(in, out); return null; } - - protected final String __generated_type_hash_1_class = null; - protected final String __generated_type_hash_2_hash = null; - protected final String __rebind_decision_1_in = null; - protected final String __rebind_decision_2_out = null; } + private final Compilation compilation; + public CompilationSchema(Compilation compilation) { this.compilation = compilation; } @@ -43,6 +47,4 @@ protected Schema __cache_entry_begin() { return new BodySchema(); } - - private final Compilation compilation; }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/Compilations.java b/dev/core/src/com/google/gwt/dev/cfg/Compilations.java index 2fca09b..27cd982 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/Compilations.java +++ b/dev/core/src/com/google/gwt/dev/cfg/Compilations.java
@@ -25,6 +25,8 @@ public class Compilations { + private final List list = new ArrayList(); + public void add(Compilation compilation) { list.add(compilation); } @@ -86,6 +88,10 @@ } } + public Iterator iterator() { + return list.iterator(); + } + private void removeMismatches(List candidates, String in, String out) { for (Iterator iter = candidates.iterator(); iter.hasNext();) { Compilation c = (Compilation) iter.next(); @@ -95,10 +101,4 @@ } } } - - public Iterator iterator() { - return list.iterator(); - } - - private final List list = new ArrayList(); }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/CompoundCondition.java b/dev/core/src/com/google/gwt/dev/cfg/CompoundCondition.java index 6196de7..40f99ce 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/CompoundCondition.java +++ b/dev/core/src/com/google/gwt/dev/cfg/CompoundCondition.java
@@ -17,9 +17,9 @@ public abstract class CompoundCondition extends Condition { + private final Conditions conditions = new Conditions(); + public Conditions getConditions() { return conditions; } - - private final Conditions conditions = new Conditions(); }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/ConditionAll.java b/dev/core/src/com/google/gwt/dev/cfg/ConditionAll.java index 3167f59..011b58a 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/ConditionAll.java +++ b/dev/core/src/com/google/gwt/dev/cfg/ConditionAll.java
@@ -37,10 +37,6 @@ return true; } - protected String getEvalBeforeMessage(String testType) { - return "Checking if all subconditions are true (<all>)"; - } - protected String getEvalAfterMessage(String testType, boolean result) { if (result) { return "Yes: All subconditions were true"; @@ -48,4 +44,8 @@ return "No: One or more subconditions was false"; } } + + protected String getEvalBeforeMessage(String testType) { + return "Checking if all subconditions are true (<all>)"; + } }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenPropertyIs.java b/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenPropertyIs.java index f8dab92..d8ac642 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenPropertyIs.java +++ b/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenPropertyIs.java
@@ -23,11 +23,19 @@ public class ConditionWhenPropertyIs extends Condition { + private final String propName; + + private final String value; + public ConditionWhenPropertyIs(String propName, String value) { this.propName = propName; this.value = value; } + public String toString() { + return "<when-property-is name='" + propName + "' value='" + value + "'/>"; + } + protected boolean doEval(TreeLogger logger, GeneratorContext context, String testType) throws UnableToCompleteException { String testValue; @@ -35,7 +43,7 @@ PropertyOracle propertyOracle = context.getPropertyOracle(); testValue = propertyOracle.getPropertyValue(logger, propName); logger.log(TreeLogger.DEBUG, "Property value is '" + testValue + "'", - null); + null); if (testValue.equals(value)) { return true; } else { @@ -59,11 +67,4 @@ protected String getEvalBeforeMessage(String testType) { return toString(); } - - public String toString() { - return "<when-property-is name='" + propName + "' value='" + value + "'/>"; - } - - private final String propName; - private final String value; }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenTypeAssignableTo.java b/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenTypeAssignableTo.java index b3ed91d9..26a872a 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenTypeAssignableTo.java +++ b/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenTypeAssignableTo.java
@@ -24,6 +24,8 @@ public class ConditionWhenTypeAssignableTo extends Condition { + private final String assignableToTypeName; + public ConditionWhenTypeAssignableTo(String assignableToTypeName) { this.assignableToTypeName = assignableToTypeName; } @@ -32,6 +34,10 @@ return assignableToTypeName; } + public String toString() { + return "<when-assignable class='" + assignableToTypeName + "'/>"; + } + protected boolean doEval(TreeLogger logger, GeneratorContext context, String testType) throws UnableToCompleteException { TypeOracle typeOracle = context.getTypeOracle(); @@ -49,7 +55,7 @@ // types that have been deleted. // logger.log(TreeLogger.WARN, "Unknown type '" + assignableToTypeName - + "' specified in deferred binding rule", null); + + "' specified in deferred binding rule", null); return false; } @@ -72,10 +78,4 @@ return toString(); } - public String toString() { - return "<when-assignable class='" + assignableToTypeName + "'/>"; - } - - private final String assignableToTypeName; - }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenTypeIs.java b/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenTypeIs.java index 8f44aa1..70427a4 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenTypeIs.java +++ b/dev/core/src/com/google/gwt/dev/cfg/ConditionWhenTypeIs.java
@@ -20,10 +20,16 @@ public class ConditionWhenTypeIs extends Condition { + private final String exactTypeName; + public ConditionWhenTypeIs(String exactTypeName) { this.exactTypeName = exactTypeName; } + public String toString() { + return "<when-type-is class='" + exactTypeName + "'/>"; + } + protected boolean doEval(TreeLogger logger, GeneratorContext context, String testType) { return exactTypeName.equals(testType); @@ -40,10 +46,4 @@ protected String getEvalBeforeMessage(String testType) { return toString(); } - - public String toString() { - return "<when-type-is class='" + exactTypeName + "'/>"; - } - - private final String exactTypeName; }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/Conditions.java b/dev/core/src/com/google/gwt/dev/cfg/Conditions.java index db18295..3127d34 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/Conditions.java +++ b/dev/core/src/com/google/gwt/dev/cfg/Conditions.java
@@ -21,6 +21,8 @@ public class Conditions { + private final List list = new ArrayList(); + /** * Appends a condition. */ @@ -31,6 +33,4 @@ public Iterator iterator() { return list.iterator(); } - - private final List list = new ArrayList(); }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/DefaultPropertyProvider.java b/dev/core/src/com/google/gwt/dev/cfg/DefaultPropertyProvider.java index d7ca44a..47a54f5 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/DefaultPropertyProvider.java +++ b/dev/core/src/com/google/gwt/dev/cfg/DefaultPropertyProvider.java
@@ -52,6 +52,6 @@ caught = e; } throw new RuntimeException( - "Internal error parsing source for default property provider", caught); + "Internal error parsing source for default property provider", caught); } }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java b/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java index 2b8f35f..a659c65 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java +++ b/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java
@@ -76,6 +76,43 @@ return true; } + private final ArrayList allCups = new ArrayList(); + + private final Set alreadySeenFiles = new HashSet(); + + private final CacheManager cacheManager = new CacheManager(".gwt-cache", + new TypeOracle()); + + private CompilationUnitProvider[] cups = new CompilationUnitProvider[0]; + + private final List entryPointTypeNames = new ArrayList(); + + private final Set gwtXmlFiles = new HashSet(); + + private FileOracle lazyPublicOracle; + + private FileOracle lazySourceOracle; + + private TypeOracle lazyTypeOracle; + + private final long moduleDefCreationTime = System.currentTimeMillis(); + + private final String name; + + private final Properties properties = new Properties(); + + private final FileOracleFactory publicPathEntries = new FileOracleFactory(); + + private final Rules rules = new Rules(); + + private final Scripts scripts = new Scripts(); + + private final Map servletClassNamesByPath = new HashMap(); + + private final FileOracleFactory sourcePathEntries = new FileOracleFactory(); + + private final Styles styles = new Styles(); + public ModuleDef(String name) { this.name = name; } @@ -160,7 +197,7 @@ * Ensure that URLs that match the servlet mapping, including those that * have additional path_info, get routed to the correct servlet. * - * See "Inside Servlets", Second Edition, pg. 208 + * See "Inside Servlets", Second Edition, pg. 208 */ if (actual.equals(mapping) || actual.startsWith(mapping + "/")) { return (String) entries[i].getValue(); @@ -238,9 +275,8 @@ TreeLogger subBranch = null; if (branch.isLoggable(TreeLogger.DEBUG)) { - subBranch = - branch.branch(TreeLogger.DEBUG, "Adding compilation units...", - null); + subBranch = branch.branch(TreeLogger.DEBUG, + "Adding compilation units...", null); } for (int i = 0; i < currentCups.length; i++) { @@ -253,7 +289,7 @@ lazyTypeOracle = builder.build(branch); long after = System.currentTimeMillis(); branch.log(TreeLogger.TRACE, "Finished in " + (after - before) + " ms", - null); + null); } catch (UnableToCompleteException e) { logger.log(TreeLogger.ERROR, "Failed to complete analysis", null); throw new UnableToCompleteException(); @@ -266,9 +302,8 @@ Util.logMissingTypeErrorWithHints(logger, "java.lang.Object"); seedTypesMissing = true; } else { - TreeLogger branch = - logger - .branch(TreeLogger.TRACE, "Finding entry point classes", null); + TreeLogger branch = logger.branch(TreeLogger.TRACE, + "Finding entry point classes", null); String[] typeNames = getEntryPointTypeNames(); for (int i = 0; i < typeNames.length; i++) { String typeName = typeNames[i]; @@ -291,7 +326,7 @@ for (Iterator iter = gwtXmlFiles.iterator(); iter.hasNext();) { File xmlFile = (File) iter.next(); if ((!xmlFile.exists()) - || (xmlFile.lastModified() > moduleDefCreationTime)) { + || (xmlFile.lastModified() > moduleDefCreationTime)) { return true; } } @@ -318,7 +353,7 @@ normalize(logger); getTypeOracle(logger); Util.invokeInaccessableMethod(TypeOracle.class, "incrementReloadCount", - new Class[]{}, lazyTypeOracle, new Object[]{}); + new Class[] {}, lazyTypeOracle, new Object[] {}); } /** @@ -358,7 +393,7 @@ if (lazySourceOracle.isEmpty()) { branch.log(TreeLogger.WARN, - "No source path entries; expect subsequent failures", null); + "No source path entries; expect subsequent failures", null); } else { // Create the CUPs String[] allFiles = lazySourceOracle.getAllFiles(); @@ -388,24 +423,4 @@ lazyPublicOracle = publicPathEntries.create(branch); } - private final ArrayList allCups = new ArrayList(); - private final Set alreadySeenFiles = new HashSet(); - private final CacheManager cacheManager = - new CacheManager(".gwt-cache", new TypeOracle()); - private CompilationUnitProvider[] cups = new CompilationUnitProvider[0]; - private final List entryPointTypeNames = new ArrayList(); - private final Set gwtXmlFiles = new HashSet(); - private FileOracle lazyPublicOracle; - private FileOracle lazySourceOracle; - private TypeOracle lazyTypeOracle; - private final long moduleDefCreationTime = System.currentTimeMillis(); - private final String name; - private final Properties properties = new Properties(); - private final FileOracleFactory publicPathEntries = new FileOracleFactory(); - private final Rules rules = new Rules(); - private final Scripts scripts = new Scripts(); - private final Map servletClassNamesByPath = new HashMap(); - private final FileOracleFactory sourcePathEntries = new FileOracleFactory(); - private final Styles styles = new Styles(); - }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/ModuleDefLoader.java b/dev/core/src/com/google/gwt/dev/cfg/ModuleDefLoader.java index 80081be..0c207ad 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/ModuleDefLoader.java +++ b/dev/core/src/com/google/gwt/dev/cfg/ModuleDefLoader.java
@@ -97,6 +97,10 @@ ModuleDefLoader.enableCachingModules = enableCachingModules; } + private final Set alreadyLoadedModules = new HashSet(); + + private final ClassLoader classLoader; + private ModuleDefLoader() { this.classLoader = Thread.currentThread().getContextClassLoader(); } @@ -114,7 +118,7 @@ if (alreadyLoadedModules.contains(moduleName)) { logger.log(TreeLogger.TRACE, "Module '" + moduleName - + "' has already been loaded and will be skipped", null); + + "' has already been loaded and will be skipped", null); return; } else { alreadyLoadedModules.add(moduleName); @@ -131,9 +135,9 @@ logger.log(TreeLogger.TRACE, "Module location: " + externalForm, null); try { if ((!(externalForm.startsWith("jar:file"))) - && (!(externalForm.startsWith("zip:file"))) - && (!(externalForm.startsWith("http://"))) - && (!(externalForm.startsWith("ftp://")))) { + && (!(externalForm.startsWith("zip:file"))) + && (!(externalForm.startsWith("http://"))) + && (!(externalForm.startsWith("ftp://")))) { File gwtXmlFile = new File(new URI(externalForm)); moduleDef.addGwtXmlFile(gwtXmlFile); } @@ -143,10 +147,9 @@ } } if (moduleURL == null) { - String msg = - "Unable to find '" - + resName - + "' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?"; + String msg = "Unable to find '" + + resName + + "' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?"; logger.log(TreeLogger.ERROR, msg, null); throw new UnableToCompleteException(); } @@ -164,8 +167,8 @@ Reader r = null; try { r = Util.createReader(logger, moduleURL); - ModuleDefSchema schema = - new ModuleDefSchema(logger, this, moduleURL, moduleDir, moduleDef); + ModuleDefSchema schema = new ModuleDefSchema(logger, this, moduleURL, + moduleDir, moduleDef); ReflectiveParser.parse(logger, schema, r); } finally { Utility.close(r); @@ -175,6 +178,7 @@ /** * * This method loads a module. + * * @param logger used to log the loading process * @param moduleName the name of the module * @return the module returned -- cannot be null @@ -182,22 +186,20 @@ */ private ModuleDef load(TreeLogger logger, String moduleName) throws UnableToCompleteException { - logger = - logger.branch(TreeLogger.TRACE, "Loading module '" + moduleName + "'", - null); + logger = logger.branch(TreeLogger.TRACE, "Loading module '" + moduleName + + "'", null); if (!ModuleDef.isValidModuleName(moduleName)) { logger.log(TreeLogger.ERROR, "Invalid module name: '" + moduleName + "'", - null); + null); throw new UnableToCompleteException(); } ModuleDef moduleDef = new ModuleDef(moduleName); for (Iterator it = forceInherits.iterator(); it.hasNext();) { String forceInherit = (String) it.next(); - TreeLogger branch = - logger.branch(TreeLogger.TRACE, - "Loading forceably inherited module '" + forceInherit + "'", null); + TreeLogger branch = logger.branch(TreeLogger.TRACE, + "Loading forceably inherited module '" + forceInherit + "'", null); nestedLoad(branch, forceInherit, moduleDef); } nestedLoad(logger, moduleName, moduleDef); @@ -208,7 +210,4 @@ return moduleDef; } - - private final Set alreadyLoadedModules = new HashSet(); - private final ClassLoader classLoader; }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/ModuleDefSchema.java b/dev/core/src/com/google/gwt/dev/cfg/ModuleDefSchema.java index cf1f391..b75352c 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/ModuleDefSchema.java +++ b/dev/core/src/com/google/gwt/dev/cfg/ModuleDefSchema.java
@@ -45,6 +45,52 @@ private final class BodySchema extends Schema { + protected final String __define_property_1_name = null; + + protected final String __define_property_2_values = null; + + protected final String __extend_property_1_name = null; + + protected final String __extend_property_2_values = null; + + protected final String __entry_point_1_class = null; + + protected final String __generate_with_1_class = null; + + protected final String __inherits_1_name = null; + + protected final String __property_provider_1_name = null; + + protected final String __public_1_path = null; + + protected final String __public_2_includes = ""; + + protected final String __public_3_excludes = ""; + + protected final String __public_4_defaultexcludes = "yes"; + + protected final String __public_5_casesensitive = "true"; + + protected final String __replace_with_1_class = null; + + protected final String __script_1_src = null; + + protected final String __servlet_1_path = null; + + protected final String __servlet_2_class = null; + + protected final String __set_property_1_name = null; + + protected final String __set_property_2_value = null; + + protected final String __source_1_path = ""; + + protected final String __stylesheet_1_src = null; + + protected final String __super_source_1_path = ""; + + private Schema fChild; + protected Schema __define_property_begin(PropertyName name, PropertyValue[] values) throws UnableToCompleteException { if (moduleDef.getProperties().find(name.token) != null) { @@ -63,6 +109,11 @@ return null; } + protected Schema __entry_point_begin(String className) { + moduleDef.addEntryPointTypeName(className); + return null; + } + protected Schema __extend_property_begin(Property property, PropertyValue[] values) { for (int i = 0; i < values.length; i++) { @@ -73,11 +124,6 @@ return null; } - protected Schema __entry_point_begin(String className) { - moduleDef.addEntryPointTypeName(className); - return null; - } - protected Schema __fail_begin() { RuleFail rule = new RuleFail(); moduleDef.getRules().prepend(rule); @@ -93,7 +139,7 @@ protected Schema __inherits_begin(String name) throws UnableToCompleteException { TreeLogger branch = logger.branch(TreeLogger.TRACE, - "Loading inherited module '" + name + "'", null); + "Loading inherited module '" + name + "'", null); loader.nestedLoad(branch, name, moduleDef); return null; } @@ -111,7 +157,7 @@ // This is a problem. // logger.log(TreeLogger.ERROR, - "Property providers must specify a JavaScript body", null); + "Property providers must specify a JavaScript body", null); throw new UnableToCompleteException(); } @@ -140,12 +186,12 @@ String[] excludeList = (String[]) excludeSet.toArray(new String[excludeSet.size()]); boolean doDefaultExcludes = "yes".equalsIgnoreCase(defaultExcludes) - || "true".equalsIgnoreCase(defaultExcludes); + || "true".equalsIgnoreCase(defaultExcludes); boolean doCaseSensitive = "yes".equalsIgnoreCase(caseSensitive) - || "true".equalsIgnoreCase(caseSensitive); + || "true".equalsIgnoreCase(caseSensitive); addPublicPackage(modulePackageAsPath, path, includeList, excludeList, - doDefaultExcludes, doCaseSensitive); + doDefaultExcludes, doCaseSensitive); } protected Schema __replace_with_begin(String className) { @@ -169,9 +215,9 @@ // This is a problem. // logger.log( - TreeLogger.ERROR, - "Injected scripts require an associated JavaScript block that indicates when the corresponding script is fully loaded and ready for use", - null); + TreeLogger.ERROR, + "Injected scripts require an associated JavaScript block that indicates when the corresponding script is fully loaded and ready for use", + null); throw new UnableToCompleteException(); } @@ -193,7 +239,7 @@ // Only absolute paths, although it is okay to have multiple slashes. if (!path.startsWith("/")) { logger.log(TreeLogger.ERROR, "Servlet path '" + path - + "' must begin with forward slash (e.g. '/foo')", null); + + "' must begin with forward slash (e.g. '/foo')", null); throw new UnableToCompleteException(); } @@ -263,22 +309,22 @@ String normChildDir = normalizePathEntry(relDir); if (normChildDir.startsWith("/")) { logger.log(TreeLogger.WARN, "Non-relative public package: " - + normChildDir, null); + + normChildDir, null); return; } if (normChildDir.startsWith("./") || normChildDir.indexOf("/./") >= 0) { logger.log(TreeLogger.WARN, "Non-canonical public package: " - + normChildDir, null); + + normChildDir, null); return; } if (normChildDir.startsWith("../") || normChildDir.indexOf("/../") >= 0) { logger.log(TreeLogger.WARN, "Non-canonical public package: " - + normChildDir, null); + + normChildDir, null); return; } String fullDir = parentDir + normChildDir; moduleDef.addPublicPackage(fullDir, includeList, excludeList, - defaultExcludes, caseSensitive); + defaultExcludes, caseSensitive); } private void addSourcePackage(String parentDir, String relDir, @@ -286,17 +332,17 @@ String normChildDir = normalizePathEntry(relDir); if (normChildDir.startsWith("/")) { logger.log(TreeLogger.WARN, "Non-relative source package: " - + normChildDir, null); + + normChildDir, null); return; } if (normChildDir.startsWith("./") || normChildDir.indexOf("/./") >= 0) { logger.log(TreeLogger.WARN, "Non-canonical source package: " - + normChildDir, null); + + normChildDir, null); return; } if (normChildDir.startsWith("../") || normChildDir.indexOf("/../") >= 0) { logger.log(TreeLogger.WARN, "Non-canonical source package: " - + normChildDir, null); + + normChildDir, null); return; } @@ -327,34 +373,20 @@ return path; } - - protected final String __define_property_1_name = null; - protected final String __define_property_2_values = null; - protected final String __extend_property_1_name = null; - protected final String __extend_property_2_values = null; - protected final String __entry_point_1_class = null; - protected final String __generate_with_1_class = null; - protected final String __inherits_1_name = null; - protected final String __property_provider_1_name = null; - protected final String __public_1_path = null; - protected final String __public_2_includes = ""; - protected final String __public_3_excludes = ""; - protected final String __public_4_defaultexcludes = "yes"; - protected final String __public_5_casesensitive = "true"; - protected final String __replace_with_1_class = null; - protected final String __script_1_src = null; - protected final String __servlet_1_path = null; - protected final String __servlet_2_class = null; - protected final String __set_property_1_name = null; - protected final String __set_property_2_value = null; - protected final String __source_1_path = ""; - protected final String __stylesheet_1_src = null; - protected final String __super_source_1_path = ""; - private Schema fChild; } private final class ConditionSchema extends Schema { + protected final String __when_property_is_1_name = null; + + protected final String __when_property_is_2_value = null; + + protected final String __when_type_assignable_1_class = null; + + protected final String __when_type_is_1_class = null; + + private final CompoundCondition parentCondition; + public ConditionSchema(CompoundCondition parentCondition) { this.parentCondition = parentCondition; } @@ -404,16 +436,18 @@ // No children allowed. return null; } - - protected final String __when_property_is_1_name = null; - protected final String __when_property_is_2_value = null; - protected final String __when_type_assignable_1_class = null; - protected final String __when_type_is_1_class = null; - private final CompoundCondition parentCondition; } private final class IncludeExcludeSchema extends Schema { + protected final String __exclude_1_name = null; + + protected final String __include_1_name = null; + + private final Set excludes = new HashSet(); + + private final Set includes = new HashSet(); + public Set getExcludes() { return excludes; } @@ -431,11 +465,6 @@ includes.add(name); return null; } - - protected final String __exclude_1_name = null; - protected final String __include_1_name = null; - private final Set excludes = new HashSet(); - private final Set includes = new HashSet(); } /** @@ -444,6 +473,8 @@ */ private final class ObjAttrCvt extends AttributeConverter { + private final Class fReqdSuperclass; + public ObjAttrCvt(Class reqdSuperclass) { fReqdSuperclass = reqdSuperclass; } @@ -468,7 +499,7 @@ // if (!fReqdSuperclass.isAssignableFrom(clazz)) { Messages.INVALID_CLASS_DERIVATION.log(logger, clazz, fReqdSuperclass, - null); + null); throw new UnableToCompleteException(); } @@ -486,8 +517,6 @@ throw new UnableToCompleteException(); } } - - private final Class fReqdSuperclass; } /** @@ -514,11 +543,11 @@ } private static class PropertyName { + public final String token; + public PropertyName(String token) { this.token = token; } - - public final String token; } /** @@ -547,6 +576,10 @@ private class PropertyProviderBodySchema extends Schema { + private StringBuffer script; + + private int startLineNumber = -1; + public PropertyProviderBodySchema() { } @@ -565,17 +598,14 @@ public int getStartLineNumber() { return startLineNumber; } - - private StringBuffer script; - private int startLineNumber = -1; } private static class PropertyValue { + public final String token; + public PropertyValue(String token) { this.token = token; } - - public final String token; } /** @@ -591,7 +621,7 @@ // for (int i = 0; i < tokens.length; i++) { values[i] = (PropertyValue) propValueAttrCvt.convertToArg(schema, line, - elem, attr, tokens[i]); + elem, attr, tokens[i]); } return values; @@ -617,6 +647,10 @@ private class ScriptReadyBodySchema extends Schema { + private StringBuffer script; + + private int startLineNumber = -1; + public ScriptReadyBodySchema() { } @@ -635,13 +669,30 @@ public int getStartLineNumber() { return startLineNumber; } - - private StringBuffer script; - private int startLineNumber = -1; } private static final Map singletonsByName = new HashMap(); + private final BodySchema bodySchema; + + private boolean foundAnyPublic; + + private boolean foundExplicitSourceOrSuperSource; + + private final ObjAttrCvt genAttrCvt = new ObjAttrCvt(Generator.class); + + private final JsParser jsParser = new JsParser(); + private final JsProgram jsPgm = new JsProgram(); + private final ModuleDefLoader loader; + private final TreeLogger logger; + private final ModuleDef moduleDef; + private final String modulePackageAsPath; + private final URL moduleURL; + private final PropertyAttrCvt propAttrCvt = new PropertyAttrCvt(); + private final PropertyNameAttrCvt propNameAttrCvt = new PropertyNameAttrCvt(); + private final PropertyValueArrayAttrCvt propValueArrayAttrCvt = new PropertyValueArrayAttrCvt(); + private final PropertyValueAttrCvt propValueAttrCvt = new PropertyValueAttrCvt(); + public ModuleDefSchema(TreeLogger logger, ModuleDefLoader loader, URL moduleURL, String modulePackageAsPath, ModuleDef toConfigure) { this.logger = logger; @@ -672,7 +723,7 @@ if (!foundAnyPublic) { bodySchema.addPublicPackage(modulePackageAsPath, "public", Empty.STRINGS, - Empty.STRINGS, true, true); + Empty.STRINGS, true, true); } } @@ -721,20 +772,4 @@ return fn; } - private final BodySchema bodySchema; - private boolean foundAnyPublic; - private boolean foundExplicitSourceOrSuperSource; - private final ObjAttrCvt genAttrCvt = new ObjAttrCvt(Generator.class); - private final JsParser jsParser = new JsParser(); - private final JsProgram jsPgm = new JsProgram(); - private final ModuleDefLoader loader; - private final TreeLogger logger; - private final ModuleDef moduleDef; - private final String modulePackageAsPath; - private final URL moduleURL; - private final PropertyAttrCvt propAttrCvt = new PropertyAttrCvt(); - private final PropertyNameAttrCvt propNameAttrCvt = new PropertyNameAttrCvt(); - private final PropertyValueArrayAttrCvt propValueArrayAttrCvt = new PropertyValueArrayAttrCvt(); - private final PropertyValueAttrCvt propValueAttrCvt = new PropertyValueAttrCvt(); - }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/Properties.java b/dev/core/src/com/google/gwt/dev/cfg/Properties.java index 0df07a7..24580c0 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/Properties.java +++ b/dev/core/src/com/google/gwt/dev/cfg/Properties.java
@@ -23,6 +23,10 @@ public class Properties { + private final Map map = new HashMap(); + + private Property[] propertiesLazyArray; + /** * Creates the specified property, or returns an existing one by the specified * name if present. @@ -61,7 +65,4 @@ } return propertiesLazyArray; } - - private final Map map = new HashMap(); - private Property[] propertiesLazyArray; }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/Property.java b/dev/core/src/com/google/gwt/dev/cfg/Property.java index efad285..c3a6635 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/Property.java +++ b/dev/core/src/com/google/gwt/dev/cfg/Property.java
@@ -21,6 +21,16 @@ public class Property implements Comparable { + private String activeValue; + + private Set knownValues = new HashSet(); + + private String[] knownValuesLazyArray; + + private final String name; + + private PropertyProvider provider; + public Property(String name) { this.name = name; } @@ -80,10 +90,4 @@ public String toString() { return name; } - - private String activeValue; - private Set knownValues = new HashSet(); - private String[] knownValuesLazyArray; - private final String name; - private PropertyProvider provider; }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/PropertyPermutations.java b/dev/core/src/com/google/gwt/dev/cfg/PropertyPermutations.java index 8983688..1976425 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/PropertyPermutations.java +++ b/dev/core/src/com/google/gwt/dev/cfg/PropertyPermutations.java
@@ -23,6 +23,14 @@ */ public class PropertyPermutations { + private int currPermIndex; + + private final int lastProp; + + private final Property[] properties; + + private final String[][] values; + public PropertyPermutations(Properties properties) { this.properties = properties.toArray(); lastProp = this.properties.length - 1; @@ -48,6 +56,8 @@ public Iterator iterator() { return new Iterator() { + private int iterPermIndex; + public boolean hasNext() { return iterPermIndex < values.length; } @@ -62,8 +72,6 @@ public void remove() { throw new UnsupportedOperationException("remove"); } - - private int iterPermIndex; }; } @@ -83,7 +91,7 @@ if (activeValue != null) { // This property is fixed. // - return new String[]{activeValue}; + return new String[] {activeValue}; } else { // This property is determined on the client. // @@ -114,9 +122,4 @@ } } } - - private int currPermIndex; - private final int lastProp; - private final Property[] properties; - private final String[][] values; }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/PropertyProvider.java b/dev/core/src/com/google/gwt/dev/cfg/PropertyProvider.java index 928af9c..3397f76 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/PropertyProvider.java +++ b/dev/core/src/com/google/gwt/dev/cfg/PropertyProvider.java
@@ -19,10 +19,18 @@ public class PropertyProvider { + private JsBlock body; + + private final Property property; + public PropertyProvider(Property property) { this.property = property; } + public JsBlock getBody() { + return body; + } + public Property getProperty() { return property; } @@ -30,11 +38,4 @@ public void setBody(JsBlock body) { this.body = body; } - - public JsBlock getBody() { - return body; - } - - private JsBlock body; - private final Property property; }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/Rule.java b/dev/core/src/com/google/gwt/dev/cfg/Rule.java index 8040705..e995e5f 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/Rule.java +++ b/dev/core/src/com/google/gwt/dev/cfg/Rule.java
@@ -21,6 +21,8 @@ public abstract class Rule { + private final ConditionAll rootCondition = new ConditionAll(); + public ConditionAll getRootCondition() { return rootCondition; } @@ -32,6 +34,4 @@ public abstract String realize(TreeLogger logger, GeneratorContext context, String typeName) throws UnableToCompleteException; - - private final ConditionAll rootCondition = new ConditionAll(); }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/RuleFail.java b/dev/core/src/com/google/gwt/dev/cfg/RuleFail.java index cd5dd3a..84db434 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/RuleFail.java +++ b/dev/core/src/com/google/gwt/dev/cfg/RuleFail.java
@@ -24,7 +24,7 @@ public String realize(TreeLogger logger, GeneratorContext context, String typeName) throws UnableToCompleteException { logger.log(TreeLogger.ERROR, "Deferred binding request failed for type '" - + typeName + "'", null); + + typeName + "'", null); throw new UnableToCompleteException(); }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/RuleGenerateWith.java b/dev/core/src/com/google/gwt/dev/cfg/RuleGenerateWith.java index 18f5022..11fb88c 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/RuleGenerateWith.java +++ b/dev/core/src/com/google/gwt/dev/cfg/RuleGenerateWith.java
@@ -22,6 +22,8 @@ public class RuleGenerateWith extends Rule { + private final Generator generator; + public RuleGenerateWith(Generator generator) { this.generator = generator; } @@ -51,6 +53,4 @@ public String toString() { return "<generate-with class='" + generator.getClass().getName() + "'/>"; } - - private final Generator generator; }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/RuleReplaceWith.java b/dev/core/src/com/google/gwt/dev/cfg/RuleReplaceWith.java index f405380..b008ceb 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/RuleReplaceWith.java +++ b/dev/core/src/com/google/gwt/dev/cfg/RuleReplaceWith.java
@@ -21,6 +21,8 @@ public class RuleReplaceWith extends Rule { + private final String replacementTypeName; + public RuleReplaceWith(String typeName) { this.replacementTypeName = typeName; } @@ -37,6 +39,4 @@ public String toString() { return "<replace-with class='" + replacementTypeName + "'/>"; } - - private final String replacementTypeName; }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/Rules.java b/dev/core/src/com/google/gwt/dev/cfg/Rules.java index e99e695..f499891 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/Rules.java +++ b/dev/core/src/com/google/gwt/dev/cfg/Rules.java
@@ -20,20 +20,20 @@ public class Rules { - /** - * Prepends a rule, giving it the highest priority. - */ - public void prepend(Rule rule) { - list.addFirst(rule); + private final LinkedList list = new LinkedList(); + + public boolean isEmpty() { + return list.isEmpty(); } public Iterator iterator() { return list.iterator(); } - public boolean isEmpty() { - return list.isEmpty(); + /** + * Prepends a rule, giving it the highest priority. + */ + public void prepend(Rule rule) { + list.addFirst(rule); } - - private final LinkedList list = new LinkedList(); }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/Script.java b/dev/core/src/com/google/gwt/dev/cfg/Script.java index 4e4ce9c..9d2c73b 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/Script.java +++ b/dev/core/src/com/google/gwt/dev/cfg/Script.java
@@ -18,23 +18,24 @@ import com.google.gwt.dev.js.ast.JsFunction; /** - * Represents configuration for a dynamically-injected script. + * Represents configuration for a dynamically-injected script. */ public class Script { + private final String src; + + private final JsFunction jsReadyFn; + public Script(String src, JsFunction jsReadyFn) { this.src = src; this.jsReadyFn = jsReadyFn; } - public String getSrc() { - return src; - } - public JsFunction getJsReadyFunction() { return jsReadyFn; } - private final String src; - private final JsFunction jsReadyFn; + public String getSrc() { + return src; + } }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/Scripts.java b/dev/core/src/com/google/gwt/dev/cfg/Scripts.java index 980d810..5600b79 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/Scripts.java +++ b/dev/core/src/com/google/gwt/dev/cfg/Scripts.java
@@ -23,25 +23,25 @@ */ public class Scripts { + private final LinkedList list = new LinkedList(); + /** * Append a {@link com.google.gwt.dev.cfg.Script} object. * - * @param script the script to append + * @param script the script to append */ public void append(Script script) { list.addLast(script); } + public boolean isEmpty() { + return list.isEmpty(); + } + /** * An iterator over {@link Script} objects. */ public Iterator iterator() { return list.iterator(); } - - public boolean isEmpty() { - return list.isEmpty(); - } - - private final LinkedList list = new LinkedList(); }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/StaticPropertyOracle.java b/dev/core/src/com/google/gwt/dev/cfg/StaticPropertyOracle.java index d010280..b1662f9 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/StaticPropertyOracle.java +++ b/dev/core/src/com/google/gwt/dev/cfg/StaticPropertyOracle.java
@@ -21,6 +21,10 @@ public class StaticPropertyOracle implements PropertyOracle { + private Property[] currentProps; + + private String[] currentValues; + public StaticPropertyOracle() { } @@ -52,7 +56,4 @@ currentProps = props; currentValues = values; } - - private Property[] currentProps; - private String[] currentValues; }
diff --git a/dev/core/src/com/google/gwt/dev/cfg/Styles.java b/dev/core/src/com/google/gwt/dev/cfg/Styles.java index 318c434..da24e1d 100644 --- a/dev/core/src/com/google/gwt/dev/cfg/Styles.java +++ b/dev/core/src/com/google/gwt/dev/cfg/Styles.java
@@ -23,24 +23,25 @@ */ public class Styles { + private final LinkedList list = new LinkedList(); + /** * Append a script. + * * @param src a partial or full url to a script to inject */ public void append(String src) { list.addLast(src); } + public boolean isEmpty() { + return list.isEmpty(); + } + /** * An iterator over stylesheet urls (each one is a String). */ public Iterator iterator() { return list.iterator(); } - - public boolean isEmpty() { - return list.isEmpty(); - } - - private final LinkedList list = new LinkedList(); }