Commits
Tarun Sukhani authored 6ce53d05ddb
fix(enhancers): drop Code-level type annotations of methods the enhancers moved (PF-187) Javassist's CodeIterator gap insertion shifts the exception table, line numbers, local variable tables and stack maps, but TypeAnnotationsAttribute has no shift, so a TYPE_USE annotation on a local, cast, instanceof or new kept its pre-enhancement offsets after PropertiesEnhancer (or any enhancer) grew the method. The JVM never reads those, but ProGuard over precompiled/java rejected the class with "Invalid instruction offset" (JClaw #1336). CodeTypeAnnotations.dropWhereCodeMoved runs once at the end of ApplicationClass.enhance(), after every plugin's enhancer: for each method whose code length differs from javaByteCode's it removes the Code attribute's Runtime(In)VisibleTypeAnnotations. Unchanged methods and the type annotations on method_info, field_info and the class are left alone. Guarded by CodeTypeAnnotationsTest, which enhances a fixture through ApplicationClass.enhance() with the real PropertiesEnhancer and checks the remaining localvar_target ranges with the JDK ClassFile API; verified against ProGuard 7.10.0 with jclaw's debug-strip config. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>