GWT 2.8 Compiler Question for Streams

615 views
Skip to first unread message

Paul Mazzuca

unread,
Dec 29, 2015, 1:22:17 PM12/29/15
to GWT Users

Any reason why I would be receiving a compiler error in the code below?


//compiles

this.mybutton.addClickHandler(c -> dosomething());



//does not compile
Arrays.asList("one", "two").stream();


I am using the beta Maven release of GWT 2.8 with jdk 1.8.0_60  and am using super dev mode.  


This is either a compiler bug or a Generator has legitimately stopped creating these types.
[INFO]          Compiling 1 permutation
[INFO]             Compiling permutation 0...
[INFO]             [ERROR] An internal compiler exception occurred
[INFO] com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error during visit.
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.translateException(JVisitor.java:111)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:130)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:122)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:118)
[INFO] at com.google.gwt.dev.jjs.ast.JReturnStatement.traverse(JReturnStatement.java:40)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:146)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.acceptWithInsertRemove(JVisitor.java:168)
[INFO] at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:92)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:127)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:139)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:135)
[INFO] at com.google.gwt.dev.jjs.ast.JMethodBody.traverse(JMethodBody.java:83)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:127)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:122)
[INFO] at com.google.gwt.dev.jjs.ast.JMethod.visitChildren(JMethod.java:730)
[INFO] at com.google.gwt.dev.jjs.ast.JMethod.traverse(JMethod.java:722)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:146)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.acceptWithInsertRemoveImmutable(JVisitor.java:172)
[INFO] at com.google.gwt.dev.jjs.ast.JClassType.traverse(JClassType.java:142)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:127)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:122)
[INFO] at com.google.gwt.dev.jjs.ast.JProgram.visitModuleTypes(JProgram.java:1288)
[INFO] at com.google.gwt.dev.jjs.ast.JProgram.traverse(JProgram.java:1253)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:127)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:122)
[INFO] at com.google.gwt.dev.jjs.impl.ControlFlowRecorder.execImpl(ControlFlowRecorder.java:163)
[INFO] at com.google.gwt.dev.jjs.impl.ControlFlowRecorder.exec(ControlFlowRecorder.java:46)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.maybeRecordReferencesAndControlFlow(JavaToJavaScriptCompiler.java:474)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compilePermutation(JavaToJavaScriptCompiler.java:352)
[INFO] at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.compilePermutation(JavaToJavaScriptCompiler.java:272)
[INFO] at com.google.gwt.dev.CompilePerms.compile(CompilePerms.java:198)
[INFO] at com.google.gwt.dev.ThreadedPermutationWorkerFactory$ThreadedPermutationWorker.compile(ThreadedPermutationWorkerFactory.java:50)
[INFO] at com.google.gwt.dev.PermutationWorkerFactory$Manager$WorkerThread.run(PermutationWorkerFactory.java:74)
[INFO] at java.lang.Thread.run(Thread.java:745)
[INFO] Caused by: java.lang.NullPointerException
[INFO] at com.google.gwt.dev.jjs.ast.JMethod.getJsniSignature(JMethod.java:560)
[INFO] at com.google.gwt.dev.jjs.impl.ControlFlowRecorder.computeName(ControlFlowRecorder.java:50)
[INFO] at com.google.gwt.dev.jjs.impl.ControlFlowRecorder.processMethodCall(ControlFlowRecorder.java:195)
[INFO] at com.google.gwt.dev.jjs.impl.ControlFlowRecorder.visit(ControlFlowRecorder.java:158)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.visit(JVisitor.java:683)
[INFO] at com.google.gwt.dev.jjs.ast.JNewInstance.traverse(JNewInstance.java:73)
[INFO] at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:127)
[INFO] ... 32 more

Juan Pablo Gardella

unread,
Dec 29, 2015, 1:26:50 PM12/29/15
to google-we...@googlegroups.com
stream() method is not mentioned in http://www.gwtproject.org/doc/latest/RefJreEmulation.html#Package_java_util. Maybe this is the reason.

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To post to this group, send email to google-we...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

Paul Mazzuca

unread,
Dec 29, 2015, 1:30:22 PM12/29/15
to google-we...@googlegroups.com
That reference is for the "latest", which I am assuming is still for 2.7, not 2.8?

--
You received this message because you are subscribed to a topic in the Google Groups "GWT Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-web-toolkit/FbTLVBfrFmM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-web-tool...@googlegroups.com.

Juan Pablo Gardella

unread,
Dec 29, 2015, 1:38:48 PM12/29/15
to google-we...@googlegroups.com

Paul Mazzuca

unread,
Dec 29, 2015, 1:44:12 PM12/29/15
to google-we...@googlegroups.com
It appears that you are correct.  I misread the posts the first time I searched. Thanks for the quick clarification.

Pablo Nussembaum

unread,
Dec 29, 2015, 9:39:57 PM12/29/15
to google-we...@googlegroups.com
You can still use Guava functional idioms in particular FluentIterable [1] gives you a more java8 feeling

[1] http://google.github.io/guava/releases/snapshot/api/docs/com/google/common/collect/FluentIterable.html
Reply all
Reply to author
Forward
0 new messages