Avoid calling primitive wrapper constructors in server-spi-private (#24163)
Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
This commit is contained in:
parent
0bf1fe3eb3
commit
9d429400d4
3 changed files with 4 additions and 4 deletions
|
@ -49,7 +49,7 @@ public class DoubleValidator extends AbstractNumberValidator implements Configur
|
|||
if (value instanceof Number) {
|
||||
return (Number) value;
|
||||
}
|
||||
return new Double(value.toString());
|
||||
return Double.valueOf(value.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -44,7 +44,7 @@ public class IntegerValidator extends AbstractNumberValidator implements Configu
|
|||
if (value instanceof Integer || value instanceof Long) {
|
||||
return (Number) value;
|
||||
}
|
||||
return new Long(value.toString());
|
||||
return Long.valueOf(value.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -108,7 +108,7 @@ public class ValidatorConfig {
|
|||
return ((Number) value).intValue();
|
||||
} else if (value instanceof String) {
|
||||
try {
|
||||
return new Integer((String) value);
|
||||
return Integer.valueOf((String) value);
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ public class ValidatorConfig {
|
|||
return ((Number) value).longValue();
|
||||
} else if (value instanceof String) {
|
||||
try {
|
||||
return new Long((String) value);
|
||||
return Long.valueOf((String) value);
|
||||
} catch (NumberFormatException e) {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue