8196830: publicLookup().findVirtual should not return method handle to AccessibleObject.setAccessible

Reviewed-by: mchung, psandoz
This commit is contained in:
Alan Bateman 2018-02-24 08:26:53 +00:00
parent ced92116db
commit 8f56ea639d
3 changed files with 384 additions and 7 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -643,10 +643,7 @@ class MethodHandleNatives {
static boolean canBeCalledVirtual(MemberName mem) {
assert(mem.isInvocable());
Class<?> defc = mem.getDeclaringClass();
switch (mem.getName()) {
case "checkMemberAccess":
return canBeCalledVirtual(mem, java.lang.SecurityManager.class);
case "getContextClassLoader":
return canBeCalledVirtual(mem, java.lang.Thread.class);
}