Sat, 29 Aug 2020 17:28:24 +0200
fixes exception if integer parameter does not type check
src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java | file | annotate | diff | comparison | revisions |
1.1 --- a/src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java Sat Aug 29 17:13:09 2020 +0200 1.2 +++ b/src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java Sat Aug 29 17:28:24 2020 +0200 1.3 @@ -324,7 +324,8 @@ 1.4 final Constructor<T> ctor = clazz.getConstructor(String.class); 1.5 return Optional.of(ctor.newInstance(paramValue)); 1.6 } catch (ReflectiveOperationException e) { 1.7 - throw new RuntimeException(e); 1.8 + // does not type check and is not convertible - treat as if the parameter was never set 1.9 + return Optional.empty(); 1.10 } 1.11 } 1.12 }