Skip to content

Commit

Permalink
use centralized reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
nickarls committed May 3, 2010
1 parent 076225c commit 2004320
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -20,6 +20,7 @@
import java.lang.reflect.Method;

import org.jboss.weld.exceptions.WeldException;
import org.jboss.weld.util.reflection.SecureReflections;

import static org.jboss.weld.logging.messages.ReflectionMessage.UNSAFE_INSTANTIATION_FAILED;

Expand All @@ -43,7 +44,7 @@ public UnsafeInstantiator()
{
Class<?> unsafe = Class.forName(REFLECTION_CLASS_NAME);
Field accessor = unsafe.getDeclaredField("theUnsafe");
accessor.setAccessible(true);
SecureReflections.ensureAccessible(accessor);
unsafeInstance = accessor.get(null);
allocateInstanceMethod = unsafe.getDeclaredMethod("allocateInstance", Class.class);
}
Expand Down

0 comments on commit 2004320

Please sign in to comment.