Revision: 6876 Author: [email protected] Date: Thu Nov 12 12:14:16 2009 Log: Synchronizing ModuleDef#getResourceOracle(), which causes things to break in dev mode because we sometimes create a bunch of oracles that step on each other. Also synchronizing some generator classes that use a cache.
Patch by: jlabanca Review by: jat (desk) http://code.google.com/p/google-web-toolkit/source/detail?r=6876 Modified: /trunk/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java /trunk/user/src/com/google/gwt/i18n/rebind/LocaleUtils.java /trunk/user/src/com/google/gwt/i18n/rebind/ResourceFactory.java ======================================= --- /trunk/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java Tue Nov 10 20:42:30 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java Thu Nov 12 12:14:16 2009 @@ -311,7 +311,7 @@ return properties; } - public ResourceOracle getResourcesOracle() { + public synchronized ResourceOracle getResourcesOracle() { if (lazyResourcesOracle == null) { lazyResourcesOracle = new ResourceOracleImpl(TreeLogger.NULL); PathPrefixSet pathPrefixes = lazySourceOracle.getPathPrefixes(); ======================================= --- /trunk/user/src/com/google/gwt/i18n/rebind/LocaleUtils.java Tue May 5 13:08:14 2009 +++ /trunk/user/src/com/google/gwt/i18n/rebind/LocaleUtils.java Thu Nov 12 12:14:16 2009 @@ -56,7 +56,7 @@ private static final Set<GwtLocale> runtimeLocales = new HashSet<GwtLocale>(); - public static void clear() { + public static synchronized void clear() { allCompileLocales.clear(); allLocales.clear(); compileLocale = null; @@ -69,7 +69,7 @@ * * @return unmodifiable set of all compile-time locales */ - public static Set<GwtLocale> getAllCompileLocales() { + public static synchronized Set<GwtLocale> getAllCompileLocales() { return Collections.unmodifiableSet(allCompileLocales); } @@ -79,14 +79,14 @@ * * @return unmodifiable set of all locales */ - public static Set<GwtLocale> getAllLocales() { + public static synchronized Set<GwtLocale> getAllLocales() { return Collections.unmodifiableSet(allLocales); } /** * @return the static compile-time locale for this permutation. */ - public static GwtLocale getCompileLocale() { + public static synchronized GwtLocale getCompileLocale() { return compileLocale; } @@ -95,7 +95,7 @@ * * @return singleton GwtLocaleFactory instance. */ - public static GwtLocaleFactory getLocaleFactory() { + public static synchronized GwtLocaleFactory getLocaleFactory() { return factory; } @@ -105,7 +105,7 @@ * * @return unmodifiable list of matching locales */ - public static Set<GwtLocale> getRuntimeLocales() { + public static synchronized Set<GwtLocale> getRuntimeLocales() { return Collections.unmodifiableSet(runtimeLocales); } @@ -116,7 +116,7 @@ * @param logger * @param propertyOracle */ - public static void init(TreeLogger logger, PropertyOracle propertyOracle) { + public static synchronized void init(TreeLogger logger, PropertyOracle propertyOracle) { try { SelectionProperty localeProp = propertyOracle.getSelectionProperty(logger, PROP_LOCALE); ======================================= --- /trunk/user/src/com/google/gwt/i18n/rebind/ResourceFactory.java Tue Jul 14 12:57:27 2009 +++ /trunk/user/src/com/google/gwt/i18n/rebind/ResourceFactory.java Thu Nov 12 12:14:16 2009 @@ -101,7 +101,7 @@ /** * Clears the resource cache. */ - public static void clearCache() { + public static synchronized void clearCache() { cache.clear(); } @@ -116,8 +116,8 @@ * {...@link com.google.gwt.core.ext.GeneratorContext#getResourcesOracle()}...@link com.google.gwt.dev.resource.ResourceOracle#getResourceMap() getResourceMap()} * @return resource list */ - public static ResourceList getBundle(TreeLogger logger, JClassType topClass, - GwtLocale bundleLocale, boolean isConstants, + public static synchronized ResourceList getBundle(TreeLogger logger, + JClassType topClass, GwtLocale bundleLocale, boolean isConstants, Map<String, Resource> resourceMap) { List<GwtLocale> locales = bundleLocale.getCompleteSearchList(); List<JClassType> classes = new ArrayList<JClassType>(); -- http://groups.google.com/group/Google-Web-Toolkit-Contributors
