src/share/classes/sun/reflect/annotation/TypeAnnotationParser.java

Print this page

        

*** 126,143 **** } } for (int i = 0; i < size; i++) { @SuppressWarnings("unchecked") ArrayList<TypeAnnotation> list = l[i]; if (list != null) { ! TypeAnnotation[] typeAnnotations = list.toArray(new TypeAnnotation[0]); result[i] = AnnotatedTypeFactory.buildAnnotatedType(types[i], LocationInfo.BASE_LOCATION, typeAnnotations, typeAnnotations, decl); ! } } return result; } // Class helpers --- 126,147 ---- } } for (int i = 0; i < size; i++) { @SuppressWarnings("unchecked") ArrayList<TypeAnnotation> list = l[i]; + TypeAnnotation[] typeAnnotations; if (list != null) { ! typeAnnotations = list.toArray(new TypeAnnotation[list.size()]); ! } else { ! typeAnnotations = EMPTY_TYPE_ANNOTATION_ARRAY; ! } result[i] = AnnotatedTypeFactory.buildAnnotatedType(types[i], LocationInfo.BASE_LOCATION, typeAnnotations, typeAnnotations, decl); ! } return result; } // Class helpers