MCPcopy Create free account
hub / github.com/ReadyTalk/avian / invoke

Method invoke

classpath/java/lang/reflect/Method.java:70–99  ·  view source on GitHub ↗
(Object instance, Object ... arguments)

Source from the content-addressed store, hash-verified

68 }
69
70 public Object invoke(Object instance, Object ... arguments)
71 throws InvocationTargetException, IllegalAccessException
72 {
73 if ((vmMethod.flags & Modifier.STATIC) != 0
74 || Class.isInstance(vmMethod.class_, instance))
75 {
76 if ((vmMethod.flags & Modifier.STATIC) != 0) {
77 instance = null;
78 }
79
80 if (arguments == null) {
81 if (vmMethod.parameterCount > 0) {
82 throw new NullPointerException();
83 }
84 arguments = new Object[0];
85 }
86
87 if (arguments.length == vmMethod.parameterCount) {
88 Classes.initialize(vmMethod.class_);
89
90 return invoke(vmMethod, instance, arguments);
91 } else {
92 throw new ArrayIndexOutOfBoundsException();
93 }
94 } else {
95// System.out.println
96// (getDeclaringClass() + "." + getName() + " flags: " + vmMethod.flags + " vm flags: " + vmMethod.vmFlags + " return code: " + vmMethod.returnCode);
97 throw new IllegalArgumentException();
98 }
99 }
100
101 private static native Object invoke(VMMethod method, Object instance,
102 Object ... arguments)

Callers 4

mainMethod · 0.95
valueOfMethod · 0.95
writeObjectMethod · 0.95
readObjectMethod · 0.95

Calls 2

isInstanceMethod · 0.95
initializeMethod · 0.95

Tested by 1

mainMethod · 0.76