@@ -570,53 +570,7 @@ public Long deserialize(JsonParser p, DeserializationContext ctxt) throws IOExce
570
570
if (_primitive ) {
571
571
return _parseLongPrimitive (p , ctxt );
572
572
}
573
- return _parseLong (p , ctxt );
574
- }
575
-
576
- protected final Long _parseLong (JsonParser p , DeserializationContext ctxt )
577
- throws IOException
578
- {
579
- String text ;
580
- switch (p .currentTokenId ()) {
581
- case JsonTokenId .ID_STRING :
582
- text = p .getText ();
583
- break ;
584
- case JsonTokenId .ID_NUMBER_FLOAT :
585
- final CoercionAction act = _checkFloatToIntCoercion (p , ctxt , _valueClass );
586
- if (act == CoercionAction .AsNull ) {
587
- return (Long ) getNullValue (ctxt );
588
- }
589
- if (act == CoercionAction .AsEmpty ) {
590
- return (Long ) getEmptyValue (ctxt );
591
- }
592
- return p .getValueAsLong ();
593
- case JsonTokenId .ID_NULL : // null fine for non-primitive
594
- return (Long ) getNullValue (ctxt );
595
- case JsonTokenId .ID_NUMBER_INT :
596
- return p .getLongValue ();
597
- // 29-Jun-2020, tatu: New! "Scalar from Object" (mostly for XML)
598
- case JsonTokenId .ID_START_OBJECT :
599
- text = ctxt .extractScalarFromObject (p , this , _valueClass );
600
- break ;
601
- case JsonTokenId .ID_START_ARRAY :
602
- return (Long ) _deserializeFromArray (p , ctxt );
603
- default :
604
- return (Long ) ctxt .handleUnexpectedToken (getValueType (ctxt ), p );
605
- }
606
-
607
- final CoercionAction act = _checkFromStringCoercion (ctxt , text );
608
- if (act == CoercionAction .AsNull ) {
609
- return (Long ) getNullValue (ctxt );
610
- }
611
- if (act == CoercionAction .AsEmpty ) {
612
- return (Long ) getEmptyValue (ctxt );
613
- }
614
- text = text .trim ();
615
- if (_checkTextualNull (ctxt , text )) {
616
- return (Long ) getNullValue (ctxt );
617
- }
618
- // let's allow Strings to be converted too
619
- return _parseLongPrimitive (ctxt , text );
573
+ return _parseLong (p , ctxt , Long .class );
620
574
}
621
575
}
622
576
0 commit comments