Closed ExE-Boss closed 7 years ago
@@ master #247 diff @@
==========================================
Files 394 393 -1
Lines 11150 11245 +95
Methods 0 0
Messages 0 0
Branches 1586 1661 +75
==========================================
- Hits 1581 1568 -13
- Misses 9483 9576 +93
- Partials 86 101 +15
Powered by Codecov. Last update 1de7378...303f11d
Ready to merge
⚠️️ Please, don’t squash the two commits, as they are there to show the reason as to why JSON Processing was chosen over GSON.
Original content
This PR contains two implementations of #244. One with JSON Processing and one with GSON.
From writing them, GSON has simpler serialization but can’t losslessly deserialize
int
s andlong
s (can only deserializedouble
s), while JSON Processing has simpler deserialization but can losslessly deserialize all primitive types. I’m putting them both here so that we can choose which one to include in NOVA. After we choose which one, it will be added toData
and the other one will be removed, then we can merge.Comparison
I’d say that JSON Processing is better for the NOVA use case, but I want a second opinion on this first. We could also use JSON Processing for deserialization and GSON for serialization
JSON Processing
BigDecimal
)int
s andlong
s apart fromdouble
sGSON
double
)int
s andlong
s apart fromdouble
sI’ve also fixed an issue with saving and loading booleans to NBT. If you previously tried to save both a
byte
and aboolean
, the last to save would overwrite the type of the rest, which would cause aClassCastException
on load.I’ve also fixed
DataConverter
attempting to callData.put("class", value)
, which would throw anAssertionError
, askey
inData.put(key, value)
can’t be"class"
.Closes #244, Probably fixes #179