equal
deleted
inserted
replaced
1948 } |
1948 } |
1949 // Check if the specified method or field is protected |
1949 // Check if the specified method or field is protected |
1950 InstanceKlass* target_instance = InstanceKlass::cast(target_class); |
1950 InstanceKlass* target_instance = InstanceKlass::cast(target_class); |
1951 fieldDescriptor fd; |
1951 fieldDescriptor fd; |
1952 if (is_method) { |
1952 if (is_method) { |
1953 Method* m = target_instance->uncached_lookup_method(field_name, field_sig, Klass::normal); |
1953 Method* m = target_instance->uncached_lookup_method(field_name, field_sig, Klass::find_overpass); |
1954 if (m != NULL && m->is_protected()) { |
1954 if (m != NULL && m->is_protected()) { |
1955 if (!this_class->is_same_class_package(m->method_holder())) { |
1955 if (!this_class->is_same_class_package(m->method_holder())) { |
1956 return true; |
1956 return true; |
1957 } |
1957 } |
1958 } |
1958 } |
2485 if (name_in_supers(ref_class_type.name(), current_class())) { |
2485 if (name_in_supers(ref_class_type.name(), current_class())) { |
2486 Klass* ref_klass = load_class(ref_class_type.name(), CHECK); |
2486 Klass* ref_klass = load_class(ref_class_type.name(), CHECK); |
2487 Method* m = InstanceKlass::cast(ref_klass)->uncached_lookup_method( |
2487 Method* m = InstanceKlass::cast(ref_klass)->uncached_lookup_method( |
2488 vmSymbols::object_initializer_name(), |
2488 vmSymbols::object_initializer_name(), |
2489 cp->signature_ref_at(bcs->get_index_u2()), |
2489 cp->signature_ref_at(bcs->get_index_u2()), |
2490 Klass::normal); |
2490 Klass::find_overpass); |
2491 // Do nothing if method is not found. Let resolution detect the error. |
2491 // Do nothing if method is not found. Let resolution detect the error. |
2492 if (m != NULL) { |
2492 if (m != NULL) { |
2493 instanceKlassHandle mh(THREAD, m->method_holder()); |
2493 instanceKlassHandle mh(THREAD, m->method_holder()); |
2494 if (m->is_protected() && !mh->is_same_class_package(_klass())) { |
2494 if (m->is_protected() && !mh->is_same_class_package(_klass())) { |
2495 bool assignable = current_type().is_assignable_from( |
2495 bool assignable = current_type().is_assignable_from( |