1
1
package com .opensymphony .xwork2 .conversion .impl ;
2
2
3
3
import com .opensymphony .xwork2 .XWorkException ;
4
- import com .opensymphony .xwork2 .validator .validators .DoubleRangeFieldValidator ;
5
4
import org .apache .logging .log4j .LogManager ;
6
5
import org .apache .logging .log4j .Logger ;
7
- import org .apache .logging .log4j .message .ParameterizedMessage ;
8
6
9
7
import java .lang .reflect .Member ;
10
8
import java .math .BigDecimal ;
11
9
import java .math .BigInteger ;
12
- import java .math .RoundingMode ;
13
10
import java .text .DecimalFormat ;
14
- import java .text .DecimalFormatSymbols ;
15
11
import java .text .NumberFormat ;
16
- import java .text .ParseException ;
17
12
import java .text .ParsePosition ;
18
- import java .util .Formatter ;
19
13
import java .util .Locale ;
20
14
import java .util .Map ;
21
15
@@ -40,7 +34,7 @@ public Object convertValue(Map<String, Object> context, Object target, Member me
40
34
return convertedValue ;
41
35
} else {
42
36
String stringValue = (String ) value ;
43
- if (!toType .isPrimitive () && ( stringValue == null || stringValue . length () == 0 )) {
37
+ if (!toType .isPrimitive () && stringValue . isEmpty ( )) {
44
38
return null ;
45
39
}
46
40
NumberFormat numFormat = NumberFormat .getInstance (getLocale (context ));
@@ -182,7 +176,7 @@ protected boolean isInRange(Number value, String stringValue, Class toType) {
182
176
return true ;
183
177
}
184
178
185
- return ((Comparable )bigValue ).compareTo (lowerBound ) >= 0 && ((Comparable )bigValue ).compareTo (upperBound ) <= 0 ;
179
+ return ((Comparable ) bigValue ).compareTo (lowerBound ) >= 0 && ((Comparable ) bigValue ).compareTo (upperBound ) <= 0 ;
186
180
}
187
181
188
182
private boolean isIntegerType (Class type ) {
0 commit comments