[
https://jira.jboss.org/jira/browse/JASSIST-82?page=com.atlassian.jira.plu...
]
Shigeru Chiba commented on JASSIST-82:
--------------------------------------
I guess you called getFiled() after calling replace() on the same FieldAccess object.
Since replace() modifies the bytecode, getField() does not work any more. This is a
specification for performance.
FieldAccess.getField() throws RuntimeException:
javassist.bytecode.ClassInfo cannot be cast to javassist.bytecode.FieldrefInfo
------------------------------------------------------------------------------------------------------------------------------
Key: JASSIST-82
URL:
https://jira.jboss.org/jira/browse/JASSIST-82
Project: Javassist
Issue Type: Bug
Affects Versions: 3.10.0.GA
Reporter: Martin Burger
Assignee: Shigeru Chiba
My code calls javassist.expr.FieldAccess.getField() on an instrumented class. This method
call fails with a RuntimeException: javassist.bytecode.ClassInfo cannot be cast to
javassist.bytecode.FieldrefInfo:
java.lang.ClassCastException: javassist.bytecode.ClassInfo cannot be cast to
javassist.bytecode.FieldrefInfo
at javassist.bytecode.ConstPool.getFieldrefClassName(ConstPool.java:258)
at javassist.expr.FieldAccess.getClassName(FieldAccess.java:97)
at javassist.expr.FieldAccess.getCtClass(FieldAccess.java:89)
at javassist.expr.FieldAccess.getField(FieldAccess.java:112)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira