You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to create a BoundBox of a class with a generic method, the created class doesn't compile due to failing to pick up the details of the generic element.
The method in question looks like this:
public <E extends FeedContent> E copyInto(E copy) {
// do stuff
return copy;
}
But the equivalent method in the BoundBox looks like this:
public E copyIntoNewContent(E arg0) {
try {
Method methodToInvoke = com.mycompany.MyClass.class.getDeclaredMethod("copyInto",E.class);
methodToInvoke.setAccessible(true);
return (E) methodToInvoke.invoke(boundObject,arg0);
}
catch( IllegalAccessException e ) {
throw new BoundBoxException(e);
}
catch( IllegalArgumentException e ) {
throw new BoundBoxException(e);
}
catch( InvocationTargetException e ) {
throw new BoundBoxException(e);
}
catch( NoSuchMethodException e ) {
throw new BoundBoxException(e);
}
}
This results in an error because E cannot be resolved to a type.
The text was updated successfully, but these errors were encountered:
This is a serious issue. In AndroidAnnotations we handled this problem, see this PR. Note that AA uses CodeModel for code generation, which is much more sophisticated then JavaWriter.
When trying to create a BoundBox of a class with a generic method, the created class doesn't compile due to failing to pick up the details of the generic element.
The method in question looks like this:
But the equivalent method in the BoundBox looks like this:
This results in an error because E cannot be resolved to a type.
The text was updated successfully, but these errors were encountered: