src/share/vm/classfile/systemDictionary.cpp

changeset 9966
baf9f57c9b46
parent 9892
9a4141de094d
child 10014
6b836efa38fe
     1.1 --- a/src/share/vm/classfile/systemDictionary.cpp	Mon Mar 23 17:57:13 2020 +0000
     1.2 +++ b/src/share/vm/classfile/systemDictionary.cpp	Mon May 05 19:53:00 2014 -0400
     1.3 @@ -185,12 +185,14 @@
     1.4    if (HAS_PENDING_EXCEPTION || klass == NULL) {
     1.5      KlassHandle k_h(THREAD, klass);
     1.6      // can return a null klass
     1.7 -    klass = handle_resolution_exception(class_name, class_loader, protection_domain, throw_error, k_h, THREAD);
     1.8 +    klass = handle_resolution_exception(class_name, throw_error, k_h, THREAD);
     1.9    }
    1.10    return klass;
    1.11  }
    1.12  
    1.13 -Klass* SystemDictionary::handle_resolution_exception(Symbol* class_name, Handle class_loader, Handle protection_domain, bool throw_error, KlassHandle klass_h, TRAPS) {
    1.14 +Klass* SystemDictionary::handle_resolution_exception(Symbol* class_name,
    1.15 +                                                     bool throw_error,
    1.16 +                                                     KlassHandle klass_h, TRAPS) {
    1.17    if (HAS_PENDING_EXCEPTION) {
    1.18      // If we have a pending exception we forward it to the caller, unless throw_error is true,
    1.19      // in which case we have to check whether the pending exception is a ClassNotFoundException,
    1.20 @@ -398,7 +400,7 @@
    1.21    }
    1.22    if (HAS_PENDING_EXCEPTION || superk_h() == NULL) {
    1.23      // can null superk
    1.24 -    superk_h = KlassHandle(THREAD, handle_resolution_exception(class_name, class_loader, protection_domain, true, superk_h, THREAD));
    1.25 +    superk_h = KlassHandle(THREAD, handle_resolution_exception(class_name, true, superk_h, THREAD));
    1.26    }
    1.27  
    1.28    return superk_h();
    1.29 @@ -2246,12 +2248,13 @@
    1.30  
    1.31  // Add entry to resolution error table to record the error when the first
    1.32  // attempt to resolve a reference to a class has failed.
    1.33 -void SystemDictionary::add_resolution_error(constantPoolHandle pool, int which, Symbol* error) {
    1.34 +void SystemDictionary::add_resolution_error(constantPoolHandle pool, int which,
    1.35 +                                            Symbol* error, Symbol* message) {
    1.36    unsigned int hash = resolution_errors()->compute_hash(pool, which);
    1.37    int index = resolution_errors()->hash_to_index(hash);
    1.38    {
    1.39      MutexLocker ml(SystemDictionary_lock, Thread::current());
    1.40 -    resolution_errors()->add_entry(index, hash, pool, which, error);
    1.41 +    resolution_errors()->add_entry(index, hash, pool, which, error, message);
    1.42    }
    1.43  }
    1.44  
    1.45 @@ -2261,13 +2264,19 @@
    1.46  }
    1.47  
    1.48  // Lookup resolution error table. Returns error if found, otherwise NULL.
    1.49 -Symbol* SystemDictionary::find_resolution_error(constantPoolHandle pool, int which) {
    1.50 +Symbol* SystemDictionary::find_resolution_error(constantPoolHandle pool, int which,
    1.51 +                                                Symbol** message) {
    1.52    unsigned int hash = resolution_errors()->compute_hash(pool, which);
    1.53    int index = resolution_errors()->hash_to_index(hash);
    1.54    {
    1.55      MutexLocker ml(SystemDictionary_lock, Thread::current());
    1.56      ResolutionErrorEntry* entry = resolution_errors()->find_entry(index, hash, pool, which);
    1.57 -    return (entry != NULL) ? entry->error() : (Symbol*)NULL;
    1.58 +    if (entry != NULL) {
    1.59 +      *message = entry->message();
    1.60 +      return entry->error();
    1.61 +    } else {
    1.62 +      return NULL;
    1.63 +    }
    1.64    }
    1.65  }
    1.66  

mercurial