File tree 4 files changed +32
-0
lines changed
main/java/com/fasterxml/jackson/dataformat/ion
test/java/com/fasterxml/jackson/dataformat/ion
4 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -276,6 +276,8 @@ public NumberType getNumberType() throws IOException
276
276
} else {
277
277
return NumberType .INT ;
278
278
}
279
+ case FLOAT :
280
+ return NumberType .DOUBLE ;
279
281
default :
280
282
}
281
283
}
Original file line number Diff line number Diff line change 20
20
import com .fasterxml .jackson .dataformat .ion .IonParser ;
21
21
22
22
import org .junit .Assert ;
23
+
24
+ import software .amazon .ion .IonReader ;
23
25
import software .amazon .ion .IonSystem ;
24
26
import software .amazon .ion .IonValue ;
25
27
import software .amazon .ion .system .IonSystemBuilder ;
26
28
29
+ import java .io .IOException ;
27
30
import java .math .BigInteger ;
28
31
import org .junit .Test ;
29
32
@@ -55,4 +58,21 @@ public void testGetNumberType() throws Exception {
55
58
Assert .assertEquals (JsonToken .VALUE_NUMBER_FLOAT , floatParser .nextToken ());
56
59
Assert .assertEquals (JsonParser .NumberType .DOUBLE , floatParser .getNumberType ());
57
60
}
61
+
62
+ @ Test
63
+ public void testFloatType () throws IOException
64
+ {
65
+ final byte [] data = "{ score:0.291e0 }" .getBytes ();
66
+ IonSystem ion = IonSystemBuilder .standard ().build ();
67
+ final IonValue ionFloat = ion .newFloat (Float .MAX_VALUE );
68
+ IonReader reader = ionFloat .getSystem ().newReader (data , 0 , data .length );
69
+ // Find the object
70
+ reader .next ();
71
+ // Step into the object
72
+ reader .stepIn ();
73
+ // Step next.
74
+ reader .next ();
75
+ final IonParser floatParser = new IonFactory ().createParser (reader );
76
+ Assert .assertEquals (JsonParser .NumberType .DOUBLE , floatParser .getNumberType ());
77
+ }
58
78
}
Original file line number Diff line number Diff line change @@ -68,3 +68,8 @@ Leo Wang (wanglingsong@github)
68
68
69
69
* Reported #135: Infinite sequence of `END_OBJECT` tokens returned at end of streaming read
70
70
(2.9.6)
71
+
72
+ Michael Milkin (mmilkin@github)
73
+ * Reported, Contributed fix for #142: (ion) `IonParser.getNumberType()` returns `null`
74
+ for `IonType.FLOAT`
75
+ (2.9.7)
Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ Project: jackson-datatypes-binaryModules:
8
8
=== Releases ===
9
9
------------------------------------------------------------------------
10
10
11
+ 2.9.7 (not yet released)
12
+
13
+ #142: (ion) `IonParser.getNumberType()` returns `null` for `IonType.FLOAT`
14
+ (contributed by Michael M)
15
+
11
16
2.9.6 (12-Jun-2018)
12
17
13
18
#93: (cbor) `CBORParser` does not accept "undefined value"
You can’t perform that action at this time.
0 commit comments