File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -111,13 +111,13 @@ public Object decode(JsonIterator iter) throws IOException {
111111 put (char .class , new Decoder () {
112112 @ Override
113113 public Object decode (JsonIterator iter ) throws IOException {
114- return iter .readInt ();
114+ return ( char ) iter .readInt ();
115115 }
116116 });
117117 put (Character .class , new Decoder () {
118118 @ Override
119119 public Object decode (JsonIterator iter ) throws IOException {
120- return iter .readInt ();
120+ return ( char ) iter .readInt ();
121121 }
122122 });
123123 put (long .class , new Decoder () {
Original file line number Diff line number Diff line change @@ -11,6 +11,11 @@ public class TestInteger extends TestCase {
1111
1212 private boolean isStreaming ;
1313
14+ public void test_char () throws IOException {
15+ Character c = JsonIterator .deserialize ("50" , Character .class );
16+ assertEquals (50 , (int )c );
17+ }
18+
1419 public void test_positive_negative_int () throws IOException {
1520 assertEquals (4321 , parseInt ("4321" ));
1621 assertEquals (54321 , parseInt ("54321" ));
You can’t perform that action at this time.
0 commit comments