Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix bug where non-accessible field is briefly published, causing hide…

…ous random exceptions
  • Loading branch information...
commit 4dce7ffbff4475b852ad935f9a3a3daf35ecffcb 1 parent a4fb0d5
@dmlloyd dmlloyd authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/main/java/org/jboss/invocation/proxy/ProxyFactory.java
View
5 src/main/java/org/jboss/invocation/proxy/ProxyFactory.java
@@ -373,8 +373,9 @@ private Field getInvocationHandlerField() {
synchronized (this) {
if (invocationHandlerField == null) {
try {
- invocationHandlerField = defineClass().getDeclaredField(INVOCATION_HANDLER_FIELD);
- AccessController.doPrivileged(new SetAccessiblePrivilege(invocationHandlerField));
+ final Field field = defineClass().getDeclaredField(INVOCATION_HANDLER_FIELD);
+ AccessController.doPrivileged(new SetAccessiblePrivilege(field));
+ invocationHandlerField = field;
} catch (NoSuchFieldException e) {
throw new RuntimeException("Could not find invocation handler on generated proxy", e);
}
Please sign in to comment.
Something went wrong with that request. Please try again.