Cherry picking r9540 into releases/2.2, Adds a hook to invalidate a rebind within dev mode


git-svn-id: https://google-web-toolkit.googlecode.com/svn/releases/2.2@9541 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/shell/ShellModuleSpaceHost.java b/dev/core/src/com/google/gwt/dev/shell/ShellModuleSpaceHost.java
index 2c1ddf4..8a23629 100644
--- a/dev/core/src/com/google/gwt/dev/shell/ShellModuleSpaceHost.java
+++ b/dev/core/src/com/google/gwt/dev/shell/ShellModuleSpaceHost.java
@@ -84,6 +84,15 @@
     return logger;
   }
 
+  /**
+   * Invalidates the given source type name, so the next rebind request will
+   * generate a type again.
+   */
+  public void invalidateRebind(String sourceTypeName) {
+    checkForModuleSpace();
+    rebindOracle.invalidateRebind(sourceTypeName);
+  }
+
   public void onModuleReady(ModuleSpace readySpace)
       throws UnableToCompleteException {
     this.space = readySpace;
diff --git a/dev/core/src/com/google/gwt/dev/shell/StandardRebindOracle.java b/dev/core/src/com/google/gwt/dev/shell/StandardRebindOracle.java
index 50bb0c2..502b221 100644
--- a/dev/core/src/com/google/gwt/dev/shell/StandardRebindOracle.java
+++ b/dev/core/src/com/google/gwt/dev/shell/StandardRebindOracle.java
@@ -235,6 +235,14 @@
     this.genCtx = genCtx;
   }
 
+  /**
+   * Invalidates the given source type name, so the next rebind request will
+   * generate type again.
+   */
+  public void invalidateRebind(String sourceTypeName) {
+    typeNameBindingMap.remove(sourceTypeName);
+  }
+
   public String rebind(TreeLogger logger, String typeName)
       throws UnableToCompleteException {
     return rebind(logger, typeName, null);