-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bug #2277 - GltfLoader #2309
Conversation
Thank you @JNightRider for investigating the issue and proposing a fix. |
jme3-plugins-json/src/main/java/com/jme3/plugins/json/JsonElement.java
Outdated
Show resolved
Hide resolved
jme3-plugins-json-gson/src/main/java/com/jme3/plugins/gson/GsonElement.java
Outdated
Show resolved
Hide resolved
jme3-plugins-json-gson/src/main/java/com/jme3/plugins/gson/GsonElement.java
Outdated
Show resolved
Hide resolved
@@ -11,6 +11,8 @@ sourceSets { | |||
|
|||
dependencies { | |||
api project(':jme3-core') | |||
api 'com.google.code.gson:gson:2.9.1' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why all of these import and library changes were necessary.
Edit: or rather, I don't understand how Ric's changes were working at all before without this.... and if it was working, I don't know why suddenly it needs to change just to fix how .equals()/.hashCode() is working. I'm very confused.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pspeed42 I disabled most of Riccardo's changes to work around the bug.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or rather, I don't understand how Ric's changes were working at all before without this.... and if it was working
These changes were removed as a temporary fix; Currently modules jme3-plugins-json
and jme3-plugins-json-gson
are not used.
I don't know why suddenly it needs to change just to fix how .equals()/.hashCode() is working.
@riccardobl's changes are no longer present in the loader (for the moment), it wouldn't make sense to fix something that isn't being used, which is why library imports (reconnect) are important.
With this 'commit', the changes have already been applied. |
Thanks for the comments and review. |
Yeah, I think so. Mostly I was confused. :) |
This PR fixes bug #2277 (GltfLoader issues).
This error originates when comparing 2 objects, the return is always false (result).
jme3-plugins-json-gson
always returns a new object of typecom.jme3.plugins.json.JsonElement*
(when accessing JSON elements), each new object confuses the gltf loader when compared using theequals(java.lang.Object)
method.A clear example where this error occurs is on line 1054 when searching for a JSON object within a list using the
indexOf()
method (class - GltfLoader).Using the code created by @stephengold, now numComposers is 1