2313 // Do nothing if method is not found. Let resolution detect the error. |
2313 // Do nothing if method is not found. Let resolution detect the error. |
2314 if (m != NULL) { |
2314 if (m != NULL) { |
2315 instanceKlassHandle mh(THREAD, m->method_holder()); |
2315 instanceKlassHandle mh(THREAD, m->method_holder()); |
2316 if (m->is_protected() && !mh->is_same_class_package(_klass())) { |
2316 if (m->is_protected() && !mh->is_same_class_package(_klass())) { |
2317 bool assignable = current_type().is_assignable_from( |
2317 bool assignable = current_type().is_assignable_from( |
2318 objectref_type, this, CHECK_VERIFY(this)); |
2318 objectref_type, this, true, CHECK_VERIFY(this)); |
2319 if (!assignable) { |
2319 if (!assignable) { |
2320 verify_error(ErrorContext::bad_type(bci, |
2320 verify_error(ErrorContext::bad_type(bci, |
2321 TypeOrigin::cp(new_class_index, objectref_type), |
2321 TypeOrigin::cp(new_class_index, objectref_type), |
2322 TypeOrigin::implicit(current_type())), |
2322 TypeOrigin::implicit(current_type())), |
2323 "Bad access to protected <init> method"); |
2323 "Bad access to protected <init> method"); |