Reviewers: scottb,

Description:
Description:
============
JavaToJavaScriptCompiler passes null as the SourceInfo into
JReboundEntryPoint's constructor if the rebind type cannot be determined
immediately, which results in an AssertionError in JNode
(JReboundEntryPoint's super super class) if assertions are enabled.

The SourceInfo in JReboundEntryPoint is actually never used, so
disabling assertions masks the exception without causing any problems.
I ran into this after my recent JUnitShell patch, which now provides a
Deferring Binding for GWTRunnerImpl, triggering this (obscure?) else
statement.


Fix:
===
We now pass the SourceInfo of the mainType instead of null.


Testing:
=======
I verified I can now run tests in manual mode with assertions enabled.

Please review this at http://gwt-code-reviews.appspot.com/67801

Affected files:
   dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java


Index: dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java
===================================================================
--- dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java    
(revision 6149)
+++ dev/core/src/com/google/gwt/dev/jjs/JavaToJavaScriptCompiler.java    
(working copy)
@@ -794,8 +794,8 @@
        if (resultTypes.size() == 1) {
          block.addStmt(entryCalls.get(0).makeStatement());
        } else {
-        JReboundEntryPoint reboundEntryPoint = new JReboundEntryPoint(null,
-            mainType, resultTypes, entryCalls);
+        JReboundEntryPoint reboundEntryPoint = new JReboundEntryPoint(
+            mainType.getSourceInfo(), mainType, resultTypes, entryCalls);
          block.addStmt(reboundEntryPoint);
        }
      }



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

Reply via email to