Fix more easy deprecation warnings: String constructors of boxed types.
This commit is contained in:
@@ -40,27 +40,27 @@ public class AsStringFieldEditor extends FieldEditor
|
||||
String text = _value.getText();
|
||||
if (_field.getType().equals(Integer.class) ||
|
||||
_field.getType().equals(Integer.TYPE)) {
|
||||
return new Integer(text);
|
||||
return Integer.valueOf(text);
|
||||
|
||||
} else if (_field.getType().equals(Short.class) ||
|
||||
_field.getType().equals(Short.TYPE)) {
|
||||
return new Short(text);
|
||||
return Short.valueOf(text);
|
||||
|
||||
} else if (_field.getType().equals(Byte.class) ||
|
||||
_field.getType().equals(Byte.TYPE)) {
|
||||
return new Byte(text);
|
||||
return Byte.valueOf(text);
|
||||
|
||||
} else if (_field.getType().equals(Long.class) ||
|
||||
_field.getType().equals(Long.TYPE)) {
|
||||
return new Long(text);
|
||||
return Long.valueOf(text);
|
||||
|
||||
} else if (_field.getType().equals(Float.class) ||
|
||||
_field.getType().equals(Float.TYPE)) {
|
||||
return new Float(text);
|
||||
return Float.valueOf(text);
|
||||
|
||||
} else if (_field.getType().equals(Double.class) ||
|
||||
_field.getType().equals(Double.TYPE)) {
|
||||
return new Double(text);
|
||||
return Double.valueOf(text);
|
||||
|
||||
} else if (_field.getType().equals(String.class)) {
|
||||
return text;
|
||||
@@ -78,7 +78,7 @@ public class AsStringFieldEditor extends FieldEditor
|
||||
return StringUtil.parseLongArray(_value.getText());
|
||||
|
||||
} else if (_field.getType().equals(Boolean.TYPE)) {
|
||||
return new Boolean(_value.getText().equalsIgnoreCase("true"));
|
||||
return Boolean.valueOf(_value.getText());
|
||||
|
||||
} else {
|
||||
log.warning("Unknown field type '" + _field.getName() + "': " +
|
||||
|
||||
@@ -44,24 +44,16 @@ public class ConfigField
|
||||
public Object toValue (String text)
|
||||
{
|
||||
switch(this) {
|
||||
case INTEGER:
|
||||
return new Integer(text);
|
||||
case SHORT:
|
||||
return new Short(text);
|
||||
case BYTE:
|
||||
return new Byte(text);
|
||||
case LONG:
|
||||
return new Long(text);
|
||||
case FLOAT:
|
||||
return new Float(text);
|
||||
case DOUBLE:
|
||||
return new Double(text);
|
||||
case BOOLEAN:
|
||||
return new Boolean(text);
|
||||
case STRING:
|
||||
return text;
|
||||
case INTEGER: return Integer.valueOf(text);
|
||||
case SHORT: return Short.valueOf(text);
|
||||
case BYTE: return Byte.valueOf(text);
|
||||
case LONG: return Long.valueOf(text);
|
||||
case FLOAT: return Float.valueOf(text);
|
||||
case DOUBLE: return Double.valueOf(text);
|
||||
case BOOLEAN: return Boolean.valueOf(text);
|
||||
case STRING: return text;
|
||||
default: return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user