question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error Processing Annotations With Parameters

See original GitHub issue

If one creates an annotation with the following definition and uses it you get an ArrayAccessException. If the annotation is not present in the class file this error goes away (i.e., a different retention policy).

@Retention(RUNTIME)
@Target({ TYPE, FIELD, METHOD, PARAMETER, CONSTRUCTOR, LOCAL_VARIABLE, ANNOTATION_TYPE, PACKAGE, TYPE_PARAMETER,
		TYPE_USE })
public @interface MyAnnotation {
	 String[] value();
}
java.lang.ArrayStoreException
	at java.lang.Throwable.fillInStackTrace$$PHOSPHORTAGGED(Throwable.java)
	at java.lang.Throwable.fillInStackTrace$$PHOSPHORTAGGED(Throwable.java:783)
	at java.lang.Throwable.<init>(Throwable.java:250)
	at java.lang.Exception.<init>(Exception.java:54)
	at java.lang.RuntimeException.<init>(RuntimeException.java:51)
	at java.lang.ArrayStoreException.<init>(ArrayStoreException.java:48)
	at java.lang.ArrayStoreException.<init>(ArrayStoreException.java)
	at java.lang.System.arraycopy(Native Method)
	at edu.columbia.cs.psl.phosphor.TaintUtils.arraycopy(TaintUtils.java:526)
	at java.util.ArrayList.toArray$$PHOSPHORTAGGED(ArrayList.java:408)
	at java.util.ArrayList.toArray(ArrayList.java)
	at edu.columbia.cs.psl.phosphor.instrumenter.TaintTrackingClassVisitor.visitAnnotations(TaintTrackingClassVisitor.java:1367)
	at edu.columbia.cs.psl.phosphor.instrumenter.TaintTrackingClassVisitor.visitEnd(TaintTrackingClassVisitor.java:879)
	at edu.columbia.cs.psl.phosphor.org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
	at edu.columbia.cs.psl.phosphor.org.objectweb.asm.commons.SerialVersionUIDAdder.visitEnd(Unknown Source)
	at edu.columbia.cs.psl.phosphor.org.objectweb.asm.ClassReader.accept(Unknown Source)
	at edu.columbia.cs.psl.phosphor.org.objectweb.asm.ClassReader.accept(Unknown Source)
	at edu.columbia.cs.psl.phosphor.PreMain$PCLoggingTransformer._transform(PreMain.java:310)
	at edu.columbia.cs.psl.phosphor.PreMain$PCLoggingTransformer.transform(PreMain.java:162)
	at edu.columbia.cs.psl.phosphor.PreMain$PCLoggingTransformer.transform$$PHOSPHORTAGGED(PreMain.java:138)
	at sun.instrument.TransformerManager.transform$$PHOSPHORTAGGED(TransformerManager.java:188)
	at sun.instrument.InstrumentationImpl.transform$$PHOSPHORTAGGED(InstrumentationImpl.java:428)
	at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass1$$PHOSPHORTAGGED(ClassLoader.java)
	at java.lang.ClassLoader.defineClass$$PHOSPHORTAGGED(ClassLoader.java:760)
	at java.security.SecureClassLoader.defineClass$$PHOSPHORTAGGED(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass$$PHOSPHORTAGGED(URLClassLoader.java:467)
	at java.net.URLClassLoader.access$100$$PHOSPHORTAGGED(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run$$PHOSPHORTAGGED(URLClassLoader.java:368)
	at java.net.URLClassLoader$1.run$$PHOSPHORTAGGED(URLClassLoader.java:362)
	at java.net.URLClassLoader$1.run(URLClassLoader.java)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessController.doPrivileged$$PHOSPHORTAGGED(AccessController.java)
	at java.net.URLClassLoader.findClass$$PHOSPHORTAGGED(URLClassLoader.java:361)
	at java.lang.ClassLoader.loadClass$$PHOSPHORTAGGED(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass$$PHOSPHORTAGGED(Launcher.java:331)
	at java.lang.ClassLoader.loadClass$$PHOSPHORTAGGED(ClassLoader.java:357)
	at sun.launcher.LauncherHelper.checkAndLoadMain$$PHOSPHORTAGGED(LauncherHelper.java:495)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java)
java.lang.ArrayStoreException
	at java.lang.Throwable.fillInStackTrace$$PHOSPHORTAGGED(Throwable.java)
	at java.lang.Throwable.fillInStackTrace$$PHOSPHORTAGGED(Throwable.java:783)
	at java.lang.Throwable.<init>(Throwable.java:250)
	at java.lang.Exception.<init>(Exception.java:54)
	at java.lang.RuntimeException.<init>(RuntimeException.java:51)
	at java.lang.ArrayStoreException.<init>(ArrayStoreException.java:48)
	at java.lang.ArrayStoreException.<init>(ArrayStoreException.java)
	at java.lang.System.arraycopy(Native Method)
	at edu.columbia.cs.psl.phosphor.TaintUtils.arraycopy(TaintUtils.java:526)
	at java.util.ArrayList.toArray$$PHOSPHORTAGGED(ArrayList.java:408)
	at java.util.ArrayList.toArray(ArrayList.java)
	at edu.columbia.cs.psl.phosphor.instrumenter.TaintTrackingClassVisitor.visitAnnotations(TaintTrackingClassVisitor.java:1367)
	at edu.columbia.cs.psl.phosphor.instrumenter.TaintTrackingClassVisitor.visitEnd(TaintTrackingClassVisitor.java:879)
	at edu.columbia.cs.psl.phosphor.org.objectweb.asm.ClassVisitor.visitEnd(Unknown Source)
	at edu.columbia.cs.psl.phosphor.org.objectweb.asm.commons.SerialVersionUIDAdder.visitEnd(Unknown Source)
	at edu.columbia.cs.psl.phosphor.org.objectweb.asm.ClassReader.accept(Unknown Source)
	at edu.columbia.cs.psl.phosphor.org.objectweb.asm.ClassReader.accept(Unknown Source)
	at edu.columbia.cs.psl.phosphor.PreMain$PCLoggingTransformer._transform(PreMain.java:310)
	at edu.columbia.cs.psl.phosphor.PreMain$PCLoggingTransformer.transform(PreMain.java:162)
	at edu.columbia.cs.psl.phosphor.PreMain$PCLoggingTransformer.transform$$PHOSPHORTAGGED(PreMain.java:138)
	at sun.instrument.TransformerManager.transform$$PHOSPHORTAGGED(TransformerManager.java:188)
	at sun.instrument.InstrumentationImpl.transform$$PHOSPHORTAGGED(InstrumentationImpl.java:428)
	at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java)
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass1$$PHOSPHORTAGGED(ClassLoader.java)
	at java.lang.ClassLoader.defineClass$$PHOSPHORTAGGED(ClassLoader.java:760)
	at java.security.SecureClassLoader.defineClass$$PHOSPHORTAGGED(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass$$PHOSPHORTAGGED(URLClassLoader.java:467)
	at java.net.URLClassLoader.access$100$$PHOSPHORTAGGED(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run$$PHOSPHORTAGGED(URLClassLoader.java:368)
	at java.net.URLClassLoader$1.run$$PHOSPHORTAGGED(URLClassLoader.java:362)
	at java.net.URLClassLoader$1.run(URLClassLoader.java)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessController.doPrivileged$$PHOSPHORTAGGED(AccessController.java)
	at java.net.URLClassLoader.findClass$$PHOSPHORTAGGED(URLClassLoader.java:361)
	at java.lang.ClassLoader.loadClass$$PHOSPHORTAGGED(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass$$PHOSPHORTAGGED(Launcher.java:331)
	at java.lang.ClassLoader.loadClass$$PHOSPHORTAGGED(ClassLoader.java:357)
	at sun.launcher.LauncherHelper.checkAndLoadMain$$PHOSPHORTAGGED(LauncherHelper.java:495)
	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
jon-bellcommented, Aug 5, 2017

Thanks & Sorry - I was unnecessarily copying local var annotations when generating wrappers for methods - stupid, because the LVs don’t exist in the wrappers.

0reactions
jsingletcommented, Aug 5, 2017

Thanks for the fix!

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - Annotation Processor cannot read annotations on a ...
I'm trying to write a Java annotationProcessor that finds classes with a CreateTable annotation that contains many parameters.
Read more >
An Introduction to Annotations and Annotation Processing in ...
Annotations provide information to a program at compile time or at runtime based on which the program can take further action.
Read more >
Advanced Annotation Processing | Kodeco, the new ...
Annotation processing is a powerful tool that allows you to pack more data into your code, and then use that data to generate...
Read more >
Java Annotation Processing and Creating a Builder - Baeldung
A quick and practical guide to annotation processing in Java, showing you how to create a builder from a POJO.
Read more >
Annotation Processing 101 - Hannes Dorfmann
Post by Hannes Dorfmann; Jan 10, 2015. In this blog entry I would like to explain how to write an annotation processor.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found