8266791: Annotation property which is compiled as an array property but changed to a single element throws NullPointerException

Reviewed-by: darcy, jfranck
This commit is contained in:
Rafael Winterhalter 2021-06-14 08:24:24 +00:00 committed by Joel Borggrén-Franck
parent ba601b8407
commit 51f3427e9b
2 changed files with 99 additions and 0 deletions

View file

@ -503,6 +503,9 @@ public class AnnotationParser {
ConstantPool constPool,
Class<?> container) {
int length = buf.getShort() & 0xFFFF; // Number of array components
if (!arrayType.isArray()) {
return parseUnknownArray(length, buf);
}
Class<?> componentType = arrayType.getComponentType();
if (componentType == byte.class) {