hotspot/src/share/vm/classfile/classFileParser.cpp
changeset 46329 53ccc37bda19
parent 46327 91576389a517
child 46352 4ece6d1f3f76
equal deleted inserted replaced
46328:6061df52d610 46329:53ccc37bda19
   813     _local_interfaces = MetadataFactory::new_array<Klass*>(_loader_data, itfs_len, NULL, CHECK);
   813     _local_interfaces = MetadataFactory::new_array<Klass*>(_loader_data, itfs_len, NULL, CHECK);
   814 
   814 
   815     int index;
   815     int index;
   816     for (index = 0; index < itfs_len; index++) {
   816     for (index = 0; index < itfs_len; index++) {
   817       const u2 interface_index = stream->get_u2(CHECK);
   817       const u2 interface_index = stream->get_u2(CHECK);
   818       KlassHandle interf;
   818       Klass* interf;
   819       check_property(
   819       check_property(
   820         valid_klass_reference_at(interface_index),
   820         valid_klass_reference_at(interface_index),
   821         "Interface name has bad constant pool index %u in class file %s",
   821         "Interface name has bad constant pool index %u in class file %s",
   822         interface_index, CHECK);
   822         interface_index, CHECK);
   823       if (cp->tag_at(interface_index).is_klass()) {
   823       if (cp->tag_at(interface_index).is_klass()) {
   824         interf = KlassHandle(THREAD, cp->resolved_klass_at(interface_index));
   824         interf = cp->resolved_klass_at(interface_index);
   825       } else {
   825       } else {
   826         Symbol* const unresolved_klass  = cp->klass_name_at(interface_index);
   826         Symbol* const unresolved_klass  = cp->klass_name_at(interface_index);
   827 
   827 
   828         // Don't need to check legal name because it's checked when parsing constant pool.
   828         // Don't need to check legal name because it's checked when parsing constant pool.
   829         // But need to make sure it's not an array type.
   829         // But need to make sure it's not an array type.
   830         guarantee_property(unresolved_klass->byte_at(0) != JVM_SIGNATURE_ARRAY,
   830         guarantee_property(unresolved_klass->byte_at(0) != JVM_SIGNATURE_ARRAY,
   831                            "Bad interface name in class file %s", CHECK);
   831                            "Bad interface name in class file %s", CHECK);
   832 
   832 
   833         // Call resolve_super so classcircularity is checked
   833         // Call resolve_super so classcircularity is checked
   834         const Klass* const k =
   834         interf = SystemDictionary::resolve_super_or_fail(
   835           SystemDictionary::resolve_super_or_fail(_class_name,
   835                                                   _class_name,
   836                                                   unresolved_klass,
   836                                                   unresolved_klass,
   837                                                   Handle(THREAD, _loader_data->class_loader()),
   837                                                   Handle(THREAD, _loader_data->class_loader()),
   838                                                   _protection_domain,
   838                                                   _protection_domain,
   839                                                   false,
   839                                                   false,
   840                                                   CHECK);
   840                                                   CHECK);
   841         interf = KlassHandle(THREAD, k);
   841       }
   842       }
   842 
   843 
   843       if (!interf->is_interface()) {
   844       if (!interf()->is_interface()) {
       
   845         THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(),
   844         THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(),
   846                    "Implementing class");
   845                    "Implementing class");
   847       }
   846       }
   848 
   847 
   849       if (InstanceKlass::cast(interf())->has_nonstatic_concrete_methods()) {
   848       if (InstanceKlass::cast(interf)->has_nonstatic_concrete_methods()) {
   850         *has_nonstatic_concrete_methods = true;
   849         *has_nonstatic_concrete_methods = true;
   851       }
   850       }
   852       _local_interfaces->at_put(index, interf());
   851       _local_interfaces->at_put(index, interf);
   853     }
   852     }
   854 
   853 
   855     if (!_need_verify || itfs_len <= 1) {
   854     if (!_need_verify || itfs_len <= 1) {
   856       return;
   855       return;
   857     }
   856     }