1.1 --- a/src/share/vm/classfile/classFileParser.cpp Thu Jan 17 18:47:36 2013 -0800 1.2 +++ b/src/share/vm/classfile/classFileParser.cpp Fri Jan 18 11:03:15 2013 +0100 1.3 @@ -2503,26 +2503,38 @@ 1.4 *has_default_methods = true; 1.5 } 1.6 methods->at_put(index, method()); 1.7 - if (*methods_annotations == NULL) { 1.8 - *methods_annotations = 1.9 - MetadataFactory::new_array<AnnotationArray*>(loader_data, length, NULL, CHECK_NULL); 1.10 + 1.11 + if (method_annotations != NULL) { 1.12 + if (*methods_annotations == NULL) { 1.13 + *methods_annotations = 1.14 + MetadataFactory::new_array<AnnotationArray*>(loader_data, length, NULL, CHECK_NULL); 1.15 + } 1.16 + (*methods_annotations)->at_put(index, method_annotations); 1.17 } 1.18 - (*methods_annotations)->at_put(index, method_annotations); 1.19 - if (*methods_parameter_annotations == NULL) { 1.20 - *methods_parameter_annotations = 1.21 - MetadataFactory::new_array<AnnotationArray*>(loader_data, length, NULL, CHECK_NULL); 1.22 + 1.23 + if (method_parameter_annotations != NULL) { 1.24 + if (*methods_parameter_annotations == NULL) { 1.25 + *methods_parameter_annotations = 1.26 + MetadataFactory::new_array<AnnotationArray*>(loader_data, length, NULL, CHECK_NULL); 1.27 + } 1.28 + (*methods_parameter_annotations)->at_put(index, method_parameter_annotations); 1.29 } 1.30 - (*methods_parameter_annotations)->at_put(index, method_parameter_annotations); 1.31 - if (*methods_default_annotations == NULL) { 1.32 - *methods_default_annotations = 1.33 - MetadataFactory::new_array<AnnotationArray*>(loader_data, length, NULL, CHECK_NULL); 1.34 + 1.35 + if (method_default_annotations != NULL) { 1.36 + if (*methods_default_annotations == NULL) { 1.37 + *methods_default_annotations = 1.38 + MetadataFactory::new_array<AnnotationArray*>(loader_data, length, NULL, CHECK_NULL); 1.39 + } 1.40 + (*methods_default_annotations)->at_put(index, method_default_annotations); 1.41 } 1.42 - (*methods_default_annotations)->at_put(index, method_default_annotations); 1.43 - if (*methods_type_annotations == NULL) { 1.44 - *methods_type_annotations = 1.45 - MetadataFactory::new_array<AnnotationArray*>(loader_data, length, NULL, CHECK_NULL); 1.46 + 1.47 + if (method_type_annotations != NULL) { 1.48 + if (*methods_type_annotations == NULL) { 1.49 + *methods_type_annotations = 1.50 + MetadataFactory::new_array<AnnotationArray*>(loader_data, length, NULL, CHECK_NULL); 1.51 + } 1.52 + (*methods_type_annotations)->at_put(index, method_type_annotations); 1.53 } 1.54 - (*methods_type_annotations)->at_put(index, method_type_annotations); 1.55 } 1.56 1.57 if (_need_verify && length > 1) { 1.58 @@ -3338,8 +3350,7 @@ 1.59 bool has_final_method = false; 1.60 AccessFlags promoted_flags; 1.61 promoted_flags.set_flags(0); 1.62 - // These need to be oop pointers because they are allocated lazily 1.63 - // inside parse_methods inside a nested HandleMark 1.64 + 1.65 Array<AnnotationArray*>* methods_annotations = NULL; 1.66 Array<AnnotationArray*>* methods_parameter_annotations = NULL; 1.67 Array<AnnotationArray*>* methods_default_annotations = NULL;