8157490: JCK test vm/jni/DefineClass/dfcl001/dfcl00101m1/dfcl00101m1 crashes when run with -Xlog:classload=info
Null stream->source() no longer causes error with -Xlog:class+load Reviewed-by: lfoltan, coleenp
This commit is contained in:
parent
349599133d
commit
680e1a3a28
@ -5356,15 +5356,7 @@ void ClassFileParser::fill_instance_klass(InstanceKlass* ik, bool changed_by_loa
|
||||
if (!is_internal()) {
|
||||
if (log_is_enabled(Info, class, load)) {
|
||||
ResourceMark rm;
|
||||
const char* module_name = NULL;
|
||||
static const size_t modules_image_name_len = strlen(MODULES_IMAGE_NAME);
|
||||
size_t stream_len = strlen(_stream->source());
|
||||
// See if _stream->source() ends in "modules"
|
||||
if (module_entry->is_named() && modules_image_name_len < stream_len &&
|
||||
(strncmp(_stream->source() + stream_len - modules_image_name_len,
|
||||
MODULES_IMAGE_NAME, modules_image_name_len) == 0)) {
|
||||
module_name = module_entry->name()->as_C_string();
|
||||
}
|
||||
const char* module_name = (module_entry->name() == NULL) ? UNNAMED_MODULE : module_entry->name()->as_C_string();
|
||||
|
||||
if (log_is_enabled(Info, class, load)) {
|
||||
ik->print_loading_log(LogLevel::Info, _loader_data, module_name, _stream);
|
||||
|
@ -3004,7 +3004,11 @@ void InstanceKlass::print_loading_log(LogLevel::type type,
|
||||
if (cfs != NULL) {
|
||||
if (cfs->source() != NULL) {
|
||||
if (module_name != NULL) {
|
||||
log->print(" source: jrt:/%s", module_name);
|
||||
if (ClassLoader::is_jrt(cfs->source())) {
|
||||
log->print(" source: jrt:/%s", module_name);
|
||||
} else {
|
||||
log->print(" source: %s", cfs->source());
|
||||
}
|
||||
} else {
|
||||
log->print(" source: %s", cfs->source());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user