mirror of
https://github.com/EsotericSoftware/reflectasm.git
synced 2025-03-29 13:30:46 +08:00
Merge pull request #65 from crykn/master
Allow the Object class to be used with MethodAccess#get(Class)
This commit is contained in:
commit
065b17b26d
@ -79,11 +79,11 @@ public abstract class MethodAccess {
|
||||
}
|
||||
|
||||
/** Creates a new MethodAccess for the specified type.
|
||||
* @param type Must not be the Object class, a primitive type, or void. */
|
||||
* @param type Must not be a primitive type, or void. */
|
||||
static public MethodAccess get (Class type) {
|
||||
boolean isInterface = type.isInterface();
|
||||
if (!isInterface && type.getSuperclass() == null)
|
||||
throw new IllegalArgumentException("The type must not be the Object class, an interface, a primitive type, or void.");
|
||||
if (!isInterface && type.getSuperclass() == null && type != Object.class)
|
||||
throw new IllegalArgumentException("The type must not be an interface, a primitive type, or void.");
|
||||
|
||||
ArrayList<Method> methods = new ArrayList<Method>();
|
||||
if (!isInterface) {
|
||||
|
Loading…
Reference in New Issue
Block a user