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
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@5080 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/PermutationWorkerFactory.java b/dev/core/src/com/google/gwt/dev/PermutationWorkerFactory.java
index cc324c5..02a5809 100644
--- a/dev/core/src/com/google/gwt/dev/PermutationWorkerFactory.java
+++ b/dev/core/src/com/google/gwt/dev/PermutationWorkerFactory.java
@@ -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);
}
/**