-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
insert-annotations-to-source may raise an exception depending on the class name #110
Comments
The difference is due to |
I also ran insert-annotations-to-source for other files that are in the plume.jar classpath and had no issues. For example, I created the same empty .jaif/.java files with package plume and class name Option and had no issues. plume.Option is on the plume.jar. Why is it different for the plume.MultiVersionControl? |
The underlying cause of the crash is a bug in I do have a workaround for you that I don't want to commit because it's not a foolproof solution: Edit annotation-file-utilities/scripts/insert-annotations-to-source and change the argument of |
Thanks for looking into that Dan, but unfortunately this workaround did not work on my environment -- I changed the last line of the script but the exception is still thrown when running this script for plume.MultiVersionControl. |
Is it the same code (modulo annotations) as the library version? If so, -- Dan. On Mon, Dec 21, 2015 at 9:01 AM, Paulo Barros notifications@github.com
|
Even after modifying the insert-annotations-to-source script like you advised, the file attached on the first message of this thread (bug.zip) still throws an exception when I try to run: $ insert-annotations-to-source MultiVersionControl.jaif MultiVersionControl.java |
Do you have plume-lib in your CLASSPATH already? If so, ensure it's not in -- Dan. On Mon, Dec 21, 2015 at 11:45 AM, Paulo Barros notifications@github.com
|
plume-lib was indeed on my CLASSPATH. I removed it but the error remains: $ echo $CLASSPATH $ insert-annotations-to-source MultiVersionControl.java MultiVersionControl.jaif |
I've fixed the bug that causes the crash, but I'm leaving this issue open until I have implemented a way to distinguish the analysis classpath from the runtime classpath. |
This has also been fixed on my environment since Dan's last message. |
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.
The text was updated successfully, but these errors were encountered: