public T safeNewInstance ( ) { try { return newInstance ( ) ; } catch ( NoSuchMethodException e ) { throw new IllegalArgumentException ( e ) ; } catch ( IllegalAccessException e ) { throw new IllegalArgumentException ( e ) ; } catch ( InvocationTargetException e ) { throw new IllegalArgumentException ( e ) ; } catch ( InstantiationException e ) { throw new IllegalArgumentException ( e ) ; } }
The cheap ugly version of the above for when you don t want to catch 900 exceptions at the calling site .