RFR 7183985: Class.getAnnotation() throws an ArrayStoreException when the annotation class not present

Liam Miller-Cushon cushon at google.com
Mon Dec 21 20:42:09 UTC 2015


If an annotation value is an array of class literals or enum constants,
calling Class.getAnnotation() fails with ArrayStoreException if the element
type is not found.

This patch implements the proposed fix from the bug thread, which allows
getAnnotation() to succeed and a TypeNotPresentException to be thrown from
Annotation.value().

bug: https://bugs.openjdk.java.net/browse/JDK-7183985

The patch is attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 7183985.patch
Type: text/x-patch
Size: 13219 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20151221/418816f8/7183985.patch>


More information about the core-libs-dev mailing list