ReadyTalk / avian

[INACTIVE] Avian is a lightweight virtual machine and class library designed to provide a useful subset of Java's features, suitable for building self-contained applications.
https://readytalk.github.io/avian/
Other
1.22k stars 173 forks source link

fix crash when calling Class.getDeclaredMethods using the OpenJDK class ... #403

Closed dicej closed 9 years ago

dicej commented 9 years ago

...library

This method ends up defering to JVM_GetClassDeclaredMethods, which creates an array of java.lang.reflect.Method instances and then calls getName on each one through the java.lang.reflect.Member interface. However, Method is a "bootstrap" class, meaning the VM has built-in knowledge of it and includes a tentative version built-in but must load the real version from the classpath at runtime before invoking methods on it. Normally this happens naturally when Method instances are created in Java code, but here we're creating them in the VM instead, which doesn't automatically cause the real class to be loaded. So we must do so explicitly.

Fixes #398