Source:
<code>protected void handleGetInstanceStateRequest( REQID rid, SocketChannel channel, CheckpointManager.GetInstanceStateRequest request ) { Checkpoint checkpoint = new Checkpoint(topologyName, request); LOG.info("Got a get checkpoint request for " + checkpoint.getCheckpointId() + " " + checkpoint.getComponent() + " " + checkpoint.getInstance() + " on connection: " + channel.socket().getRemoteSocketAddress()); CheckpointManager.GetInstanceStateResponse.Builder responseBuilder = CheckpointManager.GetInstanceStateResponse.newBuilder(); responseBuilder.setInstance(request.getInstance()); responseBuilder.setCheckpointId(request.getCheckpointId()); <START> boolean res; <END> Common.StatusCode statusCode = Common.StatusCode.OK; if (!request.hasCheckpointId() || request.getCheckpointId().isEmpty()) { res = true; LOG.info("The checkpoint id was empty, this sending empty state"); CheckpointManager.InstanceStateCheckpoint dummyState = CheckpointManager.InstanceStateCheckpoint.newBuilder() .setCheckpointId(request.getCheckpointId()) .setState(ByteString.EMPTY).build(); responseBuilder.setCheckpoint(dummyState); } else { try { checkpointsBackend.restore(checkpoint); LOG.info("Get checkpoint successful for " + checkpoint.getCheckpointId() + " " + checkpoint.getComponent() + " " + checkpoint.getInstance()); responseBuilder.setCheckpoint(checkpoint.checkpoint().getCheckpoint()); } catch (StatefulStorageException e) { LOG.info("Get checkpoint not successful for " + checkpoint.getCheckpointId() + " " + checkpoint.getComponent() + " " + checkpoint.getInstance()); statusCode = Common.StatusCode.NOTOK; } } responseBuilder.setStatus(Common.Status.newBuilder().setStatus(statusCode)); sendResponse(rid, channel, responseBuilder.build()); }</code><technical_language>please remove res, used</technical_language>

Target:
protected void handleGetInstanceStateRequest( REQID rid, SocketChannel channel, CheckpointManager.GetInstanceStateRequest request ) { LOG.info(String.format("Got a get checkpoint request for checkpointId %s " + " component %s taskId %d on connection %s", request.getCheckpointId(), request.getInstance().getInfo().getComponentName(), request.getInstance().getInfo().getTaskId(), channel.socket().getRemoteSocketAddress())); CheckpointManager.GetInstanceStateResponse.Builder responseBuilder = CheckpointManager.GetInstanceStateResponse.newBuilder(); responseBuilder.setInstance(request.getInstance()); responseBuilder.setCheckpointId(request.getCheckpointId()); String errorMessage = ""; Common.StatusCode statusCode = Common.StatusCode.OK; if (!request.hasCheckpointId() || request.getCheckpointId().isEmpty()) { LOG.info("The checkpoint id was empty, this sending empty state"); CheckpointManager.InstanceStateCheckpoint dummyState = CheckpointManager.InstanceStateCheckpoint.newBuilder() .setCheckpointId(request.getCheckpointId()) .setState(ByteString.EMPTY).build(); responseBuilder.setCheckpoint(dummyState); } else { try { Checkpoint checkpoint = statefulStorage.restore(topologyName, request.getCheckpointId(), request.getInstance()); LOG.info(String.format("Get checkpoint successful for checkpointId %s " + "component %s taskId %d", checkpoint.getCheckpointId(), checkpoint.getComponent(), checkpoint.getTaskId())); responseBuilder.setCheckpoint(checkpoint.getCheckpoint()); } catch (StatefulStorageException e) { errorMessage = String.format("Get checkpoint not successful for checkpointId %s " + "component %s taskId %d", request.getCheckpointId(), request.getInstance().getInfo().getComponentName(), request.getInstance().getInfo().getTaskId()); LOG.log(Level.WARNING, errorMessage, e); statusCode = Common.StatusCode.NOTOK; } } responseBuilder.setStatus(Common.Status.newBuilder().setStatus(statusCode) .setMessage(errorMessage)); sendResponse(rid, channel, responseBuilder.build()); }