mirror of
https://github.com/EsotericSoftware/reflectasm.git
synced 2025-03-30 06:00:27 +08:00
Fixed issue 10
This commit is contained in:
parent
45eff6c4f4
commit
03e957db94
@ -3,10 +3,9 @@ package com.esotericsoftware.reflectasm;
|
|||||||
|
|
||||||
import java.lang.reflect.Method;
|
import java.lang.reflect.Method;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
|
|
||||||
class AccessClassLoader extends ClassLoader {
|
class AccessClassLoader extends ClassLoader {
|
||||||
static private ArrayList<AccessClassLoader> accessClassLoaders = new ArrayList();
|
static private final ArrayList<AccessClassLoader> accessClassLoaders = new ArrayList();
|
||||||
|
|
||||||
static AccessClassLoader get (Class type) {
|
static AccessClassLoader get (Class type) {
|
||||||
ClassLoader parent = type.getClassLoader();
|
ClassLoader parent = type.getClassLoader();
|
||||||
@ -40,7 +39,7 @@ class AccessClassLoader extends ClassLoader {
|
|||||||
Method method = ClassLoader.class.getDeclaredMethod("defineClass", new Class[] {String.class, byte[].class, int.class,
|
Method method = ClassLoader.class.getDeclaredMethod("defineClass", new Class[] {String.class, byte[].class, int.class,
|
||||||
int.class});
|
int.class});
|
||||||
method.setAccessible(true);
|
method.setAccessible(true);
|
||||||
return (Class)method.invoke(getParent(), new Object[] {name, bytes, new Integer(0), new Integer(bytes.length)});
|
return (Class)method.invoke(getParent(), new Object[] {name, bytes, Integer.valueOf(0), Integer.valueOf(bytes.length)});
|
||||||
} catch (Exception ignored) {
|
} catch (Exception ignored) {
|
||||||
}
|
}
|
||||||
return defineClass(name, bytes, 0, bytes.length);
|
return defineClass(name, bytes, 0, bytes.length);
|
||||||
|
Loading…
Reference in New Issue
Block a user