specify classloader when calling Class.forCanonicalName in Field and Method; tolerate null argument array in Method.invoke

This commit is contained in:
Joel Dice
2009-08-10 07:48:44 -06:00
parent 5c72746d2c
commit 58c3a37277
2 changed files with 15 additions and 4 deletions

View File

@ -53,7 +53,8 @@ public class Field<T> extends AccessibleObject {
}
public Class getType() {
return Class.forCanonicalName(new String(spec, 0, spec.length - 1, false));
return Class.forCanonicalName(class_.getClassLoader(),
new String(spec, 0, spec.length - 1, false));
}
public Object get(Object instance) throws IllegalAccessException {