You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.lang.NullPointerException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at kilim.Task.invoke(Task.java:278)
at kilim.examples.Reflect.execute(Reflect.java:16)
at kilim.Task._runExecute(Task.java:432)
at kilim.WorkerThread.run(WorkerThread.java:32)
packagekilim.examples;
importjava.lang.reflect.Method;
importkilim.Pausable;
importkilim.Task;
publicclassReflectextendsTask {
@Overridepublicvoidexecute() throwsPausable, Exception {
intn = test();
System.out.println("test (normal): " + n);
// Invoking test() via reflectionMethodmthd = Reflect.class.getDeclaredMethod("test", newClass[0]);
Objectret = Task.invoke(mthd, this, /* no args */(Object[]) null);
System.out.println("test (reflect): " + ret);
System.exit(0);
}
// non-static methodpublicinttest() throwsPausable {
intm = 10;
for (inti = 0; i < 2; i++) { // Force multiple yieldsTask.sleep(100);
m *= 2;
}
returnm; // must return 40 if all goes well.
}
publicstaticvoidmain(Stringargs[]) {
Reflectref = newReflect();
ref.start();
ref.joinb();
}
}
The text was updated successfully, but these errors were encountered:
stackTrace
java.lang.NullPointerException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at kilim.Task.invoke(Task.java:278)
at kilim.examples.Reflect.execute(Reflect.java:16)
at kilim.Task._runExecute(Task.java:432)
at kilim.WorkerThread.run(WorkerThread.java:32)
The text was updated successfully, but these errors were encountered: