private static OneWayMessageDigestCodec createWellKnownInstance ( String algorithm , String password , OneWayCodec codec ) { try { return new OneWayMessageDigestCodec ( algorithm , password , codec ) ; } catch ( NoSuchAlgorithmException e ) { throw new RuntimeException ( e ) ; } catch ( CloneNotSupportedException e ) { throw new RuntimeException ( e ) ; } }
This creates a well known instance .. the difference with the constructor is that all exceptions are caught and rethrown as RuntimeExcpetion because they should not happen .