Author: nickarls
Date: 2010-05-03 02:01:38 -0400 (Mon, 03 May 2010)
New Revision: 6207
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/UnsafeInstantiator.java
Log:
use centralized reflection
Modified:
core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/UnsafeInstantiator.java
===================================================================
---
core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/UnsafeInstantiator.java 2010-05-01
15:04:10 UTC (rev 6206)
+++
core/trunk/impl/src/main/java/org/jboss/weld/util/reflection/instantiation/UnsafeInstantiator.java 2010-05-03
06:01:38 UTC (rev 6207)
@@ -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;
@@ -43,7 +44,7 @@
{
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);
}