jluo-bgl / gwt-ent

Automatically exported from code.google.com/p/gwt-ent
0 stars 0 forks source link

[2.0RC1] Incorrect casting for generic argument #43

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.  Have class such as:
public class Property<E> {
private E value;
public void setValue(E val) {
this.value = val;
}
}
2.  Try and compile.
3.  Get error 
[INFO]       [ERROR] Line 79:  E cannot be resolved
[INFO]       [ERROR] Line 79:  Syntax error on token "extends", . expected

What do you see instead?
    public void setFieldValue(Object instance, String fieldName, Object value) {
      com.xteconline.desktop.client.state.Property content = (com.xteconline.desktop.client.state.Property)instance;
      if (fieldName.equals("value")) {
        content.value=(E extends java.lang.Object)value;
      } else     super.setFieldValue(instance, fieldName, value);
    }

What version of the product are you using? On what operating system?
2.0RC1 on Linux.

Please provide any additional information below.

Original issue reported on code.google.com by ke...@kjordan.net on 10 Mar 2011 at 3:58

GoogleCodeExporter commented 9 years ago
I'm also using the build attached to 
http://code.google.com/p/gwt-ent/issues/detail?id=40

Original comment by ke...@kjordan.net on 10 Mar 2011 at 4:00

GoogleCodeExporter commented 9 years ago
It appears it should probably be using .getParameterizedQualifiedSourceName() 
instead of .getQualifiedSourceName() in ReflectionCreator.setFieldValue for the 
line:
String value = unboxWithoutConvert(jField.getType().getQualifiedSourceName(), 
"value");

I would try and build it against the source in svn, but I can't get that to 
compile.

Original comment by ke...@kjordan.net on 19 Apr 2011 at 4:12

GoogleCodeExporter commented 9 years ago
Have u found any solution for this issue? I get the same. 

Original comment by tnrala...@gmail.com on 7 Jul 2011 at 9:13

GoogleCodeExporter commented 9 years ago
Yeah, I got it to build.  I'm attaching it with the fix, which I believe was 
just doing what I said above (and also getting it to compile against GWT 2.2+). 
 Let me know if it works for you as I've also actually moved on from using 
gwt-ent since all I used it for was creating reflection information and created 
my own due to many bugs I've found with gwt-ent and it not being a very active 
project.

Original comment by ke...@kjordan.net on 7 Jul 2011 at 2:09

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Thanks for your interest. I got your attached jar and after re-compiling the 
exception i got has changed. 

Computing all possible rebind results for 
'com.gwtent.reflection.client.TypeOracle'
  Rebinding com.gwtent.reflection.client.TypeOracle
     Invoking generator com.gwtent.gen.reflection.Reflection__ProxyGenerator
     [ERROR] (Null log message)
java.lang.NullPointerException
    at com.gwtent.gen.GenUtils.getClassTypeAnnotationWithMataAnnotation(GenUtils.java:225)
    at com.gwtent.gen.reflection.ReflectAllInOneCreator.getAllReflectionClasses(ReflectAllInOneCreator.java:148)
    at com.gwtent.gen.reflection.ReflectAllInOneCreator.doGetSourceWriter(ReflectAllInOneCreator.java:417)
    at com.gwtent.gen.LogableSourceCreator.getSourceWriter(LogableSourceCreator.java:137)
    at com.gwtent.gen.LogableSourceCreator.generate(LogableSourceCreator.java:109)
    at com.gwtent.gen.reflection.Reflection__ProxyGenerator.generate(Reflection__ProxyGenerator.java:33)
    at com.google.gwt.core.ext.GeneratorExtWrapper.generate(GeneratorExtWrapper.java:48)
    at com.google.gwt.core.ext.GeneratorExtWrapper.generateIncrementally(GeneratorExtWrapper.java:60)
    at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:662)
    at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
    at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:74)
    at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:259)
    at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:248)
    at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:91)
    at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:106)
    at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.process(AbstractCompiler.java:254)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)
    at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:175)
    at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:288)
    at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.access$400(AbstractCompiler.java:145)
    at com.google.gwt.dev.jdt.AbstractCompiler.compile(AbstractCompiler.java:632)
    at com.google.gwt.dev.jdt.BasicWebModeCompiler.getCompilationUnitDeclarations(BasicWebModeCompiler.java:124)
    at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations(WebModeCompilerFrontEnd.java:54)
    at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:517)
    at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:35)
    at com.google.gwt.dev.Precompile.precompile(Precompile.java:541)
    at com.google.gwt.dev.Precompile.precompile(Precompile.java:495)
    at com.google.gwt.dev.Precompile.precompile(Precompile.java:407)
    at com.google.gwt.dev.Compiler.run(Compiler.java:215)
    at com.google.gwt.dev.Compiler.run(Compiler.java:187)
    at com.google.gwt.dev.Compiler$1.run(Compiler.java:159)
    at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87)
    at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81)
    at com.google.gwt.dev.Compiler.main(Compiler.java:166)
   [ERROR] Errors in 'jar:file:/home/talakus/dev/workspaces/stsWorkspace/CompileTest/war/WEB-INF/lib/gwtent.jar!/com/gwtent/reflection/client/TypeOracle.java'
      [ERROR] Line 24:  Failed to resolve 'com.gwtent.reflection.client.TypeOracle' via deferred binding
   [ERROR] Cannot proceed due to previous errors

My platform has also ext-gwt 2.2.4 and gwt 2.2. Thanks for your help again.

Original comment by tnrala...@gmail.com on 7 Jul 2011 at 2:35

GoogleCodeExporter commented 9 years ago
Somehow that's a null I never hit.  I've put a null-check for it.

Original comment by ke...@kjordan.net on 7 Jul 2011 at 2:38

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for your quick answer. But i have another exception now :( 

Compiling module com.examples.compileTest.CompileTest
   Scanning for additional dependencies: generated://4939EC97304B5D0A67204A5A909D395E/com/gwtent/reflection/client/TypeOracle_Visitor.java
      Computing all possible rebind results for 'com.gwtent.reflection.client.TypeOracle_Visitor.java_lang_annotation_Retention_GWTENTAUTO_ClassType'
         Rebinding com.gwtent.reflection.client.TypeOracle_Visitor.java_lang_annotation_Retention_GWTENTAUTO_ClassType
            Invoking generator com.gwtent.gen.reflection.ReflectionProxyGenerator
               [ERROR] (Null log message)
java.lang.NullPointerException
    at com.gwtent.gen.reflection.GeneratorHelper.addAnnotations_AnnotationImpl(GeneratorHelper.java:201)
    at com.gwtent.gen.reflection.ReflectionCreator$ReflectionSourceCreator.addClassAnnotation(ReflectionCreator.java:309)
    at com.gwtent.gen.reflection.ReflectionCreator$ReflectionSourceCreator.createSource(ReflectionCreator.java:192)
    at com.gwtent.gen.reflection.ReflectionCreator.createSource(ReflectionCreator.java:863)
    at com.gwtent.gen.LogableSourceCreator.generate(LogableSourceCreator.java:113)
    at com.gwtent.gen.reflection.ReflectionProxyGenerator.generate(ReflectionProxyGenerator.java:33)
    at com.google.gwt.core.ext.GeneratorExtWrapper.generate(GeneratorExtWrapper.java:48)
    at com.google.gwt.core.ext.GeneratorExtWrapper.generateIncrementally(GeneratorExtWrapper.java:60)
    at com.google.gwt.dev.javac.StandardGeneratorContext.runGeneratorIncrementally(StandardGeneratorContext.java:662)
    at com.google.gwt.dev.cfg.RuleGenerateWith.realize(RuleGenerateWith.java:41)
    at com.google.gwt.dev.shell.StandardRebindOracle$Rebinder.rebind(StandardRebindOracle.java:74)
    at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:259)
    at com.google.gwt.dev.shell.StandardRebindOracle.rebind(StandardRebindOracle.java:248)
    at com.google.gwt.dev.DistillerRebindPermutationOracle.getAllPossibleRebindAnswers(DistillerRebindPermutationOracle.java:91)
    at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.doFindAdditionalTypesUsingRebinds(WebModeCompilerFrontEnd.java:106)
    at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.process(AbstractCompiler.java:254)
    at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:444)
    at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:175)
    at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.compile(AbstractCompiler.java:288)
    at com.google.gwt.dev.jdt.AbstractCompiler$Sandbox$CompilerImpl.access$400(AbstractCompiler.java:145)
    at com.google.gwt.dev.jdt.AbstractCompiler.compile(AbstractCompiler.java:632)
    at com.google.gwt.dev.jdt.BasicWebModeCompiler.getCompilationUnitDeclarations(BasicWebModeCompiler.java:124)
    at com.google.gwt.dev.jdt.WebModeCompilerFrontEnd.getCompilationUnitDeclarations(WebModeCompilerFrontEnd.java:54)
    at com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:517)
    at com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:35)
    at com.google.gwt.dev.Precompile.precompile(Precompile.java:541)
    at com.google.gwt.dev.Precompile.precompile(Precompile.java:495)
    at com.google.gwt.dev.Precompile.precompile(Precompile.java:407)
    at com.google.gwt.dev.Compiler.run(Compiler.java:215)
    at com.google.gwt.dev.Compiler.run(Compiler.java:187)
    at com.google.gwt.dev.Compiler$1.run(Compiler.java:159)
    at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87)
    at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81)
    at com.google.gwt.dev.Compiler.main(Compiler.java:166)
      Computing all possible rebind results for 'com.gwtent.reflection.client.TypeOracle_Visitor.java_lang_Deprecated_GWTENTAUTO_ClassType'
         Rebinding com.gwtent.reflection.client.TypeOracle_Visitor.java_lang_Deprecated_GWTENTAUTO_ClassType
            Invoking generator com.gwtent.gen.reflection.ReflectionProxyGenerator
               [ERROR] (Null log message)
java.lang.NullPointerException
    at com.gwtent.gen.reflection.GeneratorHelper.addAnnotations_AnnotationImpl(GeneratorHelper.java:201)
    at com.gwtent.gen.reflection.ReflectionCreator$ReflectionSourceCreator.addClassAnnotation(ReflectionCreator.java:309)
    at com.gwtent.gen.reflection.ReflectionCreator$ReflectionSourceCreator.createSource(ReflectionCreator.java:192)
    ....
         Rebinding com.gwtent.reflection.client.TypeOracle_Visitor.com_gwtent_reflection_client_Reflectable_GWTENTAUTO_ClassType
            Invoking generator com.gwtent.gen.reflection.ReflectionProxyGenerator
               [ERROR] (Null log message)
java.lang.NullPointerException
    at com.gwtent.gen.reflection.GeneratorHelper.addAnnotations_AnnotationImpl(GeneratorHelper.java:201)
    at com.gwtent.gen.reflection.ReflectionCreator$ReflectionSourceCreator.addClassAnnotation(ReflectionCreator.java:309)
    ...
      Computing all possible rebind results for 'com.gwtent.reflection.client.TypeOracle_Visitor.java_lang_annotation_Inherited_GWTENTAUTO_ClassType'
         Rebinding com.gwtent.reflection.client.TypeOracle_Visitor.java_lang_annotation_Inherited_GWTENTAUTO_ClassType
            Invoking generator com.gwtent.gen.reflection.ReflectionProxyGenerator
               [ERROR] (Null log message)
java.lang.NullPointerException
    ...
    at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81)
    at com.google.gwt.dev.Compiler.main(Compiler.java:166)
      Computing all possible rebind results for 'com.gwtent.reflection.client.TypeOracle_Visitor.java_lang_annotation_Target_GWTENTAUTO_ClassType'
         Rebinding com.gwtent.reflection.client.TypeOracle_Visitor.java_lang_annotation_Target_GWTENTAUTO_ClassType
            Invoking generator com.gwtent.gen.reflection.ReflectionProxyGenerator
               [ERROR] (Null log message)
java.lang.NullPointerException
    at com.gwtent.gen.reflection.GeneratorHelper.addAnnotations_AnnotationImpl(GeneratorHelper.java:201)
    ...
    at com.google.gwt.dev.Compiler.main(Compiler.java:166)
      Computing all possible rebind results for 'com.gwtent.reflection.client.TypeOracle_Visitor.java_lang_annotation_Documented_GWTENTAUTO_ClassType'
         Rebinding com.gwtent.reflection.client.TypeOracle_Visitor.java_lang_annotation_Documented_GWTENTAUTO_ClassType
            Invoking generator com.gwtent.gen.reflection.ReflectionProxyGenerator
               [ERROR] (Null log message)
java.lang.NullPointerException
    ...
    at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:87)
    at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:81)
    at com.google.gwt.dev.Compiler.main(Compiler.java:166)
      [WARN] For the following type(s), generated source was never committed (did you forget to call commit()?)
         [WARN] com.gwtent.reflection.client.java_lang_annotation_Documented___Reflection
         [WARN] com.gwtent.reflection.client.java_lang_annotation_Inherited___Reflection
         [WARN] com.gwtent.reflection.client.java_lang_annotation_Retention___Reflection
         [WARN] com.gwtent.reflection.client.java_lang_Deprecated___Reflection
         [WARN] com.gwtent.reflection.client.java_lang_annotation_Target___Reflection
         [WARN] com.gwtent.reflection.client.Reflectable___Reflection
   [ERROR] Errors in 'generated://4939EC97304B5D0A67204A5A909D395E/com/gwtent/reflection/client/TypeOracle_Visitor.java'
      [ERROR] Line 27:  Failed to resolve 'com.gwtent.reflection.client.TypeOracle_Visitor.java_lang_annotation_Target_GWTENTAUTO_ClassType' via deferred binding
      [ERROR] Line 28:  Failed to resolve 'com.gwtent.reflection.client.TypeOracle_Visitor.com_gwtent_reflection_client_Reflectable_GWTENTAUTO_ClassType' via deferred binding
      [ERROR] Line 29:  Failed to resolve 'com.gwtent.reflection.client.TypeOracle_Visitor.java_lang_annotation_Documented_GWTENTAUTO_ClassType' via deferred binding
      [ERROR] Line 30:  Failed to resolve 'com.gwtent.reflection.client.TypeOracle_Visitor.java_lang_annotation_Retention_GWTENTAUTO_ClassType' via deferred binding
      [ERROR] Line 31:  Failed to resolve 'com.gwtent.reflection.client.TypeOracle_Visitor.java_lang_annotation_Inherited_GWTENTAUTO_ClassType' via deferred binding
      [ERROR] Line 32:  Failed to resolve 'com.gwtent.reflection.client.TypeOracle_Visitor.java_lang_Deprecated_GWTENTAUTO_ClassType' via deferred binding
   [ERROR] Cannot proceed due to previous errors

Original comment by tnrala...@gmail.com on 7 Jul 2011 at 4:36

GoogleCodeExporter commented 9 years ago
Have you found any solution for above issue? Thanks in advance. 

Original comment by taner.al...@eteration.com on 2 Aug 2011 at 7:18