< prev index next >

src/hotspot/share/cds/classListParser.cpp

Print this page
*** 472,15 ***
            _class_name, _source);
      THROW_NULL(vmSymbols::java_lang_ClassNotFoundException());
    }
  
    InstanceKlass* k = UnregisteredClasses::load_class(class_name, _source, CHECK_NULL);
!   if (k->local_interfaces()->length() != _interfaces->length()) {
      print_specified_interfaces();
      print_actual_interfaces(k);
      error("The number of interfaces (%d) specified in class list does not match the class file (%d)",
!           _interfaces->length(), k->local_interfaces()->length());
    }
  
    assert(k->is_shared_unregistered_class(), "must be");
  
    bool added = SystemDictionaryShared::add_unregistered_class(THREAD, k);
--- 472,19 ---
            _class_name, _source);
      THROW_NULL(vmSymbols::java_lang_ClassNotFoundException());
    }
  
    InstanceKlass* k = UnregisteredClasses::load_class(class_name, _source, CHECK_NULL);
!   const int actual_num_interfaces = k->local_interfaces()->length();
+   const int specified_num_interfaces = _interfaces->length(); // specified in classlist
+   int expected_num_interfaces = actual_num_interfaces;
+ 
+   if (specified_num_interfaces != expected_num_interfaces) {
      print_specified_interfaces();
      print_actual_interfaces(k);
      error("The number of interfaces (%d) specified in class list does not match the class file (%d)",
!           specified_num_interfaces, expected_num_interfaces);
    }
  
    assert(k->is_shared_unregistered_class(), "must be");
  
    bool added = SystemDictionaryShared::add_unregistered_class(THREAD, k);
< prev index next >