diff --git a/src/hotspot/share/classfile/systemDictionary.cpp b/src/hotspot/share/classfile/systemDictionary.cpp index f482a5bb303..c1459e81f7b 100644 --- a/src/hotspot/share/classfile/systemDictionary.cpp +++ b/src/hotspot/share/classfile/systemDictionary.cpp @@ -1768,6 +1768,14 @@ void SystemDictionary::add_resolution_error(const constantPoolHandle& pool, int ResolutionErrorEntry* entry = ResolutionErrorTable::find_entry(pool, which); if (entry == nullptr) { ResolutionErrorTable::add_entry(pool, which, error, message, cause, cause_msg); + } else { + ResourceMark rm; + guarantee(entry->error() != nullptr, "null error for error %s message %s cause %s cause_msg %s nest_host_error %s", + error ? error->as_C_string() : "null", + message ? message : "null", + cause ? cause->as_C_string() : "null", + cause_msg ? cause_msg : "null", + entry->nest_host_error() != nullptr ? entry->nest_host_error() : "null"); } } } @@ -1789,8 +1797,11 @@ Symbol* SystemDictionary::find_resolution_error(const constantPoolHandle& pool, *message = entry->message(); *cause = entry->cause(); *cause_msg = entry->cause_msg(); + guarantee(entry->error() != nullptr, "null error for message %s cause_msg %s nest_host_error %s", entry->message() ? entry->message() : "null", + entry->cause_msg() ? entry->cause_msg() : "null", entry->nest_host_error() ? entry->nest_host_error() : "null"); return entry->error(); } else { + guarantee(false, "%s @ %d %s", pool->pool_holder()->external_name(), which, pool->printable_name_at(which)); return nullptr; } } diff --git a/src/hotspot/share/oops/constantPool.cpp b/src/hotspot/share/oops/constantPool.cpp index 3223c56628e..8dde4c4a92b 100644 --- a/src/hotspot/share/oops/constantPool.cpp +++ b/src/hotspot/share/oops/constantPool.cpp @@ -1976,8 +1976,6 @@ int ConstantPool::find_matching_operand(int pattern_i, } // end find_matching_operand() -#ifndef PRODUCT - const char* ConstantPool::printable_name_at(int cp_index) { constantTag tag = tag_at(cp_index); @@ -1992,9 +1990,6 @@ const char* ConstantPool::printable_name_at(int cp_index) { return ""; } -#endif // PRODUCT - - // Returns size of constant pool entry. jint ConstantPool::cpool_entry_size(jint idx) { switch(tag_at(idx).value()) { diff --git a/src/hotspot/share/oops/constantPool.hpp b/src/hotspot/share/oops/constantPool.hpp index be4a7a474d4..417bfa55961 100644 --- a/src/hotspot/share/oops/constantPool.hpp +++ b/src/hotspot/share/oops/constantPool.hpp @@ -794,7 +794,7 @@ class ConstantPool : public Metadata { int pre_resolve_shared_klasses(TRAPS); // Debugging - const char* printable_name_at(int cp_index) PRODUCT_RETURN_NULL; + const char* printable_name_at(int cp_index); private: