-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gwt-editor-processor fails when the Driver has to edit JavaScriptObject #22
Comments
The exception is caused by a /**
* A helper method to enable cross-casting from any {@link JavaScriptObject}
* type to any other {@link JavaScriptObject} type.
*
* @param <T> the target type
* @return this object as a different type
*/
@SuppressWarnings("unchecked")
public final <T extends JavaScriptObject> T cast() {
return (T) this;
} The error occurs inside the class I think a simple check using |
Hello, As the problem lies in the JavaScriptObject file, I suppose that a fix would need to be in the main gwt package ? Thank you in advance ! |
@nchamouard ATM I am not on my computer. IIRC I had a solution, which needs more testing. I'll came back to you later. |
We ended replacing all JavaScriptObject and JSNI of our project with JsType(isNative=true) |
Thanks for the update. I had no time to test. I'll put it on top of the To-Do list. |
Simple example :
Here is the produced stacktrace :
Caused by: java.lang.ClassCastException: class com.sun.tools.javac.code.Type$TypeVar cannot be cast to class javax.lang.model.type.DeclaredType (com.sun.tools.javac.code.Type$TypeVar is in module jdk.compiler of loader 'app'; javax.lang.model.type.DeclaredType is in module java.compiler of loader 'platform')
at org.gwtproject.editor.processor.model.BeanMethod.deepCompare (BeanMethod.java:169)
at org.gwtproject.editor.processor.model.BeanMethod.isReturnTypeEnclosingElement (BeanMethod.java:162)
at org.gwtproject.editor.processor.model.BeanMethod.access$100 (BeanMethod.java:25)
at org.gwtproject.editor.processor.model.BeanMethod$3.matches (BeanMethod.java:82)
at org.gwtproject.editor.processor.model.BeanMethod.which (BeanMethod.java:114)
at org.gwtproject.editor.processor.model.EditorProperty$Builder.findBeanPropertyMethods (EditorProperty.java:176)
at org.gwtproject.editor.processor.model.EditorProperty$Builder.access (EditorProperty.java:149)
at org.gwtproject.editor.processor.model.EditorProperty$Builder.access (EditorProperty.java:60)
at org.gwtproject.editor.processor.model.EditorModel.calculateEditorData (EditorModel.java:115)
at org.gwtproject.editor.processor.model.EditorModel. (EditorModel.java:68)
at org.gwtproject.editor.processor.DriverProcessor.process (DriverProcessor.java:110)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.callProcessor (JavacProcessingEnvironment.java:985)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs (JavacProcessingEnvironment.java:901)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run (JavacProcessingEnvironment.java:1227)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing (JavacProcessingEnvironment.java:1340)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations (JavaCompiler.java:1258)
at com.sun.tools.javac.main.JavaCompiler.compile (JavaCompiler.java:936)
at com.sun.tools.javac.api.JavacTaskImpl.lambda$doCall$0 (JavacTaskImpl.java:104)
at com.sun.tools.javac.api.JavacTaskImpl.handleExceptions (JavacTaskImpl.java:147)
at com.sun.tools.javac.api.JavacTaskImpl.doCall (JavacTaskImpl.java:100)
at com.sun.tools.javac.api.JavacTaskImpl.call (JavacTaskImpl.java:94)
at org.codehaus.plexus.compiler.javac.JavaxToolsCompiler.compileInProcess (JavaxToolsCompiler.java:136)
at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile (JavacCompiler.java:182)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute (AbstractCompilerMojo.java:1209)
at org.apache.maven.plugin.compiler.CompilerMojo.execute (CompilerMojo.java:198)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:370)
at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:351)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:171)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:163)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke (Method.java:566)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
The text was updated successfully, but these errors were encountered: