jMonkeyEngine / jMonkeyEngine/jmonkeyengine
List of problematic code on non-standard jvms
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 4.3k
- Forks
- 1.2k
- Avg merge
- 4d 7h
- Merged PRs (30d)
- 14
Description
I will use this issue to compile a list of code that requires workarounds when running the engine on non fully-compliant or non fully-reflective jvms.
Some of these instances are legacy reflect code that, with the newer paradigms and changing expectations, could be easily rewritten in non reflective java.
PS. If you know other instances of problematic code, feel free to comment with your findings.
Problematic Reflection: DesktopAssetManager.loadConfigFile()
Loads a predefined list of locators and loaders from a .cfg file.
This could be rewritten by:
- making
JmeSystemDelegate.newAssetManagernon-final, so platforms can register the very bare-minimum requirements (bitmap font loader for stats and resource locator). - creating a set of helpers classes that the developer can use to load additional stuff (eg.
CoreLoaders.load(assetManager)ExtraLoaders.load(assetManager)...)
Problematic Reflection: Method calling Tweens
Might be replaced by a global map of named Runnables
Serialization: readExternal/writeExternal
Quaternions, Vectors and Matrices classes have serialization methods
readExternal(ObjectInput in)
writeExternal(ObjectOutput out)
that use the internal jvm serialization.
Afaik they are not used in the engine, and they cause issues with teavm that does not support the java native serialization.
GltfLoader CustomContentManager
All the reflective instantiation of the extensions and extra loader here can be easily replaced with Suppliers.
Json
setParser could accept a parser object instead of a class
...
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the listed areas: DesktopAssetManager.loadConfigFile(), method-calling tweens, readExternal/writeExternal implementations, gltf CustomContentManager.java, and Json.setParser. The issue is a catalog of possible workarounds rather than one bounded change, so first confirm which reflection or serialization case to address and define a separate completion test for it.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- game-dev
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100