Yep, so far I’ve only manually added support for System.out.println() and String.replace(), as seen in the sample.
I was hoping I could trigger reflection just by adding lines like this to a whitelist source file:
String.class.getMethod(“replace”, String.class, String.class);
PrintStream.class.getMethod(“print”, Object.class);
PrintStream.class.getMethod(“println”, Object.class);
Math.class.getMethod(“min”, double.class, double.class);
Math.class.getMethod(“max”, double.class, double.class);
…
But this doesn’t seem to make things like Class getDeclaredMethods() and getMethod(name, params) work. I have actually been refactoring stuff like this out of my code for years, because I though it was leading TeaVM to include a bunch of bloat.
My JavaParser library actually has a shadow set of classes that allow me to do Reflection with and without built-in Java reflection, since it assumes that classes can get loaded and reloaded. So I can work around this. But since it seems like TeaVM has given Reflection significant work and thought, I thought I’d check to see if there is some built in way to get those Class methods to work.
jeff