Skip to content

Commit

Permalink
Merge pull request #2964 from pdbain-ibm/methodhandle
Browse files Browse the repository at this point in the history
Fix access checking with protected classes
  • Loading branch information
DanHeidinga authored Sep 26, 2018
2 parents 7f47e8e + 3ceedf0 commit 5918455
Showing 1 changed file with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -527,16 +527,7 @@ private void checkClassAccess(Class<?> targetClass) throws IllegalAccessExceptio
* the protected flag of this class doesn't exist on the VM level (there is no
* access flag in the binary form representing 'protected')
*/
if (Modifier.isProtected(modifiers)) {
/* Interfaces are not classes but types, and should therefore not have access to
* protected methods in java.lang.Object as subclasses.
*/
if (!accessClass.isInterface()) {
return;
}

/* The following access checking is for a normal class (non-member class) */
} else if (Modifier.isPublic(modifiers)) {
if (Modifier.isPublic(modifiers) || Modifier.isProtected(modifiers)) {
/* Already determined that we have more than "no access" (public access) */
return;
} else {
Expand Down

0 comments on commit 5918455

Please sign in to comment.