[
https://issues.jboss.org/browse/JASSIST-152?page=com.atlassian.jira.plugi...
]
Yanic Inghelbrecht commented on JASSIST-152:
--------------------------------------------
For your convenience, here's the code for the method for which the instrumentation
fails :
private static Map<String, Column[]> buildColumnOverride(XAnnotatedElement element,
String path) {
Map<String, Column[]> columnOverride = new HashMap<String, Column[]>();
if ( element == null ) return columnOverride;
AttributeOverride singleOverride = element.getAnnotation( AttributeOverride.class );
AttributeOverrides multipleOverrides = element.getAnnotation( AttributeOverrides.class
);
AttributeOverride[] overrides;
if ( singleOverride != null ) {
overrides = new AttributeOverride[] { singleOverride };
}
else if ( multipleOverrides != null ) {
overrides = multipleOverrides.value();
}
else {
overrides = null;
}
//fill overridden columns
if ( overrides != null ) {
for (AttributeOverride depAttr : overrides) {
columnOverride.put(
StringHelper.qualify( path, depAttr.name() ),
new Column[] { depAttr.column() }
);
}
}
return columnOverride;
}
(LGPL licensed, taken from the hibernate 4.0.1 final distribution)
instrumentation fails when building stackmap for local var of array
type : bad array type for AALOAD: null
----------------------------------------------------------------------------------------------------------
Key: JASSIST-152
URL:
https://issues.jboss.org/browse/JASSIST-152
Project: Javassist
Issue Type: Bug
Affects Versions: 3.15.0-GA
Environment: Any
Reporter: Yanic Inghelbrecht
Assignee: Shigeru Chiba
Attachments: demonstration.zip
When trying to instrument the attached org.hibernate.cfg.AbstractPropertyHolder (copied
from the hibernate 4.0.1 final distribution), instrumentation fails with the following
exception :
java.lang.RuntimeException: fatal error:
at javassist.bytecode.stackmap.TypeData$TypeName.getTypeData(TypeData.java:177)
at javassist.bytecode.stackmap.MapMaker.fillStackMap(MapMaker.java:410)
at javassist.bytecode.stackmap.MapMaker.toStackMapBody(MapMaker.java:393)
at javassist.bytecode.stackmap.MapMaker.toStackMap(MapMaker.java:323)
at javassist.bytecode.stackmap.MapMaker.make(MapMaker.java:98)
at javassist.bytecode.MethodInfo.rebuildStackMap(MethodInfo.java:417)
at javassist.bytecode.MethodInfo.rebuildStackMapIf6(MethodInfo.java:399)
at javassist.expr.ExprEditor.doit(ExprEditor.java:113)
at javassist.CtBehavior.instrument(CtBehavior.java:672)
at test_abstractpropertyholder.SimpleTranslator.modify(SimpleTranslator.java:25)
at test_abstractpropertyholder.SimpleTranslator.onLoad(SimpleTranslator.java:19)
at
test_abstractpropertyholder.JavassistInstrumenter.getInstrumentedClass(JavassistInstrumenter.java:21)
at test_abstractpropertyholder.Main.main(Main.java:32)transforming
org.hibernate.cfg.AbstractPropertyHolder
Caused by: javassist.bytecode.BadBytecode: bad array type for AALOAD: null
at javassist.bytecode.stackmap.TypeData$ArrayElement.getName(TypeData.java:422)
at javassist.bytecode.stackmap.TypeData$TypeName.getExpected(TypeData.java:292)
at javassist.bytecode.stackmap.TypeData$TypeName.getTypeData(TypeData.java:175)
... 12 more
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira