Skip to content

Commit 45aae9c

Browse files
committed
Cleans up imports and simplifies if clause
1 parent 229afea commit 45aae9c

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

core/src/main/java/com/opensymphony/xwork2/conversion/impl/NumberConverter.java

+2-8
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
11
package com.opensymphony.xwork2.conversion.impl;
22

33
import com.opensymphony.xwork2.XWorkException;
4-
import com.opensymphony.xwork2.validator.validators.DoubleRangeFieldValidator;
54
import org.apache.logging.log4j.LogManager;
65
import org.apache.logging.log4j.Logger;
7-
import org.apache.logging.log4j.message.ParameterizedMessage;
86

97
import java.lang.reflect.Member;
108
import java.math.BigDecimal;
119
import java.math.BigInteger;
12-
import java.math.RoundingMode;
1310
import java.text.DecimalFormat;
14-
import java.text.DecimalFormatSymbols;
1511
import java.text.NumberFormat;
16-
import java.text.ParseException;
1712
import java.text.ParsePosition;
18-
import java.util.Formatter;
1913
import java.util.Locale;
2014
import java.util.Map;
2115

@@ -40,7 +34,7 @@ public Object convertValue(Map<String, Object> context, Object target, Member me
4034
return convertedValue;
4135
} else {
4236
String stringValue = (String) value;
43-
if (!toType.isPrimitive() && (stringValue == null || stringValue.length() == 0)) {
37+
if (!toType.isPrimitive() && stringValue.isEmpty()) {
4438
return null;
4539
}
4640
NumberFormat numFormat = NumberFormat.getInstance(getLocale(context));
@@ -182,7 +176,7 @@ protected boolean isInRange(Number value, String stringValue, Class toType) {
182176
return true;
183177
}
184178

185-
return ((Comparable)bigValue).compareTo(lowerBound) >= 0 && ((Comparable)bigValue).compareTo(upperBound) <= 0;
179+
return ((Comparable) bigValue).compareTo(lowerBound) >= 0 && ((Comparable) bigValue).compareTo(upperBound) <= 0;
186180
}
187181

188182
private boolean isIntegerType(Class type) {

0 commit comments

Comments
 (0)