-
Notifications
You must be signed in to change notification settings - Fork 35
insert-annotations-to-source may raise an exception depending on the class name #110
Description
Below I have two pairs of .jaif/.java files with similar content (almost empty).
MultiVersionControl.jaif:
package plume:
class MultiVersionControl:
MultiVersionControl.java:
package plume;
public class MultiVersionControl { }
MultiVersionControl2.jaif:
package plume:
class MultiVersionControl2:
MultiVersionControl2.java:
package plume;
public class MultiVersionControl2 { }
Even tough they have similar content, when trying to run the insert-annotations-to-source on both pairs only one of them succeed. On the other, I get an exception. Below is the log:
$ insert-annotations-to-source MultiVersionControl2.jaif MultiVersionControl2.java
Warning: IndexFileSpecification did not find classfile for: plume.MultiVersionControl2
$ insert-annotations-to-source MultiVersionControl.jaif MultiVersionControl.java
IndexFileSpecification had a problem reading class: plume.MultiVersionControl
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 758435786
at org.objectweb.asm.ClassReader.readInt(ClassReader.java:2003)
at annotations.io.classfile.CodeOffsetAdapter$1.readInt(CodeOffsetAdapter.java:90)
at annotations.io.classfile.CodeOffsetAdapter$1.visitTableSwitchInsn(CodeOffsetAdapter.java:180)
at annotator.scanner.MethodOffsetClassVisitor$MethodOffsetMethodVisitor.visitTableSwitchInsn(MethodOffsetClassVisitor.java:204)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:1249)
at org.objectweb.asm.ClassReader.accept(ClassReader.java:445)
at annotator.specification.IndexFileSpecification.parseClass(IndexFileSpecification.java:175)
at annotator.specification.IndexFileSpecification.parseScene(IndexFileSpecification.java:150)
at annotator.specification.IndexFileSpecification.parse(IndexFileSpecification.java:103)
at annotator.Main.main(Main.java:566)
I'm attaching the files to make it easier to reproduce.
bug.zip
It might have to do with the fact that AFU uses plume-lib, and the plume-lib project has a plume.MultiVersionControl class. On the other hand, the bug does not arise on other classes from the plume-lib project.