diff --git a/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverters.java b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverters.java index c2f9e55d2f..699a2b784b 100644 --- a/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverters.java +++ b/core-common/src/main/java/org/glassfish/jersey/internal/inject/ParamConverters.java @@ -60,7 +60,7 @@ private abstract static class AbstractStringReader implements ParamConverter< @Override public T fromString(final String value) { if (value == null) { - throw new IllegalArgumentException(LocalizationMessages.METHOD_PARAMETER_CANNOT_BE_NULL("value")); + return null; } try { return _fromString(value); @@ -85,7 +85,7 @@ public T fromString(final String value) { @Override public String toString(final T value) throws IllegalArgumentException { if (value == null) { - throw new IllegalArgumentException(LocalizationMessages.METHOD_PARAMETER_CANNOT_BE_NULL("value")); + return null; } return value.toString(); } @@ -193,7 +193,6 @@ public ParamConverter getConverter(final Class rawType, public T fromString(String value) { if (value == null || value.isEmpty()) { return null; - // throw new IllegalStateException(LocalizationMessages.METHOD_PARAMETER_CANNOT_BE_NULL("value")); } if (value.length() == 1) { @@ -206,7 +205,7 @@ public T fromString(String value) { @Override public String toString(T value) { if (value == null) { - throw new IllegalArgumentException(LocalizationMessages.METHOD_PARAMETER_CANNOT_BE_NULL("value")); + return null; } return value.toString(); } @@ -246,7 +245,7 @@ public T fromString(final String value) { @Override public String toString(final T value) throws IllegalArgumentException { if (value == null) { - throw new IllegalArgumentException(LocalizationMessages.METHOD_PARAMETER_CANNOT_BE_NULL("value")); + return null; } return value.toString(); }