enjoy 3.6
This commit is contained in:
parent
6d7d0af2b2
commit
972c7e7673
2
pom.xml
2
pom.xml
@ -121,7 +121,7 @@
|
|||||||
</execution>
|
</execution>
|
||||||
</executions>
|
</executions>
|
||||||
<configuration>
|
<configuration>
|
||||||
<skip>false</skip>
|
<skip>true</skip>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
|
|
||||||
|
@ -48,7 +48,8 @@ public class MethodKit {
|
|||||||
Class<?>[] cs = {
|
Class<?>[] cs = {
|
||||||
System.class, Runtime.class, Thread.class, Class.class, ClassLoader.class, File.class,
|
System.class, Runtime.class, Thread.class, Class.class, ClassLoader.class, File.class,
|
||||||
Compiler.class, InheritableThreadLocal.class, Package.class, Process.class,
|
Compiler.class, InheritableThreadLocal.class, Package.class, Process.class,
|
||||||
RuntimePermission.class, SecurityManager.class, ThreadGroup.class, ThreadLocal.class
|
RuntimePermission.class, SecurityManager.class, ThreadGroup.class, ThreadLocal.class,
|
||||||
|
java.lang.reflect.Method.class
|
||||||
};
|
};
|
||||||
for (Class<?> c : cs) {
|
for (Class<?> c : cs) {
|
||||||
forbiddenClasses.add(c);
|
forbiddenClasses.add(c);
|
||||||
@ -59,7 +60,7 @@ public class MethodKit {
|
|||||||
static {
|
static {
|
||||||
String[] ms = {
|
String[] ms = {
|
||||||
"getClass", "getDeclaringClass", "forName", "newInstance", "getClassLoader",
|
"getClass", "getDeclaringClass", "forName", "newInstance", "getClassLoader",
|
||||||
"getMethod", "getMethods", "getField", "getFields",
|
"invoke", // "getMethod", "getMethods", // "getField", "getFields",
|
||||||
"notify", "notifyAll", "wait",
|
"notify", "notifyAll", "wait",
|
||||||
"load", "exit", "loadLibrary", "halt",
|
"load", "exit", "loadLibrary", "halt",
|
||||||
"stop", "suspend", "resume", "setDaemon", "setPriority",
|
"stop", "suspend", "resume", "setDaemon", "setPriority",
|
||||||
@ -98,6 +99,10 @@ public class MethodKit {
|
|||||||
forbiddenClasses.add(clazz);
|
forbiddenClasses.add(clazz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void removeForbiddenClass(Class<?> clazz) {
|
||||||
|
forbiddenClasses.remove(clazz);
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isForbiddenMethod(String methodName) {
|
public static boolean isForbiddenMethod(String methodName) {
|
||||||
return forbiddenMethods.contains(methodName);
|
return forbiddenMethods.contains(methodName);
|
||||||
}
|
}
|
||||||
@ -106,6 +111,10 @@ public class MethodKit {
|
|||||||
forbiddenMethods.add(methodName);
|
forbiddenMethods.add(methodName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void removeForbiddenMethod(String methodName) {
|
||||||
|
forbiddenMethods.remove(methodName);
|
||||||
|
}
|
||||||
|
|
||||||
public static MethodInfo getMethod(Class<?> targetClass, String methodName, Object[] argValues) {
|
public static MethodInfo getMethod(Class<?> targetClass, String methodName, Object[] argValues) {
|
||||||
Class<?>[] argTypes = getArgTypes(argValues);
|
Class<?>[] argTypes = getArgTypes(argValues);
|
||||||
Long key = getMethodKey(targetClass, methodName, argTypes);
|
Long key = getMethodKey(targetClass, methodName, argTypes);
|
||||||
|
Loading…
Reference in New Issue
Block a user