Friday, November 8, 2024

Re: Updating to GWT 2.12 SuperDevMode on start: JSwitchStatement cannot be cast to class com.google.gwt.dev.jjs.ast.JExpression

Thanks for the report, looks like you're running into https://github.com/gwtproject/gwt/issues/10024. We have a fix for that merged, you can test the HEAD-SNAPSHOT release from the sonatype snapshots repository (https://oss.sonatype.org/content/repositories/snapshots/), or wait for the 2.12.1 release (see https://github.com/gwtproject/gwt/milestone/24, will likely only contain that fix plus one other long-standing issue that impacts latest jsinterop-base and elemental2).

You can also find the failing code (easier to spot running the compiler) and add the missing "{}"s in the "if" that contains the switch statement, that will work around this bug.

On Friday, November 8, 2024 at 6:53:40 AM UTC-6 ora...@gmail.com wrote:
Hello,

I have updated from GWT 2.11 to 2.12. SuperDevMode does not start in Intellij IDEA with the following exception. Any idea how to fix this?
com.google.gwt.dev.jjs.InternalCompilerException: Error constructing Java AST
at com.google.gwt.dev.jjs.impl.GwtAstBuilder.translateException(GwtAstBuilder.java:4181)
at com.google.gwt.dev.jjs.impl.GwtAstBuilder$AstVisitor.endVisit(GwtAstBuilder.java:1091)
at org.eclipse.jdt.internal.compiler.ast.IfStatement.traverse(IfStatement.java:335)
at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.traverse(MethodDeclaration.java:437)
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1699)
at com.google.gwt.dev.jjs.impl.GwtAstBuilder.processImpl(GwtAstBuilder.java:4117)
at com.google.gwt.dev.jjs.impl.GwtAstBuilder.process(GwtAstBuilder.java:4155)
at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater$UnitProcessorImpl.process(CompilationStateBuilder.java:128)
at com.google.gwt.dev.javac.JdtCompiler$CompilerImpl.process(JdtCompiler.java:322)
at org.eclipse.jdt.internal.compiler.Compiler.processCompiledUnits(Compiler.java:575)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:475)
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:426)
at com.google.gwt.dev.javac.JdtCompiler.doCompile(JdtCompiler.java:1021)
at com.google.gwt.dev.javac.CompilationStateBuilder$CompileMoreLater.compile(CompilationStateBuilder.java:322)
at com.google.gwt.dev.javac.CompilationStateBuilder.doBuildFrom(CompilationStateBuilder.java:532)
at com.google.gwt.dev.javac.CompilationStateBuilder.buildFrom(CompilationStateBuilder.java:464)
at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:426)
at com.google.gwt.dev.codeserver.Recompiler.initWithoutPrecompile(Recompiler.java:213)
at com.google.gwt.dev.codeserver.Outbox.maybePrecompile(Outbox.java:89)
at com.google.gwt.dev.codeserver.Outbox.<init>(Outbox.java:61)
at com.google.gwt.dev.codeserver.CodeServer.makeOutboxTable(CodeServer.java:192)
at com.google.gwt.dev.codeserver.CodeServer.start(CodeServer.java:151)
at com.google.gwt.dev.codeserver.CodeServer.main(CodeServer.java:104)
at com.google.gwt.dev.codeserver.CodeServer.main(CodeServer.java:55)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at com.google.gwt.dev.shell.SuperDevListener.runCodeServer(SuperDevListener.java:118)
at com.google.gwt.dev.shell.SuperDevListener.start(SuperDevListener.java:97)
at com.google.gwt.dev.DevMode.ensureCodeServerListener(DevMode.java:664)
at com.google.gwt.dev.DevModeBase.doStartup(DevModeBase.java:785)
at com.google.gwt.dev.DevMode.doStartup(DevMode.java:549)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:888)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:705)
at com.google.gwt.dev.DevMode.main(DevMode.java:430)
Caused by: java.lang.ClassCastException: class com.google.gwt.dev.jjs.ast.JSwitchStatement cannot be cast to class com.google.gwt.dev.jjs.ast.JExpression (com.google.gwt.dev.jjs.ast.JSwitchStatement and com.google.gwt.dev.jjs.ast.JExpression are in unnamed module of loader 'app')
at com.google.gwt.dev.jjs.impl.GwtAstBuilder$AstVisitor.pop(GwtAstBuilder.java:2816)
at com.google.gwt.dev.jjs.impl.GwtAstBuilder$AstVisitor.endVisit(GwtAstBuilder.java:1087)
... 34 more

Thanks,
Oleg

--
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-toolkit+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-web-toolkit/374c0074-6ec0-4ced-a70f-ee713141b0d0n%40googlegroups.com.

No comments:

Post a Comment