mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8036533
: Method for correct defaults
8036156: Limit default method hierarchy Fix protected access checks Reviewed-by: coleenp, lfoltan, acorn, ahgross
This commit is contained in:
parent
7bd17413f2
commit
f203dcbfbf
6 changed files with 36 additions and 27 deletions
|
@ -507,7 +507,8 @@ bool Reflection::verify_field_access(Klass* current_class,
|
|||
if (access.is_protected()) {
|
||||
if (!protected_restriction) {
|
||||
// See if current_class (or outermost host class) is a subclass of field_class
|
||||
if (host_class->is_subclass_of(field_class)) {
|
||||
// An interface may not access protected members of j.l.Object
|
||||
if (!host_class->is_interface() && host_class->is_subclass_of(field_class)) {
|
||||
if (access.is_static() || // static fields are ok, see 6622385
|
||||
current_class == resolved_class ||
|
||||
field_class == resolved_class ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue