Skip to content

Commit

Permalink
Update ParamConverters.java
Browse files Browse the repository at this point in the history
See #5260
  • Loading branch information
rutterpaul-personal authored and jansupol committed Jun 15, 2023
1 parent 4bdb30d commit 08a85c7
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private abstract static class AbstractStringReader<T> 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);
Expand All @@ -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();
}
Expand Down Expand Up @@ -193,7 +193,6 @@ public <T> ParamConverter<T> getConverter(final Class<T> 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) {
Expand All @@ -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();
}
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 08a85c7

Please sign in to comment.