-
Enhancement
-
Resolution: Fixed
-
P4
-
17
-
b13
https://github.com/openjdk/jdk/blob/044e2a2a499ff63dffae355b2254ec6bfcc3e01d/src/hotspot/share/classfile/klassFactory.cpp#L209
InstanceKlass* result = parser.create_instance_klass(old_stream != stream, *cl_inst_info, CHECK_NULL);
if (result == NULL) {
return NULL;
}
But parser.create_instance_klass() will never return NULL in a normal return.
We should get rid of the above "if" check. Then, we can remove unnecessary NULL checks by callers of create_from_stream. E.g., here in systemDictionary.cpp:
InstanceKlass* k = KlassFactory::create_from_stream(st,
class_name,
loader_data,
cl_info,
CHECK_NULL);
if ((cl_info.is_hidden() || is_unsafe_anon_class) && k != NULL) {
InstanceKlass* result = parser.create_instance_klass(old_stream != stream, *cl_inst_info, CHECK_NULL);
if (result == NULL) {
return NULL;
}
But parser.create_instance_klass() will never return NULL in a normal return.
We should get rid of the above "if" check. Then, we can remove unnecessary NULL checks by callers of create_from_stream. E.g., here in systemDictionary.cpp:
InstanceKlass* k = KlassFactory::create_from_stream(st,
class_name,
loader_data,
cl_info,
CHECK_NULL);
if ((cl_info.is_hidden() || is_unsafe_anon_class) && k != NULL) {
- relates to
-
JDK-8296007 crash in runtime/DefineClass/NullClassBytesTest.java
-
- Resolved
-