NorbertSandor / gwt-ent

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

java.util.List with generics fails with compiler error #5

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Reflection still doesn't work for a java.util.List with generics.

Error is in the generated com.gwtent.client.reflection.TypeOracle_Visitor:

public Object invoke(Object instance, String methodName, Object[] args)
throws MethodInvokeException {
        java.util.List content = (java.util.List)instance;
        if (args == null){
          args = new Object[]{};
        }
        if (methodName.equals("add")) {
          checkInvokeParams(methodName, 1, args);
          return Boolean.valueOf(content.add(((java.lang.Object)args[0])));
        } else if (methodName.equals("add")) {
          checkInvokeParams(methodName, 2, args);
          content.add((((Integer)args[0]).intValue()),
((java.lang.Object)args[1]));
          return null;
        }
        ........................
        .......................
        } else if (methodName.equals("toArray")) {
          checkInvokeParams(methodName, 1, args);
          return (Object)content.toArray(((T extends
java.lang.Object[])args[0]));
        } else return super.invoke(instance, methodName, args);
      }

The compiler fails here:

return (Object)content.toArray(((T extends java.lang.Object[])args[0]));

Original issue reported on code.google.com by flavius....@gmail.com on 11 Mar 2009 at 1:47

GoogleCodeExporter commented 9 years ago

Original comment by flavius....@gmail.com on 11 Mar 2009 at 1:50

Attachments:

GoogleCodeExporter commented 9 years ago
Hi, flavius, Thank you for let me know this issue

I can pass all my test case in my computer,
You can check this file to see is it your case.
gwtent\test\com\gwtent\client\test\reflection\TestReflection.java

The fixed issue is here: 
http://code.google.com/p/gwt-ent/issues/detail?id=3&can=1
Can you check with this.

And I uploaded my gwtent.jar as well, can you try with this jar?
Link: http://code.google.com/p/gwt-ent/source/browse/trunk/gwtent/gwtent.jar

If issues still there, can you send me your case?
thanks

Original comment by JamesLuo...@gmail.com on 11 Mar 2009 at 10:01

GoogleCodeExporter commented 9 years ago
The test fails with the same error.

BTW i'm using GWT 1.6M2. Did you get a change to test against it ?

Original comment by flavius....@gmail.com on 12 Mar 2009 at 1:37

GoogleCodeExporter commented 9 years ago
This jar is built with java 6. Please rebuild with java 5, as per issue 4. :)

GWTShell does not work in java 6 on Macs.

Original comment by alex%slo...@gtempaccount.com on 2 Jul 2009 at 10:42