sun.reflect.annotation.EnumConstantNotPresentExceptionProxy at runtime

468 views
Skip to first unread message

Gili T.

unread,
Sep 15, 2013, 1:49:19 PM9/15/13
to checker-fram...@googlegroups.com
Hi,

I am using Checkers versin 1.6.4 using the Maven plugin under JDK 7 update 40. At compile-time I get warnings about missing Annotation enums, such as:

  unknown enum constant java.lang.annotation.ElementType.TYPE_USE

At runtime, I get this exceptions which cause my unit test to fail:

java.lang.ArrayStoreException: sun.reflect.annotation.EnumConstantNotPresentExceptionProxy
at sun.reflect.annotation.AnnotationParser.parseEnumArray(AnnotationParser.java:693) ~[na:1.7.0_40]
at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:482) ~[na:1.7.0_40]
at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:306) ~[na:1.7.0_40]
at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:241) ~[na:1.7.0_40]
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88) ~[na:1.7.0_40]
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70) ~[na:1.7.0_40]
at java.lang.Class.initAnnotationsIfNecessary(Class.java:3168) ~[na:1.7.0_40]
at java.lang.Class.getAnnotation(Class.java:3127) ~[na:1.7.0_40]
at sun.reflect.annotation.AnnotationType.<init>(AnnotationType.java:131) ~[na:1.7.0_40]
at sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:84) ~[na:1.7.0_40]
at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:221) ~[na:1.7.0_40]
at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88) ~[na:1.7.0_40]
at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70) ~[na:1.7.0_40]
at java.lang.reflect.Method.declaredAnnotations(Method.java:714) ~[na:1.7.0_40]
at java.lang.reflect.Method.getAnnotation(Method.java:700) ~[na:1.7.0_40]
at com.google.inject.spi.InjectionPoint.getAtInject(InjectionPoint.java:466) ~[guice-3.0-no_aop.jar:na]
at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:664) ~[guice-3.0-no_aop.jar:na]
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:356) ~[guice-3.0-no_aop.jar:na]
at com.google.inject.internal.MembersInjectorStore.createWithListeners(MembersInjectorStore.java:90) ~[guice-3.0-no_aop.jar:na]
at com.google.inject.internal.MembersInjectorStore.access$000(MembersInjectorStore.java:34) ~[guice-3.0-no_aop.jar:na]
at com.google.inject.internal.MembersInjectorStore$1.create(MembersInjectorStore.java:42) ~[guice-3.0-no_aop.jar:na]
at com.google.inject.internal.MembersInjectorStore$1.create(MembersInjectorStore.java:39) ~[guice-3.0-no_aop.jar:na]
at com.google.inject.internal.FailableCache$1.apply(FailableCache.java:39) ~[guice-3.0-no_aop.jar:na]
at com.google.inject.internal.util.$MapMaker$StrategyImpl.compute(MapMaker.java:549) ~[guice-3.0-no_aop.jar:na]
... 102 common frames omitted

I looked up the enum in question and sure enough it was only added in JDK 8. Does this mean that I cannot safely use Checkers Framework with JDK 7? The only way I can think of fixing this is producing a backported version of Checkers that does not use any JDK8-specific code.

Thank you,
Gili

Werner Dietl

unread,
Sep 15, 2013, 3:46:02 PM9/15/13
to checker-fram...@googlegroups.com, Gili T.
Hi Gili,

all the Java 8 additions that are needed at runtime are included in
checkers/binary/javac.jar.
Make sure to include javac.jar on your bootclasspath and things should work.

cu, WMD.
> --
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Checker Framework discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to checker-framework-...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.



--
http://www.google.com/profiles/wdietl

cowwoc

unread,
Sep 15, 2013, 4:31:53 PM9/15/13
to Werner Dietl, checker-fram...@googlegroups.com
Hi Werner,

I am fairly certain this is something that needs to be fixed inside
your Maven plugin code. I don't think this is something that can be
configure externally. Should I open a bug report?

Gili

Michael Ernst

unread,
Sep 15, 2013, 4:44:02 PM9/15/13
to Checker Framework Discussions, Gili T., Werner Dietl
Gili-

If you think this is the problem, then yes, please open a bug report. If
you give us a reproducible test case, that will help us help you.

Thanks a lot for the bug reports!

-Mike


> Subject: Re: sun.reflect.annotation.EnumConstantNotPresentExceptionProxy
> at runtime
> From: cowwoc <cow...@bbs.darktech.org>
> To: Werner Dietl <wdi...@gmail.com>
> Date: Sun, 15 Sep 2013 16:31:53 -0400

cowwoc

unread,
Sep 15, 2013, 7:54:21 PM9/15/13
to Michael Ernst, Checker Framework Discussions, Werner Dietl
Reply all
Reply to author
Forward
0 new messages