-
Enhancement
-
Resolution: Won't Fix
-
P4
-
12
Currently, JVM code that is looking at the classes listed in the InnerClasses attrbute in order to find a specific class, compares the class names, then loads the class, and then compares the Klass*'s. Can this be simplified by removing the Klass* comparison ?
For example, in this code in InstanceKlass::find_inner_classes_attr(), if the klass names match, will 'this' ever not equal 'inner_klass' ?
int ioff = iter.inner_class_info_index();
if (ioff != 0) {
// Check to see if the name matches the class we're looking for
// before attempting to find the class.
if (i_cp->klass_name_at_matches(this, ioff)) {
Klass* inner_klass = i_cp->klass_at(ioff, CHECK_false);
if (this == inner_klass) {
Similar code is in Reflection::check_for_inner_class().
If the Klass* comparison can be removed then the calls to cp->klass_at() can also be removed.
For example, in this code in InstanceKlass::find_inner_classes_attr(), if the klass names match, will 'this' ever not equal 'inner_klass' ?
int ioff = iter.inner_class_info_index();
if (ioff != 0) {
// Check to see if the name matches the class we're looking for
// before attempting to find the class.
if (i_cp->klass_name_at_matches(this, ioff)) {
Klass* inner_klass = i_cp->klass_at(ioff, CHECK_false);
if (this == inner_klass) {
Similar code is in Reflection::check_for_inner_class().
If the Klass* comparison can be removed then the calls to cp->klass_at() can also be removed.
- relates to
-
JDK-8079784 Unexpected IllegalAccessError when trying access InnerClasses attribute
-
- Resolved
-