teavm
teavm copied to clipboard
loadClass signatures missing from ClassLoader
The following signatures are missing from ClassLoader implementation:
public Class> loadClass(String name); public Class> loadClass(String name, boolean result);
I believe, they should not be supported at all.
The reason I added them, is that a library was making use of this (probably to load some optional extension), and this breaks the code I've been trying to run at compile time, while at runtime there are not issues. Having the two functions that return null would help in that case supporting more libraries. Now I understand that you might want to keep the classlib only for actually implemented code.
Now I understand that you might want to keep the classlib only for actually implemented code.
Sure. Because for someone it's would not be that "while at runtime there are not issues". In general, it would be strange that TeaVM claims support of certain function and does not produce error when developer uses them, but then behave improperly at run time. So, since it's an issue on your side, you can:
- Write a plugin
- Use platform marker annotations
- If it's entire missing class, you can put it into your project using same naming scheme, TeaVM will pick it
I think ClassLoader.loadClass
can be implemented just like Class.forName
is implemented. Also, optimization for loadClass("constantString")
can be added just like there's one for Class.forName
.