File tree Expand file tree Collapse file tree 2 files changed +7
-5
lines changed
junit-jupiter-params/src/main/java/org/junit/jupiter/params/converter Expand file tree Collapse file tree 2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 1313import static java .util .Collections .unmodifiableMap ;
1414
1515import java .io .File ;
16- import java .math .BigDecimal ;
17- import java .math .BigInteger ;
1816import java .net .MalformedURLException ;
1917import java .net .URI ;
2018import java .net .URL ;
@@ -42,9 +40,6 @@ class StringToCommonJavaTypesConverter implements StringToObjectConverter {
4240 // java.net
4341 converters .put (URI .class , URI ::create );
4442 converters .put (URL .class , StringToCommonJavaTypesConverter ::toURL );
45- // java.math
46- converters .put (BigDecimal .class , BigDecimal ::new );
47- converters .put (BigInteger .class , BigInteger ::new );
4843 // java.util
4944 converters .put (Currency .class , Currency ::getInstance );
5045 converters .put (Locale .class , Locale ::new );
Original file line number Diff line number Diff line change 1212
1313import static java .util .Collections .unmodifiableMap ;
1414
15+ import java .math .BigDecimal ;
16+ import java .math .BigInteger ;
1517import java .util .HashMap ;
1618import java .util .Map ;
1719import java .util .function .Function ;
@@ -27,6 +29,11 @@ class StringToNumberConverter implements StringToObjectConverter {
2729 converters .put (Long .class , Long ::decode );
2830 converters .put (Float .class , Float ::valueOf );
2931 converters .put (Double .class , Double ::valueOf );
32+ // Technically, BigInteger and BigDecimal constructors are covered by
33+ // FallbackStringToObjectConverter, but we have explicit conversion
34+ // configured for them anyway.
35+ converters .put (BigInteger .class , BigInteger ::new );
36+ converters .put (BigDecimal .class , BigDecimal ::new );
3037 CONVERTERS = unmodifiableMap (converters );
3138 }
3239
You can’t perform that action at this time.
0 commit comments