This content has been marked as final.
Show 1 reply
-
1. javassist tries to call a method with wrong return type
davidjencks Jan 20, 2003 8:36 AM (in response to rickgibbs)Hello,
I get the following exception:
Exception in thread "main" java.lang.NoSuchMethodError: mycompany.Type.getValue()Ljava/lang/String;
mycompany.Type is only
public interface Type
{
Object getValue();
}
The generated javassist method body is the following:
{
mycompany.Type type = getType();
Object value = type.getValue();
return ($r)value;
}
the return type of the method is String, so ($r) should do a cast to String.
Where is the error?
Why tries Javassist to call the getValue()Ljava/lang/String method instead of getValue()Ljava/lang/Object
?
Thanks,
Norbi