OPENJPA-1895 add doPriv to setAccessible call.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1039246 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Albert Lee 2010-11-26 03:55:51 +00:00
parent ae3f3af9db
commit f4b14e18b7

View File

@ -19,12 +19,14 @@
package org.apache.openjpa.lib.jdbc;
import java.lang.reflect.Constructor;
import java.security.AccessController;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import org.apache.openjpa.lib.util.ConcreteClassGenerator;
import org.apache.openjpa.lib.util.J2DoPrivHelper;
/**
* Connection decorator that can configure some properties of the
@ -46,7 +48,7 @@ public class ConfiguringConnectionDecorator implements ConnectionDecorator {
try {
configuringConnectionImpl = ConcreteClassGenerator.getConcreteConstructor(ConfiguringConnection.class,
ConfiguringConnectionDecorator.class, Connection.class);
configuringConnectionImpl.setAccessible(true);
AccessController.doPrivileged(J2DoPrivHelper.setAccessibleAction(configuringConnectionImpl, true));
} catch (Exception e) {
throw new ExceptionInInitializerError(e);
}