Author: sco...@google.com Date: Wed Mar 25 11:12:37 2009 New Revision: 5080
Modified: trunk/dev/core/src/com/google/gwt/dev/PermutationWorkerFactory.java Log: Removes the PermutationWorkerFactory.lazyFactories cache. The problem with caching these as static state is that the Factories themselves do not appear to be stateless. In particular, ExternalPermutationWorkerFactory has instance state related to accepting a particular number of connections. This is neither threadsafe and also makes it impossible to reuse. We can revisit this change if we decide that PWFs should be both threadsafe and reusable (or stateless). Patch by: scottb, spoon Review by: bobv (TBR), spoon Modified: trunk/dev/core/src/com/google/gwt/dev/PermutationWorkerFactory.java ============================================================================== --- trunk/dev/core/src/com/google/gwt/dev/PermutationWorkerFactory.java (original) +++ trunk/dev/core/src/com/google/gwt/dev/PermutationWorkerFactory.java Wed Mar 25 11:12:37 2009 @@ -210,8 +210,6 @@ */ public static final int WORKERS_AUTO = 0; - private static List<PermutationWorkerFactory> lazyFactories; - /** * Compiles all Permutations in a Precompilation and returns an array of Files * that can be consumed by Link using the system-default @@ -291,11 +289,6 @@ logger = logger.branch(TreeLogger.TRACE, "Creating PermutationWorkerFactory instances"); - if (lazyFactories != null) { - logger.log(TreeLogger.SPAM, "Using lazy instances"); - return lazyFactories; - } - List<PermutationWorkerFactory> mutableFactories = new ArrayList<PermutationWorkerFactory>(); String classes = System.getProperty(FACTORY_IMPL_PROPERTY, ThreadedPermutationWorkerFactory.class.getName() + "," @@ -333,7 +326,7 @@ throw new UnableToCompleteException(); } - return lazyFactories = Collections.unmodifiableList(mutableFactories); + return Collections.unmodifiableList(mutableFactories); } /** --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---