diff --git a/server-spi-private/src/main/java/org/keycloak/validate/validators/DoubleValidator.java b/server-spi-private/src/main/java/org/keycloak/validate/validators/DoubleValidator.java index d8b3f063bb..200076d2a7 100644 --- a/server-spi-private/src/main/java/org/keycloak/validate/validators/DoubleValidator.java +++ b/server-spi-private/src/main/java/org/keycloak/validate/validators/DoubleValidator.java @@ -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 diff --git a/server-spi-private/src/main/java/org/keycloak/validate/validators/IntegerValidator.java b/server-spi-private/src/main/java/org/keycloak/validate/validators/IntegerValidator.java index 3e9a4d1e88..e34113101c 100644 --- a/server-spi-private/src/main/java/org/keycloak/validate/validators/IntegerValidator.java +++ b/server-spi-private/src/main/java/org/keycloak/validate/validators/IntegerValidator.java @@ -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 diff --git a/server-spi/src/main/java/org/keycloak/validate/ValidatorConfig.java b/server-spi/src/main/java/org/keycloak/validate/ValidatorConfig.java index e9901a1824..86645199d1 100644 --- a/server-spi/src/main/java/org/keycloak/validate/ValidatorConfig.java +++ b/server-spi/src/main/java/org/keycloak/validate/ValidatorConfig.java @@ -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; }