-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Description
I was playing around with @copilot and it says it found this issue: #2607 (comment)
Reporting here for tracking, but i haven't validated it yet.
When a Spatial has multiple UserData entries containing lists (e.g., "int-list", "string-list", "float-list"), the BinaryExporter/BinaryImporter fails to deserialize correctly. The first list in the userData HashMap deserializes successfully, but subsequent lists return null and cause an ArrayIndexOutOfBoundsException during deserialization.
Steps to reproduce:
- Set
testLists=trueinjme3-plugins/src/test/java/com/jme3/export/JmeExporterTest.java(line 142) - Run
./gradlew :jme3-plugins:test --tests "com.jme3.export.JmeExporterTest" - Observe that BinaryImporter (Node 1) returns null for int-list and string-list, while float-list works (being first in iteration order)
Error:
java.lang.ArrayIndexOutOfBoundsException: Index -3 out of bounds for length 4
at com.jme3.export.binary.ByteUtils.rightAlignBytes(ByteUtils.java:554)
at com.jme3.export.binary.BinaryInputCapsule.readInt(BinaryInputCapsule.java:834)
at com.jme3.export.binary.BinaryInputCapsule.setContent(BinaryInputCapsule.java:154)
Notes:
- XMLExporter/XMLImporter works correctly with all lists
- Only affects BinaryExporter when multiple UserData objects with lists exist
- Appears to be a byte stream alignment issue in the binary format
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status