mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8205491: adjust reflective access checks
Reviewed-by: alanb, mchung, igerasim, rhalade, ahgross
This commit is contained in:
parent
80abdde2c0
commit
b228ede451
1 changed files with 4 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved.
|
* Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved.
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||||
*
|
*
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
* This code is free software; you can redistribute it and/or modify it
|
||||||
|
@ -453,11 +453,11 @@ public class ReflectionFactory {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
// accessible if the parent is public and any constructor
|
// sanity check to ensure the parent is protected or public
|
||||||
// is protected or public
|
if ((superCl.getModifiers() & (Modifier.PROTECTED | Modifier.PUBLIC)) == 0) {
|
||||||
if ((superCl.getModifiers() & Modifier.PUBLIC) == 0) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
// accessible if any constructor is protected or public
|
||||||
for (Constructor<?> ctor : superCl.getDeclaredConstructors()) {
|
for (Constructor<?> ctor : superCl.getDeclaredConstructors()) {
|
||||||
if ((ctor.getModifiers() & (Modifier.PROTECTED | Modifier.PUBLIC)) != 0) {
|
if ((ctor.getModifiers() & (Modifier.PROTECTED | Modifier.PUBLIC)) != 0) {
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue