[Soot-list] Bug with AnnotationGenerator

Eric Bodden bodden at st.informatik.tu-darmstadt.de
Wed Aug 11 03:06:11 EDT 2010


Thanks for the fix!

I have committed the patch in revision 3549.

Eric

--
Dr. Eric Bodden
Software Technology Group, Technische Universität Darmstadt, Germany
Tel: +49 6151 16-5478    Fax: +49 6151 16-5410
Mailing Address: S2|02 A209, Hochschulstraße 10, 64289 Darmstadt



On 11 August 2010 02:13, Hal Hildebrand <hal.hildebrand at gmail.com> wrote:
> I'm using the AnnotationGenerator to add annotations to my methods and
> noticed that the resulting annotation type has the trailing ";" missing.  In
> the class files, compiled with the Java compiler, these annotations have the
> trailing ";".  I have just confirmed that when I load the generated classes
> (from Soot, using the added annotations via AnnotationGenerator), I get:
> java.lang.reflect.GenericSignatureFormatError
> at
> sun.reflect.generics.parser.SignatureParser.error(SignatureParser.java:103)
> at
> sun.reflect.generics.parser.SignatureParser.parseSimpleClassTypeSignature(SignatureParser.java:262)
> at
> sun.reflect.generics.parser.SignatureParser.parseClassTypeSignatureSuffix(SignatureParser.java:270)
> at
> sun.reflect.generics.parser.SignatureParser.parseClassTypeSignature(SignatureParser.java:244)
> at
> sun.reflect.generics.parser.SignatureParser.parseFieldTypeSignature(SignatureParser.java:228)
> at
> sun.reflect.generics.parser.SignatureParser.parseTypeSignature(SignatureParser.java:359)
> at
> sun.reflect.generics.parser.SignatureParser.parseTypeSig(SignatureParser.java:157)
> at
> sun.reflect.annotation.AnnotationParser.parseSig(AnnotationParser.java:367)
> at
> sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:181)
> at
> sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:69)
> at
> sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:52)
> at java.lang.reflect.Method.declaredAnnotations(Method.java:693)
> at java.lang.reflect.Method.getAnnotation(Method.java:679)
> at
> com.hellblazer.primeMover.soot.TestContinuationAnalysis.testAnalysis(TestContinuationAnalysis.java:98)
> Which, I'm pretty sure, means that the annotation should have the trailing
> ";" is required.
> The fix is to replace line 147
> in soot.jimple.toolkits.annotation.j5anno.AnnotationGenerator with:
> annotationName = "L" + annotationName.replace('.','/') + ';';
>
> _______________________________________________
> Soot-list mailing list
> Soot-list at sable.mcgill.ca
> http://mailman.cs.mcgill.ca/mailman/listinfo/soot-list
>
>


More information about the Soot-list mailing list