File tree 2 files changed +12
-10
lines changed
src/test/java/com/fasterxml/jackson/databind/deser/jdk
2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ Project: jackson-databind
15
15
#4575 : StdDelegatingSerializer does not consider a Converter that may
16
16
return null for a non-null input
17
17
(reported, fix contributed by Peter L)
18
+ #4577 : Cannot deserialize value of type `java.math.BigDecimal` from
19
+ String " 3." (not a valid representation)
20
+ (reported by @dmelisso)
18
21
19
22
2.17.1 (04 -May-2024 )
20
23
Original file line number Diff line number Diff line change @@ -106,24 +106,23 @@ public void testBigIntegerUnlimited() throws Exception
106
106
@ Test
107
107
public void testNumberStartingWithDot () throws Exception {
108
108
_testNumberWith (".555555555555555555555555555555" );
109
- }
110
-
111
- // [databind#4435]
112
- @ Test
113
- public void testNumberStartingWithMinusDot () throws Exception {
114
109
_testNumberWith ("-.555555555555555555555555555555" );
110
+ _testNumberWith ("+.555555555555555555555555555555" );
115
111
}
116
112
117
- // [databind#4435 ]
113
+ // [databind#4577 ]
118
114
@ Test
119
- public void testNumberStartingWithPlusDot () throws Exception {
120
- _testNumberWith ("+.555555555555555555555555555555" );
115
+ public void testNumberEndingWithDot () throws Exception {
116
+ _testNumberWith ("55." );
117
+ _testNumberWith ("-55." );
118
+ _testNumberWith ("+55." );
121
119
}
122
-
120
+
123
121
private void _testNumberWith (String num ) throws Exception
124
122
{
123
+ BigDecimal exp = new BigDecimal (num );
125
124
BigDecimalWrapper w = MAPPER .readValue ("{\" number\" :\" " + num + "\" }" , BigDecimalWrapper .class );
126
- assertEquals (new BigDecimal ( num ) , w .number );
125
+ assertEquals (exp , w .number );
127
126
}
128
127
129
128
private String generateJson (final String fieldName ) {
You can’t perform that action at this time.
0 commit comments