Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-7183985 (ann) Class.getAnnotation() throws an ArrayStoreException when the annotation class not present
  3. JDK-8209742

Release Note: Method Class::getAnnotation Throws a TypeNotPresentException When the Annotation Class Is Not Present

XMLWordPrintable

    • Verified

      When `java.lang.Class::getAnnotation` is called to retrieve an annotation, and the annotation has an array value that references a missing class, attempting to read that value results in a `java.lang.TypeNotPresentException`.

      In previous releases the call to `Class::getAnnotation` incorrectly resulted in a `java.lang.ArrayStoreException`. Any programs that explicitly handled that exception should be updated to handle `java.lang.TypeNotPresentException` instead.

            cushon Liam Miller-Cushon
            cushon Liam Miller-Cushon
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: