src/main/java/de/uapcore/lightpit/AbstractLightPITServlet.java

changeset 106
9c6ebf67afe9
parent 97
602f75801644
child 109
2e0669e814ff
equal deleted inserted replaced
105:250c5cbb8276 106:9c6ebf67afe9
322 } 322 }
323 try { 323 try {
324 final Constructor<T> ctor = clazz.getConstructor(String.class); 324 final Constructor<T> ctor = clazz.getConstructor(String.class);
325 return Optional.of(ctor.newInstance(paramValue)); 325 return Optional.of(ctor.newInstance(paramValue));
326 } catch (ReflectiveOperationException e) { 326 } catch (ReflectiveOperationException e) {
327 throw new RuntimeException(e); 327 // does not type check and is not convertible - treat as if the parameter was never set
328 return Optional.empty();
328 } 329 }
329 } 330 }
330 } 331 }
331 332
332 /** 333 /**

mercurial