The design seems a bit opaque - I'm having trouble following what the invariants are and what's going on with the concurrency. Can you explain it a bit more?
http://gwt-code-reviews.appspot.com/1490801/diff/11002/dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java File dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java (right): http://gwt-code-reviews.appspot.com/1490801/diff/11002/dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java#newcode49 dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java:49: * A class that manages a persistent cache of {@link CompilationUnit} instances. Since the design changed, is there anything you need to update in the JavaDoc? http://gwt-code-reviews.appspot.com/1490801/diff/11002/dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java#newcode113 dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java:113: private static File createCacheFile(TreeLogger logger, File cacheDirectory) I haven't seen private methods at the top of the file before. Can we move these below the public methods? http://gwt-code-reviews.appspot.com/1490801/diff/11002/dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java#newcode162 dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java:162: private Future<Boolean> purgeTaskStatus; Perhaps a CountDownLatch would be better here? CountDownLatch purgeDone http://gwt-code-reviews.appspot.com/1490801/diff/11002/dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java#newcode269 dev/core/src/com/google/gwt/dev/javac/PersistentUnitCache.java:269: Future<Boolean> status = backgroundService.submit(shutdownThreadTask, Boolean.TRUE); It's unclear what you're doing with backgroundService. In particular, couldn't it have shut down earlier? (line 304). I'm not sure why you're going through the trouble of shutting it down early and putting checks everywhere to see if it's shut down. http://gwt-code-reviews.appspot.com/1490801/ -- http://groups.google.com/group/Google-Web-Toolkit-Contributors