[gwt-contrib] Change in gwt[master]: fixes a compiler crash when parsing illegal runAsync definit...

2013-06-11 Thread John Stalcup

John Stalcup has submitted this change and it was merged.

Change subject: fixes a compiler crash when parsing illegal runAsync  
definitions

..


fixes a compiler crash when parsing illegal runAsync definitions

Change-Id: I3d3feb378a9595e1c3be091b2adf033df9ccae39
Review-Link: https://gwt-review.googlesource.com/#/c/3320/
---
M dev/core/src/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncs.java
M  
dev/core/test/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncsErrorMessagesTest.java

2 files changed, 35 insertions(+), 2 deletions(-)

Approvals:
  Roberto Lublinerman: Looks good to me, approved
  Leeroy Jenkins: Verified



diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncs.java  
b/dev/core/src/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncs.java

index 2e9222a..2f50843 100644
--- a/dev/core/src/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncs.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncs.java
@@ -112,7 +112,11 @@
 } else {
   callbackMethod =  
program.getIndexedMethod("RunAsyncCallback.onSuccess");

 }
-assert callbackMethod != null;
+if (callbackMethod == null) {
+  error(x.getSourceInfo(), "Only a RunAsyncCallback with a defined  
onSuccess() can "

+  + "be passed to runAsync().");
+  return;
+}
 JMethodCall onSuccessCall = new JMethodCall(info, asyncCallback,  
callbackMethod);


 JRunAsync runAsyncNode = new JRunAsync(info, splitPoint, name,  
runAsyncCall, onSuccessCall);
diff --git  
a/dev/core/test/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncsErrorMessagesTest.java  
b/dev/core/test/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncsErrorMessagesTest.java

index 68044bc..af77749 100644
---  
a/dev/core/test/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncsErrorMessagesTest.java
+++  
b/dev/core/test/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncsErrorMessagesTest.java

@@ -52,18 +52,48 @@
 });

 addSnippetImport("test.SplitPoint3");
+expectError("Errors in 'test/EntryPoint.java'");
 expectError("Line 8: Multiple runAsync calls are named  
test.SplitPoint1");

 expectError("One call is at 'test/SplitPoint1.java:5'");
 expectError("One call is at 'test/SplitPoint3.java:5'");
 testSnippet("RunAsyncCode.runAsyncCode(SplitPoint1.class);");
   }

+  public void testMissingOnSuccess() {
+sourceOracle.addOrReplace(new MockJavaResource("test.SplitPoint4") {
+@Override
+  public CharSequence getContent() {
+StringBuffer code = new StringBuffer();
+code.append("package test;\n");
+code.append("import com.google.gwt.core.client.GWT;\n");
+code.append("import  
com.google.gwt.core.client.RunAsyncCallback;\n");

+code.append("public class SplitPoint4 {\n");
+code.append(
+"  public abstract class AbstractRunAsyncCallback implements  
RunAsyncCallback {\n");

+code.append("public void run() {\n");
+code.append("  GWT.runAsync(this);\n");
+code.append("}\n");
+code.append("  }\n");
+code.append("}\n");
+return code;
+  }
+});
+
+addSnippetImport("test.SplitPoint4");
+expectError("Errors in 'test/SplitPoint4.java'");
+expectError("Line 7: Only a RunAsyncCallback with a defined  
onSuccess() can "

++ "be passed to runAsync().");
+testSnippet("new SplitPoint4();");
+  }
+
   public void testNonClassLiteral() {
+expectError("Errors in 'test/EntryPoint.java'");
 expectError("Line 7: Only a class literal may be passed to  
runAsyncCode");
 testSnippet("RunAsyncCode.runAsyncCode(new  
SplitPoint1().getClass());");

   }

   public void testNonExistentSplitPoint() {
+expectError("Errors in 'test/EntryPoint.java'");
 expectError("Line 7: No runAsync call is named java.lang.String");
 testSnippet("RunAsyncCode.runAsyncCode(String.class);");
   }
@@ -111,7 +141,6 @@
   private void initializeTestLoggerBuilder() {
 testLoggerBuilder = new UnitTestTreeLogger.Builder();
 testLoggerBuilder.setLowestLogLevel(TreeLogger.ERROR);
-expectError("Errors in 'test/EntryPoint.java'");
   }

   private void testSnippet(String codeSnippet) {

--
To view, visit https://gwt-review.googlesource.com/3320
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3d3feb378a9595e1c3be091b2adf033df9ccae39
Gerrit-PatchSet: 2
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: John Stalcup 
Gerrit-Reviewer: John Stalcup 
Gerrit-Reviewer: Leeroy Jenkins 
Gerrit-Reviewer: Roberto Lublinerman 

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googl

[gwt-contrib] Change in gwt[master]: fixes a compiler crash when parsing illegal runAsync definit...

2013-06-11 Thread Roberto Lublinerman

Roberto Lublinerman has posted comments on this change.

Change subject: fixes a compiler crash when parsing illegal runAsync  
definitions

..


Patch Set 2: Code-Review+2

--
To view, visit https://gwt-review.googlesource.com/3320
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3d3feb378a9595e1c3be091b2adf033df9ccae39
Gerrit-PatchSet: 2
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: John Stalcup 
Gerrit-Reviewer: John Stalcup 
Gerrit-Reviewer: Leeroy Jenkins 
Gerrit-Reviewer: Roberto Lublinerman 
Gerrit-HasComments: No

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[gwt-contrib] Change in gwt[master]: fixes a compiler crash when parsing illegal runAsync definit...

2013-06-11 Thread John Stalcup

John Stalcup has posted comments on this change.

Change subject: fixes a compiler crash when parsing illegal runAsync  
definitions

..


Patch Set 2:

tests were passing, but not with enable assertions. added an immediate  
return to avoid sticking a null method into a method ref (which was  
triggering the assertion failure)


--
To view, visit https://gwt-review.googlesource.com/3320
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3d3feb378a9595e1c3be091b2adf033df9ccae39
Gerrit-PatchSet: 2
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: John Stalcup 
Gerrit-Reviewer: John Stalcup 
Gerrit-Reviewer: Leeroy Jenkins 
Gerrit-Reviewer: Roberto Lublinerman 
Gerrit-HasComments: No

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[gwt-contrib] Change in gwt[master]: fixes a compiler crash when parsing illegal runAsync definit...

2013-06-11 Thread John Stalcup

Hello Roberto Lublinerman, Leeroy Jenkins,

I'd like you to reexamine a change.  Please visit

https://gwt-review.googlesource.com/3320

to look at the new patch set (#2).

Change subject: fixes a compiler crash when parsing illegal runAsync  
definitions

..

fixes a compiler crash when parsing illegal runAsync definitions

Change-Id: I3d3feb378a9595e1c3be091b2adf033df9ccae39
Review-Link: https://gwt-review.googlesource.com/#/c/3320/
---
M dev/core/src/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncs.java
M  
dev/core/test/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncsErrorMessagesTest.java

2 files changed, 35 insertions(+), 2 deletions(-)


--
To view, visit https://gwt-review.googlesource.com/3320
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I3d3feb378a9595e1c3be091b2adf033df9ccae39
Gerrit-PatchSet: 2
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: John Stalcup 
Gerrit-Reviewer: John Stalcup 
Gerrit-Reviewer: Leeroy Jenkins 
Gerrit-Reviewer: Roberto Lublinerman 

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[gwt-contrib] Change in gwt[master]: fixes a compiler crash when parsing illegal runAsync definit...

2013-06-10 Thread Roberto Lublinerman

Roberto Lublinerman has posted comments on this change.

Change subject: fixes a compiler crash when parsing illegal runAsync  
definitions

..


Patch Set 1: Code-Review+2

--
To view, visit https://gwt-review.googlesource.com/3320
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3d3feb378a9595e1c3be091b2adf033df9ccae39
Gerrit-PatchSet: 1
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: John Stalcup 
Gerrit-Reviewer: John Stalcup 
Gerrit-Reviewer: Leeroy Jenkins 
Gerrit-Reviewer: Roberto Lublinerman 
Gerrit-HasComments: No

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[gwt-contrib] Change in gwt[master]: fixes a compiler crash when parsing illegal runAsync definit...

2013-06-07 Thread John Stalcup

John Stalcup has posted comments on this change.

Change subject: fixes a compiler crash when parsing illegal runAsync  
definitions

..


Patch Set 1:

see https://code.google.com/p/google-web-toolkit/issues/detail?id=6739

--
To view, visit https://gwt-review.googlesource.com/3320
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3d3feb378a9595e1c3be091b2adf033df9ccae39
Gerrit-PatchSet: 1
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: John Stalcup 
Gerrit-Reviewer: John Stalcup 
Gerrit-HasComments: No

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[gwt-contrib] Change in gwt[master]: fixes a compiler crash when parsing illegal runAsync definit...

2013-06-07 Thread John Stalcup

John Stalcup has uploaded a new change for review.

  https://gwt-review.googlesource.com/3320


Change subject: fixes a compiler crash when parsing illegal runAsync  
definitions

..

fixes a compiler crash when parsing illegal runAsync definitions

Change-Id: I3d3feb378a9595e1c3be091b2adf033df9ccae39
---
M dev/core/src/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncs.java
M  
dev/core/test/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncsErrorMessagesTest.java

2 files changed, 34 insertions(+), 2 deletions(-)



diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncs.java  
b/dev/core/src/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncs.java

index 2e9222a..983c972 100644
--- a/dev/core/src/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncs.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncs.java
@@ -112,7 +112,10 @@
 } else {
   callbackMethod =  
program.getIndexedMethod("RunAsyncCallback.onSuccess");

 }
-assert callbackMethod != null;
+if (callbackMethod == null) {
+  error(x.getSourceInfo(), "Only a RunAsyncCallback with a defined  
onSuccess() can "

+  + "be passed to runAsync().");
+}
 JMethodCall onSuccessCall = new JMethodCall(info, asyncCallback,  
callbackMethod);


 JRunAsync runAsyncNode = new JRunAsync(info, splitPoint, name,  
runAsyncCall, onSuccessCall);
diff --git  
a/dev/core/test/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncsErrorMessagesTest.java  
b/dev/core/test/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncsErrorMessagesTest.java

index 68044bc..af77749 100644
---  
a/dev/core/test/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncsErrorMessagesTest.java
+++  
b/dev/core/test/com/google/gwt/dev/jjs/impl/ReplaceRunAsyncsErrorMessagesTest.java

@@ -52,18 +52,48 @@
 });

 addSnippetImport("test.SplitPoint3");
+expectError("Errors in 'test/EntryPoint.java'");
 expectError("Line 8: Multiple runAsync calls are named  
test.SplitPoint1");

 expectError("One call is at 'test/SplitPoint1.java:5'");
 expectError("One call is at 'test/SplitPoint3.java:5'");
 testSnippet("RunAsyncCode.runAsyncCode(SplitPoint1.class);");
   }

+  public void testMissingOnSuccess() {
+sourceOracle.addOrReplace(new MockJavaResource("test.SplitPoint4") {
+@Override
+  public CharSequence getContent() {
+StringBuffer code = new StringBuffer();
+code.append("package test;\n");
+code.append("import com.google.gwt.core.client.GWT;\n");
+code.append("import  
com.google.gwt.core.client.RunAsyncCallback;\n");

+code.append("public class SplitPoint4 {\n");
+code.append(
+"  public abstract class AbstractRunAsyncCallback implements  
RunAsyncCallback {\n");

+code.append("public void run() {\n");
+code.append("  GWT.runAsync(this);\n");
+code.append("}\n");
+code.append("  }\n");
+code.append("}\n");
+return code;
+  }
+});
+
+addSnippetImport("test.SplitPoint4");
+expectError("Errors in 'test/SplitPoint4.java'");
+expectError("Line 7: Only a RunAsyncCallback with a defined  
onSuccess() can "

++ "be passed to runAsync().");
+testSnippet("new SplitPoint4();");
+  }
+
   public void testNonClassLiteral() {
+expectError("Errors in 'test/EntryPoint.java'");
 expectError("Line 7: Only a class literal may be passed to  
runAsyncCode");
 testSnippet("RunAsyncCode.runAsyncCode(new  
SplitPoint1().getClass());");

   }

   public void testNonExistentSplitPoint() {
+expectError("Errors in 'test/EntryPoint.java'");
 expectError("Line 7: No runAsync call is named java.lang.String");
 testSnippet("RunAsyncCode.runAsyncCode(String.class);");
   }
@@ -111,7 +141,6 @@
   private void initializeTestLoggerBuilder() {
 testLoggerBuilder = new UnitTestTreeLogger.Builder();
 testLoggerBuilder.setLowestLogLevel(TreeLogger.ERROR);
-expectError("Errors in 'test/EntryPoint.java'");
   }

   private void testSnippet(String codeSnippet) {

--
To view, visit https://gwt-review.googlesource.com/3320
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3d3feb378a9595e1c3be091b2adf033df9ccae39
Gerrit-PatchSet: 1
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: John Stalcup 

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- 
You received this message because you are subscribed to the Google Groups "GWT Contributors" group.

To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.