--- old/src/share/classes/java/lang/reflect/Field.java 2011-03-21 15:50:25.000000000 -0700 +++ new/src/share/classes/java/lang/reflect/Field.java 2011-03-21 15:50:25.000000000 -0700 @@ -79,11 +79,6 @@ // potentially many Field objects pointing to it.) private Field root; - // More complicated security check cache needed here than for - // Class.newInstance() and Constructor.newInstance() - private Class securityCheckCache; - private Class securityCheckTargetClassCache; - // Generics infrastructure private String getGenericSignature() {return signature;} @@ -936,6 +931,7 @@ tmp = reflectionFactory.newFieldAccessor(this, overrideFinalCheck); setFieldAccessor(tmp, overrideFinalCheck); } + return tmp; } @@ -965,21 +961,8 @@ if (!override) { if (!Reflection.quickCheckMemberAccess(clazz, modifiers)) { Class caller = Reflection.getCallerClass(4); - Class targetClass = ((obj == null || !Modifier.isProtected(modifiers)) - ? clazz - : obj.getClass()); - - synchronized (this) { - if ((securityCheckCache == caller) - && (securityCheckTargetClassCache == targetClass)) { - return; - } - } - Reflection.ensureMemberAccess(caller, clazz, obj, modifiers); - synchronized (this) { - securityCheckCache = caller; - securityCheckTargetClassCache = targetClass; - } + + checkAccess(caller, clazz, obj, modifiers); } } }