java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy

JDK Bug System | David Korbel | 4 years ago
  1. 0

    Bug ID: JDK-7183985 (ann) Class.getAnnotation() throws an ArrayStoreException when the annotation class not present

    java.com | 3 months ago
    java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
  2. 0

    [JDK-7183985] (ann) Class.getAnnotation() throws an ArrayStoreException when the annotation class not present - Java Bug System

    java.net | 11 months ago
    java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
  3. 0

    [#JDK-7183985] (ann) Class.getAnnotation() throws an ArrayStoreException when the annotation class not present - Java Bug System

    java.net | 1 year ago
    java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    SYNOPSIS -------- Class.getAnnotation() throws an ArrayStoreException when the annotation class is not present in the classpath OPERATING SYSTEM ---------------- All (tested on Windows and Solaris) FULL JDK VERSION ---------------- JDK 5 and greater, including JDK 8 Note: The ArrayStoreException begin with 5.0u6 (See CR 6322301 fix). PROBLEM DESCRIPTION from LICENSEE --------------------------------- A call to Class.getAnnotation() throws the following java.lang.ArrayStoreException when an annotation's Class is not present on the classpath. The following stack is from JDK8-b39: Exception in thread "main" java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:677) at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:484) at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:308) at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:242) at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88) at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70) at java.lang.Class.initAnnotationsIfNecessary(Class.java:3093) at java.lang.Class.getAnnotation(Class.java:3052) at AnnotationTest.doTest(AnnotationTest.java:9) at AnnotationTest.main(AnnotationTest.java:5) The API specification for java.lang.Class states that Class.getAnnotation() returns this element's annotation for the specified type if such an annotation is present, else null. ArrayStoreException is not a checked Exception so it doesn't have to be declared, but it effectively prevents the API from following the specification - either the annotation should be returned, or null. Currently neither happens. The application could catch the ArrayStoreException and handle it, but Licensee prefers it to be dealt with in the JDK's internal implementation. TESTCASE AND REPRODUCTION INSTRUCTIONS -------------------------------------- Attached WORKAROUND ---------- Catch the undocumented ArrayStoreException and handle it.

    JDK Bug System | 4 years ago | David Korbel
    java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
  6. 0

    SYNOPSIS -------- Class.getAnnotation() throws an ArrayStoreException when the annotation class is not present in the classpath OPERATING SYSTEM ---------------- All (tested on Windows and Solaris) FULL JDK VERSION ---------------- JDK 5 and greater, including JDK 8 Note: The ArrayStoreException begin with 5.0u6 (See CR 6322301 fix). PROBLEM DESCRIPTION from LICENSEE --------------------------------- A call to Class.getAnnotation() throws the following java.lang.ArrayStoreException when an annotation's Class is not present on the classpath. The following stack is from JDK8-b39: Exception in thread "main" java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:677) at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:484) at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:308) at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:242) at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88) at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70) at java.lang.Class.initAnnotationsIfNecessary(Class.java:3093) at java.lang.Class.getAnnotation(Class.java:3052) at AnnotationTest.doTest(AnnotationTest.java:9) at AnnotationTest.main(AnnotationTest.java:5) The API specification for java.lang.Class states that Class.getAnnotation() returns this element's annotation for the specified type if such an annotation is present, else null. ArrayStoreException is not a checked Exception so it doesn't have to be declared, but it effectively prevents the API from following the specification - either the annotation should be returned, or null. Currently neither happens. The application could catch the ArrayStoreException and handle it, but Licensee prefers it to be dealt with in the JDK's internal implementation. TESTCASE AND REPRODUCTION INSTRUCTIONS -------------------------------------- Attached WORKAROUND ---------- Catch the undocumented ArrayStoreException and handle it.

    JDK Bug System | 4 years ago | David Korbel
    java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy

  1. tvrmsmith 20 times, last 2 weeks ago
5 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.ArrayStoreException

    sun.reflect.annotation.TypeNotPresentExceptionProxy

    at sun.reflect.annotation.AnnotationParser.parseClassArray()
  2. Java RT
    Class.getAnnotation
    1. sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:677)
    2. sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:484)
    3. sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:308)
    4. sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:242)
    5. sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88)
    6. sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70)
    7. java.lang.Class.initAnnotationsIfNecessary(Class.java:3093)
    8. java.lang.Class.getAnnotation(Class.java:3052)
    8 frames
  3. Unknown
    AnnotationTest.main
    1. AnnotationTest.doTest(AnnotationTest.java:9)
    2. AnnotationTest.main(AnnotationTest.java:5)
    2 frames