Author: [email protected]
Date: Mon Jul 13 16:12:31 2009
New Revision: 5728

Added:
    branches/snapshot-2009.07.07-r5687/dev/core/test/com/google/gwt/dev/cfg/
       - copied from r5727, /trunk/dev/core/test/com/google/gwt/dev/cfg/
     
branches/snapshot-2009.07.07-r5687/dev/core/test/com/google/gwt/dev/cfg/ModuleDefTest.java
       - copied unchanged from r5727,  
/trunk/dev/core/test/com/google/gwt/dev/cfg/ModuleDefTest.java
Modified:
    branches/snapshot-2009.07.07-r5687/   (props changed)
     
branches/snapshot-2009.07.07-r5687/dev/core/src/com/google/gwt/core/ext/ServletContainer.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/dev/core/src/com/google/gwt/core/ext/ServletContainerLauncher.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java
     
branches/snapshot-2009.07.07-r5687/dev/core/src/com/google/gwt/dev/cfg/ModuleDefSchema.java
     
branches/snapshot-2009.07.07-r5687/dev/core/src/com/google/gwt/dev/shell/rewrite/RewriteSingleJsoImplDispatches.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerDisableAggressiveOptimization.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerEnableAssertions.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerOutDir.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerWorkDirOptional.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/dev/core/src/com/google/gwt/dev/util/arg/ArgHandlerWorkDirRequired.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/dev/core/test/com/google/gwt/dev/AboutTest.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/distro-source/linux/src/webAppCreator    
(props changed)
    branches/snapshot-2009.07.07-r5687/distro-source/mac/src/webAppCreator    
(props changed)
     
branches/snapshot-2009.07.07-r5687/distro-source/windows/src/webAppCreator.cmd  
  
(props changed)
     
branches/snapshot-2009.07.07-r5687/eclipse/samples/Hello/Hello-gwtc.launch    
(props changed)
    branches/snapshot-2009.07.07-r5687/samples/dynatable/war/DynaTable.css    
(props changed)
     
branches/snapshot-2009.07.07-r5687/samples/dynatable/war/DynaTable.html    
(props changed)
    branches/snapshot-2009.07.07-r5687/samples/hello/war/Hello.html   (props  
changed)
    branches/snapshot-2009.07.07-r5687/samples/i18n/war/I18N.css   (props  
changed)
    branches/snapshot-2009.07.07-r5687/samples/i18n/war/I18N.html   (props  
changed)
    branches/snapshot-2009.07.07-r5687/samples/json/war/JSON.css   (props  
changed)
    branches/snapshot-2009.07.07-r5687/samples/json/war/JSON.html   (props  
changed)
    branches/snapshot-2009.07.07-r5687/samples/mail/war/Mail.css   (props  
changed)
    branches/snapshot-2009.07.07-r5687/samples/mail/war/Mail.html   (props  
changed)
    branches/snapshot-2009.07.07-r5687/samples/mail/war/gradient.gif    
(props changed)
    branches/snapshot-2009.07.07-r5687/samples/mail/war/leftCorner.gif    
(props changed)
    branches/snapshot-2009.07.07-r5687/samples/mail/war/rightCorner.gif    
(props changed)
    branches/snapshot-2009.07.07-r5687/samples/showcase/war/Showcase.html    
(props changed)
    branches/snapshot-2009.07.07-r5687/samples/simplerpc/war/SimpleRPC.css    
(props changed)
     
branches/snapshot-2009.07.07-r5687/samples/simplerpc/war/SimpleRPC.html    
(props changed)
    branches/snapshot-2009.07.07-r5687/samples/simplexml/war/SimpleXML.css    
(props changed)
     
branches/snapshot-2009.07.07-r5687/samples/simplexml/war/SimpleXML.html    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/core/client/HttpThrowableReporter.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/core/client/JsonUtils.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/event/dom/client/HandlesAllFocusEvents.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/event/dom/client/HandlesAllKeyEvents.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/event/dom/client/HandlesAllMouseEvents.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/event/dom/client/KeyCodes.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/event/dom/client/PrivateMap.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/event/logical/shared/HasValueChangeHandlers.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/event/logical/shared/ValueChangeEvent.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/event/logical/shared/ValueChangeHandler.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/event/shared/DefaultHandlerRegistration.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/event/shared/GwtEvent.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/event/shared/HandlerRegistration.java
    
(props changed)
    branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/resources/    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/resources/client/ClientBundle.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/resources/ext/ClientBundleFields.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/resources/ext/ClientBundleRequirements.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/resources/rebind/context/AbstractClientBundleGenerator.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/resources/rebind/context/InlineClientBundleGenerator.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/resources/rebind/context/StaticClientBundleGenerator.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/user/RemoteServiceObfuscateTypeNames.gwt.xml
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/user/client/ui/ListenerWrapper.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/user/rebind/StringSourceWriter.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/src/com/google/gwt/user/tools/WebAppCreator.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/test/com/google/gwt/core/client/HttpThrowableReporterTest.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/test/com/google/gwt/dev/jjs/test/jsoimpls/UnreferencedImplOfJsoInterface.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/test/com/google/gwt/dev/jjs/test/jsointfs/JsoInterfaceWithUnreferencedImpl.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/test/com/google/gwt/event/dom/client/DomEventTest.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/test/com/google/gwt/event/logical/shared/LogicalEventsTest.java
    
(props changed)
    branches/snapshot-2009.07.07-r5687/user/test/com/google/gwt/resources/    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/test/com/google/gwt/user/RPCSuiteWithObfuscation.gwt.xml
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/test/com/google/gwt/user/client/rpc/CollectionsTestWithTypeObfuscation.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/test/com/google/gwt/user/client/rpc/CustomFieldSerializerTestWithTypeObfuscation.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/test/com/google/gwt/user/client/rpc/EnumsTestWithTypeObfuscation.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/test/com/google/gwt/user/client/rpc/InheritanceTestWithTypeObfuscation.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/test/com/google/gwt/user/client/rpc/ObjectGraphTestWithTypeObfuscation.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/test/com/google/gwt/user/client/rpc/RemoteServiceServletTestWithTypeObfuscation.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/test/com/google/gwt/user/client/rpc/UnicodeEscapingTestWithTypeObfuscation.java
    
(props changed)
     
branches/snapshot-2009.07.07-r5687/user/test/com/google/gwt/user/client/rpc/ValueTypesTestWithTypeObfuscation.java
    
(props changed)

Log:
Merge r5727 from trunk.


Modified:  
branches/snapshot-2009.07.07-r5687/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java
==============================================================================
---  
branches/snapshot-2009.07.07-r5687/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java
    
(original)
+++  
branches/snapshot-2009.07.07-r5687/dev/core/src/com/google/gwt/dev/cfg/ModuleDef.java
    
Mon Jul 13 16:12:31 2009
@@ -72,9 +72,9 @@
      return true;
    }

-  private final Set<Class<? extends Linker>> activeLinkers = new  
LinkedHashSet<Class<? extends Linker>>();
+  private final Set<String> activeLinkers = new LinkedHashSet<String>();

-  private Class<? extends Linker> activePrimaryLinker;
+  private String activePrimaryLinker;

    private final List<String> entryPointTypeNames = new ArrayList<String>();

@@ -134,9 +134,9 @@

      LinkerOrder order = clazz.getAnnotation(LinkerOrder.class);
      if (order.value() == Order.PRIMARY) {
-      activePrimaryLinker = clazz;
+      activePrimaryLinker = name;
      } else {
-      activeLinkers.add(clazz);
+      activeLinkers.add(name);
      }
    }

@@ -196,7 +196,36 @@
      entryPointTypeNames.clear();
    }

-  public void defineLinker(String name, Class<? extends Linker> linker) {
+  /**
+   * Associate a Linker class with a symbolic name. If the name had been
+   * previously assigned, this method will redefine the name. If the  
redefined
+   * linker had been previously added to the set of active linkers, the old
+   * active linker will be replaced with the new linker.
+   */
+  public void defineLinker(TreeLogger logger, String name,
+      Class<? extends Linker> linker) throws UnableToCompleteException {
+    Class<? extends Linker> old = getLinker(name);
+    if (old != null) {
+      // Redefining an existing name
+      if (activePrimaryLinker.equals(name)) {
+        // Make sure the new one is also a primary linker
+        if (!linker.getAnnotation(LinkerOrder.class).value().equals(
+            Order.PRIMARY)) {
+          logger.log(TreeLogger.ERROR, "Redefining primary linker " + name
+              + " with non-primary implementation " + linker.getName());
+          throw new UnableToCompleteException();
+        }
+
+      } else if (activeLinkers.contains(name)) {
+        // Make sure it's a not a primary linker
+        if (linker.getAnnotation(LinkerOrder.class).value().equals(
+            Order.PRIMARY)) {
+          logger.log(TreeLogger.ERROR, "Redefining non-primary linker " +  
name
+              + " with primary implementation " + linker.getName());
+          throw new UnableToCompleteException();
+        }
+      }
+    }
      linkerTypesByName.put(name, linker);
    }

@@ -225,11 +254,17 @@
    }

    public Set<Class<? extends Linker>> getActiveLinkers() {
-    return activeLinkers;
+    Set<Class<? extends Linker>> toReturn = new LinkedHashSet<Class<?  
extends Linker>>();
+    for (String linker : activeLinkers) {
+      assert linkerTypesByName.containsKey(linker) : linker;
+      toReturn.add(linkerTypesByName.get(linker));
+    }
+    return toReturn;
    }

    public Class<? extends Linker> getActivePrimaryLinker() {
-    return activePrimaryLinker;
+    assert linkerTypesByName.containsKey(activePrimaryLinker) :  
activePrimaryLinker;
+    return linkerTypesByName.get(activePrimaryLinker);
    }

    public String[] getAllPublicFiles() {

Modified:  
branches/snapshot-2009.07.07-r5687/dev/core/src/com/google/gwt/dev/cfg/ModuleDefSchema.java
==============================================================================
---  
branches/snapshot-2009.07.07-r5687/dev/core/src/com/google/gwt/dev/cfg/ModuleDefSchema.java
      
(original)
+++  
branches/snapshot-2009.07.07-r5687/dev/core/src/com/google/gwt/dev/cfg/ModuleDefSchema.java
      
Mon Jul 13 16:12:31 2009
@@ -250,7 +250,7 @@
              + LinkerOrder.class.getName() + " annotation", null);
          throw new UnableToCompleteException();
        }
-      moduleDef.defineLinker(name.name, linker);
+      moduleDef.defineLinker(logger, name.name, linker);
        return null;
      }


--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to