You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by rm...@apache.org on 2011/08/16 10:59:19 UTC
svn commit: r1158159 - in /openejb/trunk/openejb3/container:
openejb-core/src/main/java/org/apache/openejb/util/
openejb-core/src/main/java/org/apache/openejb/util/proxy/
openejb-loader/src/main/java/org/apache/openejb/loader/
Author: rmannibucau
Date: Tue Aug 16 08:59:18 2011
New Revision: 1158159
URL: http://svn.apache.org/viewvc?rev=1158159&view=rev
Log:
OPENEJB-433 removing sun.misc.* dependencies using reflection - thanks kmalhi for his already done job
Modified:
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/PojoSerialization.java
openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyGeneratorImpl.java
openejb/trunk/openejb3/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
openejb/trunk/openejb3/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemClassPath.java
openejb/trunk/openejb3/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java
Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/PojoSerialization.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/PojoSerialization.java?rev=1158159&r1=1158158&r2=1158159&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/PojoSerialization.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/PojoSerialization.java Tue Aug 16 08:59:18 2011
@@ -21,7 +21,9 @@ import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.io.ObjectStreamException;
import java.io.Serializable;
+import java.lang.Class;
import java.lang.reflect.Field;
+import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.security.AccessController;
import java.security.PrivilegedAction;
@@ -35,13 +37,44 @@ public class PojoSerialization implement
private Object object;
- private static final sun.misc.Unsafe unsafe;
+ // sun.misc.Unsafe unsafe;
+ private static final Object unsafe;
+ private static final Method allocateInstance;
+ private static final Method objectFieldOffset;
+ private static final Method putInt;
+ private static final Method putLong;
+ private static final Method putShort;
+ private static final Method putChar;
+ private static final Method putByte;
+ private static final Method putFloat;
+ private static final Method putDouble;
+ private static final Method putBoolean;
+ private static final Method putObject;
static {
- unsafe = (sun.misc.Unsafe) AccessController.doPrivileged(new PrivilegedAction() {
+ final Class<?> unsafeClass;
+ try {
+ unsafeClass = AccessController.doPrivileged(new PrivilegedAction<Class<?>>() {
+ public Class<?> run() {
+ try {
+ return Thread.currentThread().getContextClassLoader().loadClass("sun.misc.Unsafe");
+ } catch (Exception e) {
+ try {
+ return ClassLoader.getSystemClassLoader().loadClass("sun.misc.Unsafe");
+ } catch (ClassNotFoundException e1) {
+ throw new IllegalStateException("Cannot get sun.misc.Unsafe", e);
+ }
+ }
+ }
+ });
+ } catch (Exception e) {
+ throw new IllegalStateException("Cannot get sun.misc.Unsafe class", e);
+ }
+
+ unsafe = AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
try {
- Field field = sun.misc.Unsafe.class.getDeclaredField("theUnsafe");
+ Field field = unsafeClass.getDeclaredField("theUnsafe");
field.setAccessible(true);
return field.get(null);
} catch (Exception e) {
@@ -49,6 +82,127 @@ public class PojoSerialization implement
}
}
});
+ allocateInstance = AccessController.doPrivileged(new PrivilegedAction<Method>() {
+ public Method run() {
+ try {
+ Method mtd = unsafeClass.getDeclaredMethod("allocateInstance", Class.class);
+ mtd.setAccessible(true);
+ return mtd;
+ } catch (Exception e) {
+ throw new IllegalStateException("Cannot get sun.misc.Unsafe.allocateInstance", e);
+ }
+ }
+ });
+ objectFieldOffset = AccessController.doPrivileged(new PrivilegedAction<Method>() {
+ public Method run() {
+ try {
+ Method mtd = unsafeClass.getDeclaredMethod("objectFieldOffset", Field.class);
+ mtd.setAccessible(true);
+ return mtd;
+ } catch (Exception e) {
+ throw new IllegalStateException("Cannot get sun.misc.Unsafe.objectFieldOffset", e);
+ }
+ }
+ });
+ putInt = AccessController.doPrivileged(new PrivilegedAction<Method>() {
+ public Method run() {
+ try {
+ Method mtd = unsafeClass.getDeclaredMethod("putInt", Object.class, long.class, int.class);
+ mtd.setAccessible(true);
+ return mtd;
+ } catch (Exception e) {
+ throw new IllegalStateException("Cannot get sun.misc.Unsafe.putInt", e);
+ }
+ }
+ });
+ putLong = AccessController.doPrivileged(new PrivilegedAction<Method>() {
+ public Method run() {
+ try {
+ Method mtd = unsafeClass.getDeclaredMethod("putLong", Object.class, long.class, long.class);
+ mtd.setAccessible(true);
+ return mtd;
+ } catch (Exception e) {
+ throw new IllegalStateException("Cannot get sun.misc.Unsafe.putLong", e);
+ }
+ }
+ });
+ putShort = AccessController.doPrivileged(new PrivilegedAction<Method>() {
+ public Method run() {
+ try {
+ Method mtd = unsafeClass.getDeclaredMethod("putShort", Object.class, long.class, short.class);
+ mtd.setAccessible(true);
+ return mtd;
+ } catch (Exception e) {
+ throw new IllegalStateException("Cannot get sun.misc.Unsafe.putShort", e);
+ }
+ }
+ });
+ putChar = AccessController.doPrivileged(new PrivilegedAction<Method>() {
+ public Method run() {
+ try {
+ Method mtd = unsafeClass.getDeclaredMethod("putChar", Object.class, long.class, char.class);
+ mtd.setAccessible(true);
+ return mtd;
+ } catch (Exception e) {
+ throw new IllegalStateException("Cannot get sun.misc.Unsafe.putChar", e);
+ }
+ }
+ });
+ putByte = AccessController.doPrivileged(new PrivilegedAction<Method>() {
+ public Method run() {
+ try {
+ Method mtd = unsafeClass.getDeclaredMethod("putByte", Object.class, long.class, byte.class);
+ mtd.setAccessible(true);
+ return mtd;
+ } catch (Exception e) {
+ throw new IllegalStateException("Cannot get sun.misc.Unsafe.putByte", e);
+ }
+ }
+ });
+ putFloat = AccessController.doPrivileged(new PrivilegedAction<Method>() {
+ public Method run() {
+ try {
+ Method mtd = unsafeClass.getDeclaredMethod("putFloat", Object.class, long.class, float.class);
+ mtd.setAccessible(true);
+ return mtd;
+ } catch (Exception e) {
+ throw new IllegalStateException("Cannot get sun.misc.Unsafe.putFloat", e);
+ }
+ }
+ });
+ putDouble = AccessController.doPrivileged(new PrivilegedAction<Method>() {
+ public Method run() {
+ try {
+ Method mtd = unsafeClass.getDeclaredMethod("putDouble", Object.class, long.class, double.class);
+ mtd.setAccessible(true);
+ return mtd;
+ } catch (Exception e) {
+ throw new IllegalStateException("Cannot get sun.misc.Unsafe.putDouble", e);
+ }
+ }
+ });
+ putBoolean = AccessController.doPrivileged(new PrivilegedAction<Method>() {
+ public Method run() {
+ try {
+ Method mtd = unsafeClass.getDeclaredMethod("putBoolean", Object.class, long.class, boolean.class);
+ mtd.setAccessible(true);
+ return mtd;
+ } catch (Exception e) {
+ throw new IllegalStateException("Cannot get sun.misc.Unsafe.putBoolean", e);
+ }
+ }
+ });
+ putObject = AccessController.doPrivileged(new PrivilegedAction<Method>() {
+ public Method run() {
+ try {
+ Method mtd = unsafeClass.getDeclaredMethod("putObject", Object.class, long.class, Object.class);
+ mtd.setAccessible(true);
+ return mtd;
+ } catch (Exception e) {
+ throw new IllegalStateException("Cannot get sun.misc.Unsafe.putObject", e);
+ }
+ }
+ });
}
/**
@@ -81,7 +235,7 @@ public class PojoSerialization implement
Object object;
try {
- object = unsafe.allocateInstance(clazz);
+ object = allocateInstance.invoke(unsafe, clazz);
} catch (Exception e) {
throw (IOException) new IOException("Cannot construct " + clazz.getName()).initCause(e);
}
@@ -96,7 +250,7 @@ public class PojoSerialization implement
try {
field = clazz.getDeclaredField(fieldName);
} catch (NoSuchFieldException e) {
- throw (IOException) new IOException("Cannot find field " + field.getName()).initCause(e);
+ throw (IOException) new IOException("Cannot find field " + fieldName).initCause(e);
}
setValue(field, object, value);
}
@@ -143,34 +297,38 @@ public class PojoSerialization implement
private void setValue(Field field, Object object, Object value) {
long offset;
try {
- offset = unsafe.objectFieldOffset(field);
+ offset = (Long) objectFieldOffset.invoke(unsafe, field);
} catch (Exception e) {
throw new IllegalStateException("Failed getting offset for: field=" + field.getName() + " class=" + field.getDeclaringClass().getName(), e);
}
Class type = field.getType();
- if (type.isPrimitive()) {
- if (type.equals(Integer.TYPE)) {
- unsafe.putInt(object, offset, ((Integer) value).intValue());
- } else if (type.equals(Long.TYPE)) {
- unsafe.putLong(object, offset, ((Long) value).longValue());
- } else if (type.equals(Short.TYPE)) {
- unsafe.putShort(object, offset, ((Short) value).shortValue());
- } else if (type.equals(Character.TYPE)) {
- unsafe.putChar(object, offset, ((Character) value).charValue());
- } else if (type.equals(Byte.TYPE)) {
- unsafe.putByte(object, offset, ((Byte) value).byteValue());
- } else if (type.equals(Float.TYPE)) {
- unsafe.putFloat(object, offset, ((Float) value).floatValue());
- } else if (type.equals(Double.TYPE)) {
- unsafe.putDouble(object, offset, ((Double) value).doubleValue());
- } else if (type.equals(Boolean.TYPE)) {
- unsafe.putBoolean(object, offset, ((Boolean) value).booleanValue());
+ try {
+ if (type.isPrimitive()) {
+ if (type.equals(Integer.TYPE)) {
+ putInt.invoke(unsafe, object, offset, ((Integer) value).intValue());
+ } else if (type.equals(Long.TYPE)) {
+ putLong.invoke(unsafe, object, offset, ((Long) value).longValue());
+ } else if (type.equals(Short.TYPE)) {
+ putShort.invoke(unsafe, object, offset, ((Short) value).shortValue());
+ } else if (type.equals(Character.TYPE)) {
+ putChar.invoke(unsafe, object, offset, ((Character) value).charValue());
+ } else if (type.equals(Byte.TYPE)) {
+ putByte.invoke(unsafe, object, offset, ((Byte) value).byteValue());
+ } else if (type.equals(Float.TYPE)) {
+ putFloat.invoke(unsafe, object, offset, ((Float) value).floatValue());
+ } else if (type.equals(Double.TYPE)) {
+ putDouble.invoke(unsafe, object, offset, ((Double) value).doubleValue());
+ } else if (type.equals(Boolean.TYPE)) {
+ putBoolean.invoke(unsafe, object, offset, ((Boolean) value).booleanValue());
+ } else {
+ throw new IllegalStateException("Unknown primitive type: " + type.getName());
+ }
} else {
- throw new IllegalStateException("Unknown primitive type: " + type.getName());
+ putObject.invoke(unsafe, object, offset, value);
}
- } else {
- unsafe.putObject(object, offset, value);
+ } catch (Exception e) {
+ e.printStackTrace();
}
}
Modified: openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyGeneratorImpl.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyGeneratorImpl.java?rev=1158159&r1=1158158&r2=1158159&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyGeneratorImpl.java (original)
+++ openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/util/proxy/LocalBeanProxyGeneratorImpl.java Tue Aug 16 08:59:18 2011
@@ -21,6 +21,7 @@ import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.security.AccessController;
import java.security.PrivilegedAction;
+import java.security.ProtectionDomain;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
@@ -38,14 +39,35 @@ public class LocalBeanProxyGeneratorImpl
static final String BUSSINESS_HANDLER_NAME = "businessHandler";
static final String NON_BUSINESS_HANDLER_NAME = "nonBusinessHandler";
-
- private static final sun.misc.Unsafe unsafe;
+
+ // sun.misc.Unsafe
+ private static final Object unsafe;
+ private static final Method defineClass;
static {
- unsafe = (sun.misc.Unsafe) AccessController.doPrivileged(new PrivilegedAction() {
+ final Class<?> unsafeClass;
+ try {
+ unsafeClass = AccessController.doPrivileged(new PrivilegedAction<Class<?>>() {
+ public Class<?> run() {
+ try {
+ return Thread.currentThread().getContextClassLoader().loadClass("sun.misc.Unsafe");
+ } catch (Exception e) {
+ try {
+ return ClassLoader.getSystemClassLoader().loadClass("sun.misc.Unsafe");
+ } catch (ClassNotFoundException e1) {
+ throw new IllegalStateException("Cannot get sun.misc.Unsafe", e);
+ }
+ }
+ }
+ });
+ } catch (Exception e) {
+ throw new IllegalStateException("Cannot get sun.misc.Unsafe class", e);
+ }
+
+ unsafe = AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
try {
- Field field = sun.misc.Unsafe.class.getDeclaredField("theUnsafe");
+ Field field = unsafeClass.getDeclaredField("theUnsafe");
field.setAccessible(true);
return field.get(null);
} catch (Exception e) {
@@ -53,6 +75,17 @@ public class LocalBeanProxyGeneratorImpl
}
}
});
+ defineClass = AccessController.doPrivileged(new PrivilegedAction<Method>() {
+ public Method run() {
+ try {
+ Method mtd = unsafeClass.getDeclaredMethod("defineClass", String.class, byte[].class, int.class, int.class, ClassLoader.class, ProtectionDomain.class);
+ mtd.setAccessible(true);
+ return mtd;
+ } catch (Exception e) {
+ throw new IllegalStateException("Cannot get sun.misc.Unsafe.defineClass", e);
+ }
+ }
+ });
}
public Class createProxy(Class<?> clsToProxy, ClassLoader cl) {
@@ -74,8 +107,8 @@ public class LocalBeanProxyGeneratorImpl
try {
byte[] proxyBytes = generateProxy(clsToProxy, clsName);
- return (Class<?>) unsafe.defineClass(proxyName, proxyBytes, 0, proxyBytes.length, clsToProxy.getClassLoader(), clsToProxy.getProtectionDomain());
- } catch (ProxyGenerationException e) {
+ return (Class<?>) defineClass.invoke(unsafe, proxyName, proxyBytes, 0, proxyBytes.length, clsToProxy.getClassLoader(), clsToProxy.getProtectionDomain());
+ } catch (Exception e) {
throw new InternalError(e.toString());
}
}
Modified: openejb/trunk/openejb3/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java?rev=1158159&r1=1158158&r2=1158159&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java (original)
+++ openejb/trunk/openejb3/container/openejb-loader/src/main/java/org/apache/openejb/loader/BasicURLClassPath.java Tue Aug 16 08:59:18 2011
@@ -17,6 +17,8 @@
package org.apache.openejb.loader;
import java.io.File;
+import java.lang.reflect.Field;
+import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
import java.security.AccessController;
@@ -24,8 +26,8 @@ import java.security.PrivilegedAction;
public abstract class BasicURLClassPath implements ClassPath {
public static ClassLoader getContextClassLoader() {
- return (ClassLoader) java.security.AccessController.doPrivileged(new java.security.PrivilegedAction() {
- public Object run() {
+ return java.security.AccessController.doPrivileged(new java.security.PrivilegedAction<ClassLoader>() {
+ public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}
});
@@ -34,7 +36,27 @@ public abstract class BasicURLClassPath
private java.lang.reflect.Field ucpField;
protected void addJarToPath(final URL jar, final URLClassLoader loader) throws Exception {
- this.getURLClassPath(loader).addURL(jar);
+ Object cp = getURLClassPath(loader);
+ Method addURLMethod = getAddURLMethod(loader);
+ addURLMethod.invoke(cp, new URL[] { jar });
+ }
+
+ private Method getAddURLMethod(final URLClassLoader loader) {
+ return AccessController.doPrivileged(new PrivilegedAction<Method>() {
+ public Method run() {
+ Object cp;
+ try {
+ cp = getURLClassPath(loader);
+ Class<?> clazz = cp.getClass();
+ return clazz.getDeclaredMethod("addURL", URL.class);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return null;
+ }
+
+ });
}
protected void addJarsToPath(final File dir, final URLClassLoader loader) throws Exception {
@@ -52,22 +74,21 @@ public abstract class BasicURLClassPath
jars[j] = new File(dir, jarNames[j]).toURI().toURL();
}
- sun.misc.URLClassPath path = getURLClassPath(loader);
- for (int i = 0; i < jars.length; i++) {
-
- path.addURL(jars[i]);
+ Object cp = getURLClassPath(loader);
+ Method addURLMethod = getAddURLMethod(loader);
+ for (URL jar : jars) {
+ addURLMethod.invoke(cp, new URL[] { jar });
}
}
- protected sun.misc.URLClassPath getURLClassPath(URLClassLoader loader) throws Exception {
- return (sun.misc.URLClassPath) getUcpField().get(loader);
+ protected Object getURLClassPath(URLClassLoader loader) throws Exception {
+ return getUcpField().get(loader);
}
private java.lang.reflect.Field getUcpField() throws Exception {
if (ucpField == null) {
-
- ucpField = (java.lang.reflect.Field) AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
+ ucpField = AccessController.doPrivileged(new PrivilegedAction<Field>() {
+ public Field run() {
java.lang.reflect.Field ucp = null;
try {
ucp = URLClassLoader.class.getDeclaredField("ucp");
Modified: openejb/trunk/openejb3/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemClassPath.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemClassPath.java?rev=1158159&r1=1158158&r2=1158159&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemClassPath.java (original)
+++ openejb/trunk/openejb3/container/openejb-loader/src/main/java/org/apache/openejb/loader/SystemClassPath.java Tue Aug 16 08:59:18 2011
@@ -16,10 +16,13 @@
*/
package org.apache.openejb.loader;
+import java.lang.reflect.Method;
import java.net.URLClassLoader;
import java.net.URL;
import java.net.URLDecoder;
import java.io.File;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
/*-------------------------------------------------------*/
/* System ClassLoader Support */
@@ -56,27 +59,47 @@ public class SystemClassPath extends Bas
}
private void rebuildJavaClassPathVariable() throws Exception {
- sun.misc.URLClassPath cp = getURLClassPath(getSystemLoader());
- URL[] urls = cp.getURLs();
+ URLClassLoader loader = getSystemLoader();
+ Object cp = getURLClassPath(loader);
+ Method getURLsMethod = getGetURLsMethod();
+ URL[] urls = (URL[]) getURLsMethod.invoke(cp);
if (urls.length < 1)
return;
- StringBuffer path = new StringBuffer(urls.length * 32);
+ StringBuilder path = new StringBuilder(urls.length * 32);
- File s = new File(URLDecoder.decode(urls[0].getFile()));
+ File s = new File(URLDecoder.decode(urls[0].getFile(), "UTF-8"));
path.append(s.getPath());
for (int i = 1; i < urls.length; i++) {
path.append(File.pathSeparator);
- s = new File(URLDecoder.decode(urls[i].getFile()));
+ s = new File(URLDecoder.decode(urls[i].getFile(), "UTF-8"));
path.append(s.getPath());
}
try {
System.setProperty("java.class.path", path.toString());
} catch (Exception e) {
+ // no-op
}
}
+
+ private Method getGetURLsMethod() {
+ return AccessController.doPrivileged(new PrivilegedAction<Method>() {
+ public Method run() {
+ try {
+ URLClassLoader loader = getSystemLoader();
+ Object cp = getURLClassPath(loader);
+ Class<?> clazz = cp.getClass();
+ return clazz.getDeclaredMethod("getURLs", URL.class);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ }
+
+ });
+ }
}
Modified: openejb/trunk/openejb3/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java
URL: http://svn.apache.org/viewvc/openejb/trunk/openejb3/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java?rev=1158159&r1=1158158&r2=1158159&view=diff
==============================================================================
--- openejb/trunk/openejb3/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java (original)
+++ openejb/trunk/openejb3/container/openejb-loader/src/main/java/org/apache/openejb/loader/TomcatClassPath.java Tue Aug 16 08:59:18 2011
@@ -151,10 +151,29 @@ public class TomcatClassPath extends Bas
}
}
+ private Method getGetURLsMethod() {
+
+ return AccessController.doPrivileged(new PrivilegedAction<Method>() {
+
+ public Method run() {
+ try {
+ Object cp = getURLClassPath((URLClassLoader) getClassLoader());
+ Class<?> clazz = cp.getClass();
+ return clazz.getDeclaredMethod("getURLs", URL.class);
+ } catch (Exception e) {
+ throw new RuntimeException(e);
+ }
+
+ }
+
+ });
+ }
+
protected void rebuild() {
try {
- sun.misc.URLClassPath cp = getURLClassPath((URLClassLoader) getCommonLoader());
- URL[] urls = cp.getURLs();
+ Object cp = getURLClassPath((URLClassLoader) getClassLoader());
+ Method getURLsMethod = getGetURLsMethod();
+ URL[] urls = (URL[])getURLsMethod.invoke(cp, null);
if (urls.length < 1)
return;
@@ -185,7 +204,6 @@ public class TomcatClassPath extends Bas
Class clazz = URLClassLoader.class;
method = clazz.getDeclaredMethod("addURL", URL.class);
method.setAccessible(true);
- return method;
} catch (Exception e2) {
e2.printStackTrace();
}