src/share/vm/oops/instanceKlass.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File
bug_8027804.2 Cdiff src/share/vm/oops/instanceKlass.cpp
src/share/vm/oops/instanceKlass.cpp
Print this page
*** 1496,1512 ****
return start;
}
return -1;
}
! // lookup_method searches both the local methods array and all superclasses methods arrays
Method* InstanceKlass::uncached_lookup_method(Symbol* name, Symbol* signature) const {
Klass* klass = const_cast<InstanceKlass*>(this);
while (klass != NULL) {
Method* method = InstanceKlass::cast(klass)->find_method(name, signature);
! if (method != NULL) return method;
klass = InstanceKlass::cast(klass)->super();
}
return NULL;
}
// lookup a method in the default methods list then in all transitive interfaces
--- 1496,1517 ----
return start;
}
return -1;
}
! // uncached_lookup_method searches both the local class methods array and all
! // superclasses methods arrays, skipping any overpass methods in superclasses.
Method* InstanceKlass::uncached_lookup_method(Symbol* name, Symbol* signature) const {
Klass* klass = const_cast<InstanceKlass*>(this);
+ bool dont_ignore_overpasses = true; // For the class being searched, find its overpasses.
while (klass != NULL) {
Method* method = InstanceKlass::cast(klass)->find_method(name, signature);
! if ((method != NULL) && (dont_ignore_overpasses || !method->is_overpass())) {
! return method;
! }
klass = InstanceKlass::cast(klass)->super();
+ dont_ignore_overpasses = false; // Ignore overpass methods in all superclasses.
}
return NULL;
}
// lookup a method in the default methods list then in all transitive interfaces
*** 1517,1543 ****
if (default_methods() != NULL) {
m = find_method(default_methods(), name, signature);
}
// Look up interfaces
if (m == NULL) {
! m = lookup_method_in_all_interfaces(name, signature);
}
return m;
}
// lookup a method in all the interfaces that this class implements
// Do NOT return private or static methods, new in JDK8 which are not externally visible
// They should only be found in the initial InterfaceMethodRef
Method* InstanceKlass::lookup_method_in_all_interfaces(Symbol* name,
! Symbol* signature) const {
Array<Klass*>* all_ifs = transitive_interfaces();
int num_ifs = all_ifs->length();
InstanceKlass *ik = NULL;
for (int i = 0; i < num_ifs; i++) {
ik = InstanceKlass::cast(all_ifs->at(i));
Method* m = ik->lookup_method(name, signature);
! if (m != NULL && m->is_public() && !m->is_static()) {
return m;
}
}
return NULL;
}
--- 1522,1550 ----
if (default_methods() != NULL) {
m = find_method(default_methods(), name, signature);
}
// Look up interfaces
if (m == NULL) {
! m = lookup_method_in_all_interfaces(name, signature, false);
}
return m;
}
// lookup a method in all the interfaces that this class implements
// Do NOT return private or static methods, new in JDK8 which are not externally visible
// They should only be found in the initial InterfaceMethodRef
Method* InstanceKlass::lookup_method_in_all_interfaces(Symbol* name,
! Symbol* signature,
! bool skip_default_methods) const {
Array<Klass*>* all_ifs = transitive_interfaces();
int num_ifs = all_ifs->length();
InstanceKlass *ik = NULL;
for (int i = 0; i < num_ifs; i++) {
ik = InstanceKlass::cast(all_ifs->at(i));
Method* m = ik->lookup_method(name, signature);
! if (m != NULL && m->is_public() && !m->is_static() &&
! (!skip_default_methods || !m->is_default_method())) {
return m;
}
}
return NULL;
}
src/share/vm/oops/instanceKlass.cpp
Index
Unified diffs
Context diffs
Sdiffs
Wdiffs
Patch
New
Old
Previous File
Next File