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) {
|
if (value instanceof Number) {
|
||||||
return (Number) value;
|
return (Number) value;
|
||||||
}
|
}
|
||||||
return new Double(value.toString());
|
return Double.valueOf(value.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class IntegerValidator extends AbstractNumberValidator implements Configu
|
||||||
if (value instanceof Integer || value instanceof Long) {
|
if (value instanceof Integer || value instanceof Long) {
|
||||||
return (Number) value;
|
return (Number) value;
|
||||||
}
|
}
|
||||||
return new Long(value.toString());
|
return Long.valueOf(value.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -108,7 +108,7 @@ public class ValidatorConfig {
|
||||||
return ((Number) value).intValue();
|
return ((Number) value).intValue();
|
||||||
} else if (value instanceof String) {
|
} else if (value instanceof String) {
|
||||||
try {
|
try {
|
||||||
return new Integer((String) value);
|
return Integer.valueOf((String) value);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ public class ValidatorConfig {
|
||||||
return ((Number) value).longValue();
|
return ((Number) value).longValue();
|
||||||
} else if (value instanceof String) {
|
} else if (value instanceof String) {
|
||||||
try {
|
try {
|
||||||
return new Long((String) value);
|
return Long.valueOf((String) value);
|
||||||
} catch (NumberFormatException e) {
|
} catch (NumberFormatException e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue