File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed 
ion/src/test/java/com/fasterxml/jackson/dataformat/ion Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 33import  org .hamcrest .Matchers ;
44import  org .junit .Test ;
55
6+ import  com .fasterxml .jackson .core .JsonParser ;
7+ import  com .fasterxml .jackson .core .JsonToken ;
68import  com .fasterxml .jackson .core .exc .InputCoercionException ;
79
810import  static  org .hamcrest .MatcherAssert .assertThat ;
@@ -72,4 +74,15 @@ private void _testLongCoercionFail(BigInteger input) throws Exception
7274        }
7375    }
7476
77+     // [dataformats-binary#569]: incorrect overflow fail for long values (from BigInteger) 
78+     @ Test 
79+     public  void  testLongAsBigIntegerSize () throws  Exception  {
80+         // Note: Values: Long.MAX_VALUE through Long.MAX_VALUE -7 are considered LONG by Ion.   
81+         BigInteger  bigIntLongValue  = new  BigInteger (Long .MAX_VALUE  + "" ).subtract (new  BigInteger ("10" ));
82+         IonParser  bigIntLongParser  = (IonParser ) new  IonFactory ().createParser (bigIntLongValue .toString ());
83+         assertEquals (JsonToken .VALUE_NUMBER_INT , bigIntLongParser .nextToken ());
84+         assertEquals (JsonParser .NumberType .BIG_INTEGER , bigIntLongParser .getNumberType ());
85+         assertEquals (JsonParser .NumberTypeFP .UNKNOWN , bigIntLongParser .getNumberTypeFP ());
86+         assertEquals (bigIntLongValue .longValue (), bigIntLongParser .getLongValue ());
87+     }    
7588}
Original file line number Diff line number Diff line change @@ -16,6 +16,9 @@ Active maintainers:
1616
17172.18 .4  (not  yet  released )
1818
19+ #569 : (ion ) `IonParser ` fails  to  parse  some  `long` values  saying 
20+   they  are  out  of  range  when  they  are  not 
21+  (reported , fix  suggested  by  @seadbrane )
1922-  (ion ) Upgrade  `ion - java ` to  1.11 .10  (from  1.11 .9 )
2023
21242.18 .3  (28 - Feb - 2025 )
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments