1
0
Fork 0
mirror of https://github.com/ethauvin/JSON-java.git synced 2025-06-17 07:50:52 -07:00

tests should succeed

This commit is contained in:
stleary 2015-05-28 20:43:47 -05:00
parent e9ea5ca98f
commit 32ea7e0ba3

View file

@ -765,7 +765,7 @@ public class JSONObjectTest {
// 3. A float+float operation will be performed and results into a float primitive.
// 4. There is no method that matches the signature put( String key, float value), java-compiler will choose the method
// put( String key, double value) and does an implicit type-cast(!) by appending zero-bits to the mantissa
assertTrue( "JSONObject increment unexpected behavior, Float will not stay Float!", jo.get( "bug" ) instanceof Float );
assertTrue( "JSONObject increment converts Float to Double", jo.get( "bug" ) instanceof Double );
// correct implementation (with change of behavior) would be:
// this.put(key, new Float((Float) value + 1));
// Probably it would be better to deprecate the method and remove some day, while convenient processing the "payload" is not