Source:
<code>public CheckpointManager( String topologyName, String topologyId, String checkpointMgrId, String serverHost, int serverPort, SystemConfig systemConfig, CheckpointManagerConfig checkpointManagerConfig) throws IOException { this.checkpointManagerServerLoop = new NIOLooper(); HeronSocketOptions serverSocketOptions = new HeronSocketOptions(32768, 16, 32768, 16, 655360, 655360); IBackend checkpointsBackend; String classname = (String) checkpointManagerConfig.get(CheckpointManagerConfig.CONFIG_KEY_CLASSNAME); try { checkpointsBackend = (IBackend) Class.forName(classname).newInstance(); } catch (InstantiationException e) { <START> throw new RuntimeException(e + " class must have a no-arg constructor."); <END> } catch (IllegalAccessException e) { throw new RuntimeException(e + " class must be concrete."); } catch (ClassNotFoundException e) { throw new RuntimeException(e + " class must be a class path."); } checkpointsBackend.init( Collections.unmodifiableMap(checkpointManagerConfig.getBackendConfig())); this.checkpointManagerServer = new CheckpointManagerServer( topologyName, topologyId, checkpointMgrId, checkpointsBackend, checkpointManagerServerLoop, serverHost, serverPort, serverSocketOptions); }</code><technical_language>1. typically want append messages exception, swallows exception chain. 2. throw RuntimeException generic for a client derive real meaning from. 3. include meaningful info in message user, classname. Instead do this (similar for rest of this class): throw new CheckpointManagerException(classname + " initiated", e);</technical_language>

Target:
public CheckpointManager( String topologyName, String topologyId, String checkpointMgrId, String serverHost, int serverPort, SystemConfig systemConfig, CheckpointManagerConfig checkpointManagerConfig) throws IOException, CheckpointManagerException { this.checkpointManagerServerLoop = new NIOLooper(); HeronSocketOptions serverSocketOptions = new HeronSocketOptions( checkpointManagerConfig.getWriteBatchSizeBytes(), checkpointManagerConfig.getWriteBatchTimeMs(), checkpointManagerConfig.getReadBatchSizeBytes(), checkpointManagerConfig.getReadBatchTimeMs(), checkpointManagerConfig.getSocketSendSize(), checkpointManagerConfig.getSocketReceiveSize()); IStatefulStorage statefulStorage; String classname = checkpointManagerConfig.getStorageClassname(); try { statefulStorage = (IStatefulStorage) Class.forName(classname).newInstance(); } catch (InstantiationException e) { throw new CheckpointManagerException(classname + " class must have a no-arg constructor.", e); } catch (IllegalAccessException e) { throw new CheckpointManagerException(classname + " class must be concrete.", e); } catch (ClassNotFoundException e) { throw new CheckpointManagerException(classname + " class must be a class path.", e); } try { statefulStorage.init( Collections.unmodifiableMap(checkpointManagerConfig.getStatefulStorageConfig())); } catch (StatefulStorageException e) { throw new CheckpointManagerException(classname + " init threw exception", e); } this.checkpointManagerServer = new CheckpointManagerServer( topologyName, topologyId, checkpointMgrId, statefulStorage, checkpointManagerServerLoop, serverHost, serverPort, serverSocketOptions); }