auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public final void registerEvents() { UI.events.registerEvent((ModelUpdatedEventHandler) this::modelUpdated); UI.events.registerEvent((UpdateRateLimitsEventHandler) this::updateSyncRefreshRate); UI.events.registerEvent((UpdateRateLimitsEventHandler) this::updateAPIBox); UI.events.registerEvent((ShowErrorDialogEventHandler) this::showErrorDialog); UI.events.registerEvent((PrimaryRepoChangedEventHandler) this::setDefaultRepo); }

Target:
public final void registerEvents() { UI.events.registerEvent((ModelUpdatedEventHandler) this::modelUpdated); UI.events.registerEvent((NewApiQuotaInfoAvailableEventHandler) this::updateApiQuotaInfo); UI.events.registerEvent((ShowErrorDialogEventHandler) this::showErrorDialog); UI.events.registerEvent((PrimaryRepoChangedEventHandler) this::setDefaultRepo); }
Source:
public synchronized Set<String> getProxyUsers() { if (PROXY_USERS == null) { PROXY_USERS = new HashSet<>(); for (Map.Entry<String, String> entry : this) { String propName = entry.getKey(); if (propName.startsWith(ProxyUsers.CONF_HADOOP_PROXYUSER)) { String[] tokens = propName.split("\\."); PROXY_USERS.add(tokens[2]); } } } return PROXY_USERS; }

Target:
public Set<String> getProxyUsers() { if (PROXY_USERS == null) { synchronized (this) { if (PROXY_USERS == null) { PROXY_USERS = new HashSet<>(); String regex = ProxyUsers.CONF_HADOOP_PROXYUSER + "." + "([a-zA-Z0-9_\\-]+).(users|groups|hosts)"; regex = regex.replace(".", "\\."); Pattern pattern = Pattern.compile(regex); for (Object item : getProps().keySet()){ Matcher m = pattern.matcher((String)item); if (m.matches()) { PROXY_USERS.add(m.group(1)); } } } } } return PROXY_USERS; }
Source:
private void performWorkload(BaseSubscriber<Object> documentSubscriber, OperationType type, long i) throws Exception { Flux<? extends Object> obs; CosmosAsyncContainer container = containers.get((int) i % containers.size()); if (type.equals(OperationType.Create)) { PojoizedJson data = BenchmarkHelper.generateDocument(prefixUuidForCreate + i, dataFieldValue, partitionKey, configuration.getDocumentDataFieldCount()); obs = container.createItem(data).flux(); } else if (type.equals(OperationType.Query)) { CosmosQueryRequestOptions options = new CosmosQueryRequestOptions(); String sqlQuery = "Select top 100 * from c order by c._ts"; obs = container.queryItems(sqlQuery, options, PojoizedJson.class).byPage(10); } else { int index = random.nextInt(docsToRead.get(container.getId()).size()); RequestOptions options = new RequestOptions(); String partitionKeyValue = docsToRead.get(container.getId()).get(index).getId(); options.setPartitionKey(new PartitionKey(partitionKeyValue)); Mono sparsitySleepMono = sparsityMono(); obs = sparsitySleepMono.flux().doOnComplete( () -> container.readItem( docsToRead.get(container.getId()).get(index).getId(), new PartitionKey(partitionKeyValue), PojoizedJson.class) ); } concurrencyControlSemaphore.acquire(); obs.subscribeOn(Schedulers.parallel()).subscribe(documentSubscriber); }

Target:
private void performWorkload(BaseSubscriber<Object> documentSubscriber, OperationType type, long i) throws Exception { Flux<? extends Object> obs; Mono sparsitySleepMono = sparsityMono(i); CosmosAsyncContainer container = containers.get((int) i % containers.size()); if (type.equals(OperationType.Create)) { PojoizedJson data = BenchmarkHelper.generateDocument(prefixUuidForCreate + i, dataFieldValue, partitionKey, configuration.getDocumentDataFieldCount()); obs = sparsitySleepMono.flux().flatMap( null, null, () -> container.createItem(data)); } else if (type.equals(OperationType.Query)) { CosmosQueryRequestOptions options = new CosmosQueryRequestOptions(); String sqlQuery = "Select top 100 * from c order by c._ts"; obs = sparsitySleepMono.flux().flatMap( null, null, () -> container.queryItems(sqlQuery, options, PojoizedJson.class).byPage(10)); } else { int index = random.nextInt(docsToRead.get(container.getId()).size()); RequestOptions options = new RequestOptions(); String partitionKeyValue = docsToRead.get(container.getId()).get(index).getId(); options.setPartitionKey(new PartitionKey(partitionKeyValue)); obs = sparsitySleepMono.flux().flatMap( null, null, () -> container.readItem(docsToRead.get(container.getId()).get(index).getId(), new PartitionKey(partitionKeyValue), PojoizedJson.class)); } concurrencyControlSemaphore.acquire(); obs.subscribeOn(Schedulers.parallel()).subscribe(documentSubscriber); }
Source:
private void launchStockMediaPicker() { if (mSite != null) { ActivityLauncher.showStockMediaPickerForResult(this, mSite, RequestCodes.STOCK_MEDIA_PICKER_SINGLE_SELECT); } }

Target:
private void launchStockMediaPicker() { if (mSite != null) { ActivityLauncher.showStockMediaPickerForResult(this, mSite, RequestCodes.STOCK_MEDIA_PICKER_SINGLE_SELECT); } else { ToastUtils.showToast(this, R.string.blog_not_found); } }
Source:
public void checkReference(boolean partial, boolean legacy) { checkCommon("Bundle org.nuxeo.apidoc.core", "Bundle org.nuxeo.apidoc.core", "In bundle group org.nuxeo.ecm.platform", "Documentation\n" + "Deployment Order\n" + "Components\n" + "Maven Artifact\n" + "Manifest"); try { String readme = AbstractExplorerTest.getReferenceContent("data/core_readme.txt"); String parentReadme = AbstractExplorerTest.getReferenceContent("data/apidoc_readme.txt"); checkDocumentationText("ReadMe.md\n" + readme + "\nParent Documentation: ReadMe.md\n" + parentReadme); } catch (IOException e) { throw new RuntimeException(e); } checkGroupId("org.nuxeo.ecm.platform"); checkArtifactId("nuxeo-apidoc-core"); checkRequirements(null); checkDeploymentOrder(legacy ? false : true); }

Target:
public void checkReference(boolean partial, boolean legacy) { checkCommon("Bundle org.nuxeo.apidoc.core", "Bundle org.nuxeo.apidoc.core", "In bundle group org.nuxeo.ecm.platform", "Documentation\n" + "Deployment Order\n" + "Components\n" + "Maven Artifact\n" + "Manifest"); try { String readme = AbstractExplorerTest.getReferenceContent("data/core_readme.txt"); String parentReadme = AbstractExplorerTest.getReferenceContent("data/apidoc_readme.txt"); checkDocumentationText("ReadMe.md\n" + readme + "\nParent Documentation: ReadMe.md\n" + parentReadme); } catch (IOException e) { throw new RuntimeException(e); } checkGroupId("org.nuxeo.ecm.platform"); checkArtifactId("nuxeo-apidoc-core"); checkRequirements(null); checkDeploymentOrder(!legacy); }
Source:
private void runLocked(final Runnable action) { try { Exception releaseException = null; final InterProcessLock lock = new InterProcessSemaphoreMutex(zooKeeperHolder.get(), ROOT_PATH + "/lock"); lock.acquire(); try { action.run(); } finally { try { lock.release(); } catch (final Exception ex) { LOG.warn("Failed to release lock", ex); releaseException = ex; } } if (null != releaseException) { throw releaseException; } } catch (final RuntimeException ex) { throw ex; } catch (final Exception ex) { throw new RuntimeException(ex); } }

Target:
private void runLocked(final Runnable action) { try { Exception releaseException = null; final InterProcessLock lock = new InterProcessSemaphoreMutex(zooKeeperHolder.get(), ROOT_PATH + "/lock"); lock.acquire(); try { action.run(); } finally { try { lock.release(); } catch (final Exception ex) { LOG.error("Failed to release lock", ex); releaseException = ex; } } if (null != releaseException) { throw releaseException; } } catch (final RuntimeException ex) { throw ex; } catch (final Exception ex) { throw new RuntimeException(ex); } }
Source:
public String listConnectionsAsJSON() throws Exception { checkStarted(); clearIO(); try { JsonArrayBuilder array = JsonLoader.createArrayBuilder(); Set<RemotingConnection> connections = server.getRemotingService().getConnections(); for (RemotingConnection connection : connections) { JsonObjectBuilder obj = JsonLoader.createObjectBuilder().add("connectionID", connection.getID().toString()) .add("clientAddress", connection.getRemoteAddress()) .add("creationTime", connection.getCreationTime()) .add("implementation", connection.getClass().getSimpleName()) .add("sessionCount", server.getSessions(connection.getID().toString()).size()); if (connection.getClientID() != null) { obj.add("clientID", connection.getClientID()); } else { obj.add("clientID", ""); } array.add(obj); } return array.build().toString(); } finally { blockOnIO(); } }

Target:
public String listConnectionsAsJSON() throws Exception { checkStarted(); clearIO(); try { JsonArrayBuilder array = JsonLoader.createArrayBuilder(); Set<RemotingConnection> connections = server.getRemotingService().getConnections(); for (RemotingConnection connection : connections) { JsonObjectBuilder obj = JsonLoader.createObjectBuilder().add("connectionID", connection.getID().toString()).add("clientAddress", connection.getRemoteAddress()).add("creationTime", connection.getCreationTime()).add("implementation", connection.getClass().getSimpleName()).add("sessionCount", server.getSessions(connection.getID().toString()).size()); List<ServerSession> sessions = server.getSessions(connection.getID().toString()); if (sessions.size() > 0) { if (sessions.get(0).getMetaData(ClientSession.JMS_SESSION_CLIENT_ID_PROPERTY) != null) { obj.add("clientID", sessions.get(0).getMetaData(ClientSession.JMS_SESSION_CLIENT_ID_PROPERTY)); } else { obj.add("clientID", ""); } } else { obj.add("clientID", ""); } array.add(obj); } return array.build().toString(); } finally { blockOnIO(); } }
Source:
private void decodeMsg(Object msg) throws Throwable { final Class<?> msgClazz = msg.getClass(); if (msgClazz == NettyMessage.BufferResponse.class) { NettyMessage.BufferResponse bufferOrEvent = (NettyMessage.BufferResponse) msg; RemoteInputChannel inputChannel = inputChannels.get(bufferOrEvent.receiverId); if (inputChannel == null || inputChannel.isReleased()) { bufferOrEvent.releaseBuffer(); cancelRequestFor(bufferOrEvent.receiverId); return; } decodeBufferOrEvent(inputChannel, bufferOrEvent); } else if (msgClazz == NettyMessage.ErrorResponse.class) { NettyMessage.ErrorResponse error = (NettyMessage.ErrorResponse) msg; SocketAddress remoteAddr = ctx.channel().remoteAddress(); if (error.isFatalError()) { notifyAllChannelsOfErrorAndClose(new RemoteTransportException( "Fatal error at remote task manager '" + remoteAddr + "'.", remoteAddr, error.cause)); } else { RemoteInputChannel inputChannel = inputChannels.get(error.receiverId); if (inputChannel != null) { if (error.cause.getClass() == PartitionNotFoundException.class) { inputChannel.onFailedPartitionRequest(); } else { inputChannel.onError(new RemoteTransportException( "Error at remote task manager '" + remoteAddr + "'.", remoteAddr, error.cause)); } } } } else if (msgClazz == NettyMessage.AddBacklog.class) { NettyMessage.AddBacklog addBacklog = (NettyMessage.AddBacklog) msg; RemoteInputChannel inputChannel = inputChannels.get(addBacklog.receiverId); inputChannel.onSenderBacklog(addBacklog.backlog); } else { throw new IllegalStateException("Received unknown message from producer: " + msg.getClass()); } }

Target:
private void decodeMsg(Object msg) throws Throwable { final Class<?> msgClazz = msg.getClass(); if (msgClazz == NettyMessage.BufferResponse.class) { NettyMessage.BufferResponse bufferOrEvent = (NettyMessage.BufferResponse) msg; RemoteInputChannel inputChannel = inputChannels.get(bufferOrEvent.receiverId); if (inputChannel == null || inputChannel.isReleased()) { bufferOrEvent.releaseBuffer(); cancelRequestFor(bufferOrEvent.receiverId); return; } try { decodeBufferOrEvent(inputChannel, bufferOrEvent); } catch (Throwable t) { inputChannel.onError(t); } } else if (msgClazz == NettyMessage.ErrorResponse.class) { NettyMessage.ErrorResponse error = (NettyMessage.ErrorResponse) msg; SocketAddress remoteAddr = ctx.channel().remoteAddress(); if (error.isFatalError()) { notifyAllChannelsOfErrorAndClose(new RemoteTransportException( "Fatal error at remote task manager '" + remoteAddr + "'.", remoteAddr, error.cause)); } else { RemoteInputChannel inputChannel = inputChannels.get(error.receiverId); if (inputChannel != null) { if (error.cause.getClass() == PartitionNotFoundException.class) { inputChannel.onFailedPartitionRequest(); } else { inputChannel.onError(new RemoteTransportException( "Error at remote task manager '" + remoteAddr + "'.", remoteAddr, error.cause)); } } } } else if (msgClazz == AddBacklog.class) { AddBacklog addBacklog = (AddBacklog) msg; RemoteInputChannel inputChannel = inputChannels.get(addBacklog.receiverId); inputChannel.onSenderBacklog(addBacklog.backlog); } else { throw new IllegalStateException("Received unknown message from producer: " + msg.getClass()); } }
Source:
public void commitOutput() throws IOException { try (OutputStream os = response.getOutputStream()) { try (InputStream is = getInputStream()) { if (is != null) { Utils.transferContent(is, os); } os.flush(); } } }

Target:
public void commitOutput() throws IOException { OutputStream os = response.getOutputStream(); InputStream is = getInputStream(); if (is != null) { Utils.transferContent(is, os); } os.flush(); }
Source:
public static void delete(Path path) throws IOException { if ( path == null ) { throw new IllegalArgumentException(); } if ( Files.notExists( path ) ) { return; } Files.walkFileTree( path, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { safeDelete( file ); return FileVisitResult.CONTINUE; } @Override public FileVisitResult postVisitDirectory(Path dir, IOException exc) { safeDelete( dir ); return FileVisitResult.CONTINUE; } } ); }

Target:
public static void delete(Path path) throws IOException { deleteRecursive( path, false ); }
Source:
private boolean doValidation(ValidationHandler handler, String elementType, String elementName, String permissionType, List<FieldMetadata> roles) { boolean valid = true; for (FieldMetadata roleMetadata : roles) { String lowerCaseRoleName = roleMetadata.getName().toLowerCase(); if (lowerCaseRoleName.startsWith("system_") || lowerCaseRoleName.equals("administration") || lowerCaseRoleName.equals("super_admin")) { String message = "System role \"" + roleMetadata.getName() + "\" shouldn't be used to set \"" + permissionType + "\" permission on "+elementType+" \"" + elementName + "\" ."; Element data = roleMetadata.<Element> getData(MetadataRepository.XSD_DOM_ELEMENT); Integer lineNum = roleMetadata.<Integer> getData(MetadataRepository.XSD_LINE_NUMBER); Integer colNum = roleMetadata.<Integer> getData(MetadataRepository.XSD_COLUMN_NUMBER); if(complexTypeMetadata != null) { handler.error(complexTypeMetadata, message, data,lineNum, colNum, ValidationError.PERMISSION_SYSTEM_ROLE_NOT_SETTABLE); } else { handler.error(field, message, data,lineNum, colNum, ValidationError.PERMISSION_SYSTEM_ROLE_NOT_SETTABLE); } valid &= false; } } return valid; }

Target:
private boolean doValidation(ValidationHandler handler, String elementType, String elementName, String permissionType, List<FieldMetadata> roles) { boolean valid = true; for (FieldMetadata roleMetadata : roles) { String lowerCaseRoleName = roleMetadata.getName().toLowerCase(); if (lowerCaseRoleName.startsWith(PermissionConstants.PERMISSION_ROLE_SYSTEM_PREFIX) || lowerCaseRoleName.equals(PermissionConstants.PERMISSION_ROLE_ADMINISTRATION)) { String message = "System role \"" + roleMetadata.getName() + "\" shouldn't be used to set \"" + permissionType + "\" permission on " + elementType + " \"" + elementName + "\" ."; Element data = roleMetadata.<Element> getData(MetadataRepository.XSD_DOM_ELEMENT); Integer lineNum = roleMetadata.<Integer> getData(MetadataRepository.XSD_LINE_NUMBER); Integer colNum = roleMetadata.<Integer> getData(MetadataRepository.XSD_COLUMN_NUMBER); if(complexTypeMetadata != null) { handler.error(complexTypeMetadata, message, data,lineNum, colNum, ValidationError.PERMISSION_SYSTEM_ROLE_NOT_SETTABLE); } else { handler.error(field, message, data,lineNum, colNum, ValidationError.PERMISSION_SYSTEM_ROLE_NOT_SETTABLE); } valid &= false; } } return valid; }
Source:
public SortedComponentGroupedEvents(ComponentGroupedEvents groupedEvents, String selectedEventId) { this.componentName = groupedEvents.getComponentName(); this.inputEventIds = new ArrayList<>(groupedEvents.getInputEventIds()); this.outputEventIds = new ArrayList<>(groupedEvents.getOutputEventIds()); if (this.outputEventIds.contains(selectedEventId)) { this.containingSelectedEvent = true; this.outputEventIds.remove(selectedEventId); this.outputEventIds.add(0, selectedEventId); } else { this.containingSelectedEvent = false; } }

Target:
public SortedComponentGroupedEvents(ComponentGroupedEvents groupedEvents, String selectedEventId) { this.componentName = groupedEvents.getComponentName(); this.inputEventIds = new LinkedList<>(groupedEvents.getInputEventIds()); this.outputEventIds = new LinkedList<>(groupedEvents.getOutputEventIds()); if (this.outputEventIds.contains(selectedEventId)) { this.containingSelectedEvent = true; this.outputEventIds.remove(selectedEventId); this.outputEventIds.add(0, selectedEventId); } else { this.containingSelectedEvent = false; } }
Source:
private boolean handleFailure(PollReport pollReport) { log.trace("Handle failures for the report: {}", pollReport); Layout layout = serverContext.copyManagementLayout(); try { ClusterState clusterState = pollReport.getClusterState(); if (clusterState.size() != layout.getAllServers().size()) { log.error("Cluster representation is different than layout. Cluster: {}, layout: {}", clusterState, layout); return false; } Optional<NodeRank> maybeFailedNode = recommendationEngine.failedServer( clusterState, layout.getUnresponsiveServers(), serverContext.getLocalEndpoint() ); if (maybeFailedNode.isPresent()) { NodeRank failedNode = maybeFailedNode.get(); Set<String> failedNodes = new HashSet<>(); failedNodes.add(failedNode.getEndpoint()); handleFailure(failedNodes, pollReport); return true; } } catch (Exception e) { log.error("Exception invoking failure handler : {}", e); } return false; }

Target:
private boolean handleFailure(PollReport pollReport) { log.trace("Handle failures for the report: {}", pollReport); Layout layout = serverContext.copyManagementLayout(); try { ClusterState clusterState = pollReport.getClusterState(); if (clusterState.size() != layout.getAllServers().size()) { log.error("Cluster representation is different than layout. Cluster: {}, layout: {}", clusterState, layout); return false; } Optional<NodeRank> maybeFailedNode = advisor.failedServer( clusterState, layout.getUnresponsiveServers(), serverContext.getLocalEndpoint() ); if (maybeFailedNode.isPresent()) { NodeRank failedNode = maybeFailedNode.get(); FailureDetectorMetrics history = FailureDetectorMetrics.builder() .localNode(serverContext.getLocalEndpoint()) .graph(ClusterGraph.transform(pollReport.getClusterState()).toSymmetric().connectivityGraph()) .healed(failedNode) .action(FailureDetectorAction.FAIL) .unresponsiveNodes(layout.getUnresponsiveServers()) .layout(layout.getLayoutServers()) .epoch(layout.getEpoch()) .build(); serverContext.saveFailureDetectorMetrics(history); Set<String> failedNodes = new HashSet<>(); failedNodes.add(failedNode.getEndpoint()); handleFailure(failedNodes, pollReport); return true; } } catch (Exception e) { log.error("Exception invoking failure handler : {}", e); } return false; }
Source:
public List<PageHeaderWithOffset> writeToFileWriter(ParquetFileWriter writer) throws IOException { final List<PageHeaderWithOffset> allPageHeaders = new ArrayList<PageHeaderWithOffset>(); writer.startColumn(path, totalValueCount, compressor.getCodecName()); if (dictionaryPage != null) { allPageHeaders.add(writer.writeDictionaryPage(dictionaryPage)); encodings.add(dictionaryPage.getEncoding()); } long pageOffset = writer.getPos(); for (PageHeaderWithOffset pageHeaderWithOffset: pageHeaderWithOffsets) { final long headerSize = pageHeaderWithOffset.getHeaderByteSize(); pageOffset += headerSize; final long pageSize = pageHeaderWithOffset.getPageHeader().getCompressed_page_size(); allPageHeaders.add(new PageHeaderWithOffset(pageHeaderWithOffset.getPageHeader(), pageOffset)); pageOffset += pageSize; } writer.writeDataPages(buf, uncompressedLength, compressedLength, totalStatistics, new ArrayList<Encoding>(encodings)); writer.endColumn(); if (INFO) { LOG.info( String.format( "written %,dB for %s: %,d values, %,dB raw, %,dB comp, %d pages, encodings: %s", buf.size(), path, totalValueCount, uncompressedLength, compressedLength, pageCount, encodings) + (dictionaryPage != null ? String.format( ", dic { %,d entries, %,dB raw, %,dB comp}", dictionaryPage.getDictionarySize(), dictionaryPage.getUncompressedSize(), dictionaryPage.getDictionarySize()) : "")); } encodings.clear(); pageCount = 0; return allPageHeaders; }

Target:
public List<PageHeaderWithOffset> writeToFileWriter(ParquetFileWriter writer) throws IOException { if (dictionaryPage == null) { return writeBufferedPages(writer, null); } SortedDictionary sortedDictionary = new SortedDictionary(dictionaryPage, path, parquetProperties.getAllocator(), parquetProperties.getDictionaryPageSizeThreshold()); for (PageHolder pageHolder : bufferedPages) { final BytesInput data = pageHolder.getData(); final Encoding valuesEncoding = pageHolder.getValuesEncoding(); final ValuesReader dictionaryBasedValuesReader = valuesEncoding.getDictionaryBasedValuesReader(path, ValuesType.VALUES, sortedDictionary.getDictionary()); dictionaryBasedValuesReader.initFromPage(pageHolder.getValueCount(), data.toByteBuffer(), 0); final DictionaryValuesWriter valuesWriter = parquetProperties.dictionaryWriter(path, (int)data.size()); final IntList encodedValues = new IntList(); for (int i = 0; i < pageHolder.getValueCount(); ++i) { final int oldDictionaryId = dictionaryBasedValuesReader.readValueDictionaryId(); encodedValues.add(sortedDictionary.getNewId(oldDictionaryId)); } BytesInput newData = valuesWriter.getBytes(encodedValues); pageHolder.setData(newData); } return writeBufferedPages(writer, sortedDictionary.getSortedDictionaryPage()); }
Source:
public Collection<String> getColumnNames() { final ImmutableSet<String> names = storageFields.keySet(); final List<String> list = newLinkedList(names); Collections.sort(list); return list; }

Target:
public Set<String> getColumnNames() { return storageFields.keySet(); }
Source:
private GlusterVolumeTaskStatusEntity fetchTaskStatusDetails() { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeRebalanceStatus, new GlusterVolumeVDSParameters(getUpServerId(clusterId), volume.getName())); GlusterVolumeTaskStatusEntity entity = (GlusterVolumeTaskStatusEntity) returnValue.getReturnValue(); GlusterAsyncTask asyncTask = volume.getAsyncTask(); if (asyncTask != null) { List<Step> stepsList = getStepDao().getStepsByExternalId(asyncTask.getTaskId()); if (stepsList != null && !stepsList.isEmpty()) { entity.setStartTime(stepsList.get(0).getStartTime()); } } return entity; }

Target:
private GlusterVolumeTaskStatusEntity fetchTaskStatusDetails() { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeRebalanceStatus, new GlusterVolumeVDSParameters(getUpServerId(clusterId), volume.getName())); GlusterVolumeTaskStatusEntity entity = (GlusterVolumeTaskStatusEntity) returnValue.getReturnValue(); GlusterAsyncTask asyncTask = volume.getAsyncTask(); if (asyncTask != null) { Guid taskId = asyncTask.getTaskId(); if (taskId != null) { List<Step> stepsList = getStepDao().getStepsByExternalId(taskId); if (stepsList != null && !stepsList.isEmpty()) { entity.setStartTime(stepsList.get(0).getStartTime()); } } } return entity; }
Source:
void dispose() { if (semanticResourcesUpdater != null) { semanticResourcesUpdater.dispose(); semanticResourcesUpdater = null; } }

Target:
void dispose() { session = null; if (semanticResourcesUpdater != null) { semanticResourcesUpdater.dispose(); semanticResourcesUpdater = null; } }
Source:
Object loadFromPersistence(String key) { File file = getMapStoreFilePath(key).toFile(); if (!file.exists()) { return null; } InputStream inputStream = null; try { inputStream = new FileInputStream(Paths.get(persistencePath.toString(), key + SER).toFile()); InputStream buffer = new BufferedInputStream(inputStream); try (ObjectInput input = new ObjectInputStream(buffer)) { return input.readObject(); } } catch (IOException e) { LOGGER.info("Unable to read object.", e); } catch (ClassNotFoundException e) { LOGGER.info("Class for object being read from stream does not exist.", e); } finally { IOUtils.closeQuietly(inputStream); } return null; }

Target:
private Object loadFromPersistence(String key) { File file = getMapStoreFile(key); if (!file.exists()) { return null; } try (ObjectInput input = new ObjectInputStream(new BufferedInputStream(new FileInputStream(file)))) { return input.readObject(); } catch (IOException e) { LOGGER.info("Unable to read object.", e); } catch (ClassNotFoundException e) { LOGGER.info("Class for object being read from stream does not exist.", e); FileUtils.deleteQuietly(file); } return null; }
Source:
public void test_json_support() throws Exception { Fs fs = startCrawlerDefinition() .setJsonSupport(true) .build(); startCrawler(getCrawlerName(), fs, endCrawlerDefinition(getCrawlerName()), null); assertThat("We should have 0 doc for tweet in text field...", awaitBusy(() -> { try { SearchResponse response = elasticsearchClient.search(getCrawlerName(), null, "json_content.text:tweet"); return response.getHits().getTotal() == 2; } catch (IOException e) { logger.warn("Caught exception while running the test", e); return false; } }), equalTo(true)); }

Target:
public void test_json_support() throws Exception { Fs fs = startCrawlerDefinition() .setJsonSupport(true) .build(); startCrawler(getCrawlerName(), fs, endCrawlerDefinition(getCrawlerName()), null); assertThat("We should have 2 doc for tweet in text field...", awaitBusy(() -> { try { SearchResponse response = elasticsearchClient.search(getCrawlerName(), null, "text:tweet"); return response.getHits().getTotal() == 2; } catch (IOException e) { logger.warn("Caught exception while running the test", e); return false; } }), equalTo(true)); }
Source:
public void render(DefaultRenderingProcess.StereoRenderState stereoRenderState) { resetStats(); switch (stereoRenderState) { case MONO: currentRenderingStage = WorldRenderingStage.DEFAULT; isFirstRenderingStageForCurrentFrame = true; break; case OCULUS_LEFT_EYE: currentRenderingStage = WorldRenderingStage.OCULUS_LEFT_EYE; playerCamera.updateFrustum(); isFirstRenderingStageForCurrentFrame = true; break; case OCULUS_RIGHT_EYE: currentRenderingStage = WorldRenderingStage.OCULUS_RIGHT_EYE; playerCamera.updateFrustum(); isFirstRenderingStageForCurrentFrame = false; break; } renderableWorld.updateAndQueueVisibleChunks(isFirstRenderingStageForCurrentFrame); renderShadowMap(); renderWorldReflection(); toggleWireFrameON(); DefaultRenderingProcess.getInstance().clear(); DefaultRenderingProcess.getInstance().beginRenderSceneOpaque(); renderSky(); try (Activity ignored = PerformanceMonitor.startActivity("Render World")) { renderObjectsOpaque(); renderChunksOpaque(); renderChunksAlphaReject(); renderOverlays(); renderFirstPersonView(); DefaultRenderingProcess.getInstance().endRenderSceneOpaque(); PerformanceMonitor.startActivity("Render Light Geometry"); renderLightGeometry(); PerformanceMonitor.endActivity(); renderChunksRefractiveReflective(); } toggleWireFrameOFF(); combineRefractiveReflectiveAndOpaquePasses(); renderSimpleBlendMaterialsIntoCombinedPass(); renderFinalPostProcessedScene(stereoRenderState); playerCamera.updatePrevViewProjectionMatrix(); }

Target:
public void render(DefaultRenderingProcess.StereoRenderState stereoRenderState) { resetStats(); preRenderUpdate(stereoRenderState); renderShadowMap(); renderWorldReflection(); preRenderSetup(); DefaultRenderingProcess.getInstance().beginRenderSceneOpaque(); renderSky(); try (Activity ignored = PerformanceMonitor.startActivity("Render World")) { renderObjectsOpaque(); renderChunksOpaque(); renderChunksAlphaReject(); renderOverlays(); renderFirstPersonView(); DefaultRenderingProcess.getInstance().endRenderSceneOpaque(); renderLightGeometry(); renderChunksRefractiveReflective(); } postRenderCleanup(); combineRefractiveReflectiveAndOpaquePasses(); renderSimpleBlendMaterialsIntoCombinedPass(); renderFinalPostProcessedScene(stereoRenderState); playerCamera.updatePrevViewProjectionMatrix(); }
Source:
public void testMetadataUpdaterBinary() throws Exception { context.getRouteDefinition("FcrepoSerializationBinaryUpdater").adviceWith(context, new AdviceWithRouteBuilder() { @Override public void configure() throws Exception { replaceFromWith("direct:start"); mockEndpointsAndSkip("*"); } }); context.start(); getMockEndpoint("mock:file:mock:direct:binary_file").expectedMessageCount(1); getMockEndpoint("mock:file:mock:direct:binary_file").expectedHeaderReceived(Exchange.FILE_NAME, "foo"); final String body = IOUtils.toString(ObjectHelper.loadResourceAsStream("binary.rdf"), "UTF-8"); final Map<String, Object> headers = ImmutableMap.of( BASE_URL, baseURL, FCREPO_IDENTIFIER, "foo"); template.sendBodyAndHeaders(body, headers); assertMockEndpointsSatisfied(); }

Target:
public void testMetadataUpdaterBinary() throws Exception { context.getRouteDefinition("FcrepoSerializationBinaryUpdater").adviceWith(context, new AdviceWithRouteBuilder() { @Override public void configure() throws Exception { replaceFromWith("direct:start"); mockEndpointsAndSkip("*"); } }); context.start(); getMockEndpoint("mock:file:binary_file").expectedMessageCount(1); getMockEndpoint("mock:file:binary_file").expectedHeaderReceived(Exchange.FILE_NAME, "foo"); final String body = IOUtils.toString(ObjectHelper.loadResourceAsStream("binary.rdf"), "UTF-8"); final Map<String, Object> headers = ImmutableMap.of( BASE_URL, baseURL, FCREPO_IDENTIFIER, "foo"); template.sendBodyAndHeaders(body, headers); assertMockEndpointsSatisfied(); }
Source:
private static void zipFile(Path rootPath, File file, ZipOutputStream zos) throws IOException { ZipEntry ze = new ZipEntry(rootPath.relativize(file.toPath()).toString()); zos.putNextEntry(ze); try (FileInputStream fis = new FileInputStream(file)) { byte[] buffer = new byte[1024]; int len; while ((len = fis.read(buffer)) > 0) { zos.write(buffer, 0, len); } } zos.closeEntry(); }

Target:
private static void zipFile(Path rootPath, File file, ZipOutputStream zos) throws IOException { ZipEntry ze = new ZipEntry(rootPath.relativize(file.toPath()).toString()); zos.putNextEntry(ze); try (FileInputStream fis = new FileInputStream(file)) { StreamUtils.copy(fis, zos); } zos.closeEntry(); }
Source:
public void execute(DiagnosticContext context) { try { DiagConfig diagConfig = context.getDiagsConfig(); List<RestEntry> entries = new ArrayList(); entries.addAll(context.getElasticRestCalls().values()); runQueries(context.getEsRestClient(), entries, context.getTempDir(), diagConfig.getCallRetries(), diagConfig.getPauseRetries()); } catch (Throwable t) { logger.log(SystemProperties.DIAG, "Error executing REST queries", t); throw new DiagnosticException(String.format("Unrecoverable REST Query Execution error - exiting. %s", Constants.CHECK_LOG)); } }

Target:
public void execute(DiagnosticContext context) { try { DiagConfig diagConfig = context.getDiagsConfig(); List<RestEntry> entries = new ArrayList<>(); entries.addAll(context.getElasticRestCalls().values()); runQueries(context.getEsRestClient(), entries, context.getTempDir(), diagConfig.getCallRetries(), diagConfig.getPauseRetries()); } catch (Throwable t) { logger.log(SystemProperties.DIAG, "Error executing REST queries", t); throw new DiagnosticException(String.format("Unrecoverable REST Query Execution error - exiting. %s", Constants.CHECK_LOG)); } }
Source:
protected StandardIntegrationFlow get() { if (this.integrationFlow == null) { if (this.currentMessageChannel instanceof FixedSubscriberChannelPrototype) { throw new BeanCreationException("The 'currentMessageChannel' (" + this.currentMessageChannel + ") is a prototype for 'FixedSubscriberChannel' which can't be created without 'MessageHandler' " + "constructor argument. That means that '.fixedSubscriberChannel()' can't be the last " + "EIP-method in the 'IntegrationFlow' definition."); } if (this.integrationComponents.size() == 1) { if (this.currentComponent != null) { if (this.currentComponent instanceof SourcePollingChannelAdapterSpec) { throw new BeanCreationException("The 'SourcePollingChannelAdapter' (" + this.currentComponent + ") " + "must be configured with at least one 'MessageChannel' or 'MessageHandler'."); } } else if (this.currentMessageChannel != null) { throw new BeanCreationException("The 'IntegrationFlow' can't consist of only one 'MessageChannel'. " + "Add at lest '.bridge()' EIP-method before the end of flow."); } } if (this.implicitChannel) { Optional<Object> lastComponent = this.integrationComponents.keySet() .stream() .reduce((first, second) -> second); if (lastComponent.get() instanceof WireTapSpec) { enrichHeaders( Collections.singletonMap( MessageHeaders.REPLY_CHANNEL, IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME)); } } this.integrationFlow = new StandardIntegrationFlow(this.integrationComponents); } return this.integrationFlow; }

Target:
protected StandardIntegrationFlow get() { if (this.integrationFlow == null) { if (this.currentMessageChannel instanceof FixedSubscriberChannelPrototype) { throw new BeanCreationException("The 'currentMessageChannel' (" + this.currentMessageChannel + ") is a prototype for 'FixedSubscriberChannel' which can't be created without 'MessageHandler' " + "constructor argument. That means that '.fixedSubscriberChannel()' can't be the last " + "EIP-method in the 'IntegrationFlow' definition."); } if (this.integrationComponents.size() == 1) { if (this.currentComponent != null) { if (this.currentComponent instanceof SourcePollingChannelAdapterSpec) { throw new BeanCreationException("The 'SourcePollingChannelAdapter' (" + this.currentComponent + ") " + "must be configured with at least one 'MessageChannel' or 'MessageHandler'."); } } else if (this.currentMessageChannel != null) { throw new BeanCreationException("The 'IntegrationFlow' can't consist of only one 'MessageChannel'. " + "Add at lest '.bridge()' EIP-method before the end of flow."); } } if (this.implicitChannel) { Optional<Object> lastComponent = this.integrationComponents.keySet() .stream() .reduce((first, second) -> second); if (lastComponent.get() instanceof WireTapSpec) { channel(IntegrationContextUtils.NULL_CHANNEL_BEAN_NAME); } } this.integrationFlow = new StandardIntegrationFlow(this.integrationComponents); } return this.integrationFlow; }
Source:
public static IMEInventoryHandler getCell( final ItemStack o, final ISaveProvider container2 ) { try { return new CellInventoryHandler( new FluidCellInventory( o, container2 ), AEApi.instance().storage().getStorageChannel( IFluidStorageChannel.class ) ); } catch( final AppEngException e ) { return null; } }

Target:
public static IMEInventoryHandler getCell( final ItemStack o, final ISaveProvider container2 ) { try { return new FluidCellInventoryHandler( new FluidCellInventory( o, container2 ) ); } catch( final AppEngException e ) { return null; } }
Source:
public static LigerNavigatorFragment build(String pageName, String pageTitle, String pageArgs, String pageOptions) { LigerNavigatorFragment navigator = new LigerNavigatorFragment(); Bundle bundle = new Bundle(); JSONArray pages = new JSONArray(); if (pageName != null) { bundle.putString("pageName", pageName); } if (pageTitle != null) { bundle.putString("pageTitle", pageTitle); } try { if (pageOptions != null) { bundle.putString("pageOptions", pageOptions); JSONObject jsonPageOptions = new JSONObject(pageOptions); if (jsonPageOptions.has("cached")) { navigator.mCached = jsonPageOptions.getBoolean("cached"); } } if (pageArgs != null) { bundle.putString("pageArgs", pageArgs); JSONObject jsonPageArgs = new JSONObject(pageArgs); if (jsonPageArgs.has("pages")) { pages = jsonPageArgs.getJSONArray("pages"); } else { pages.put(jsonPageArgs); } } for (int i = 0; i < pages.length(); i++) { JSONObject page = pages.getJSONObject(i); PageFragment newPage = LigerFragmentFactory.openPage(page.getString("page"), page.getString("title"), page.optJSONObject("args"), page.optJSONObject("options")); if (newPage != null) { if (navigator.mCached) { navigator.mFragCache.put(page.getString("page"), newPage); } navigator.mFragDeck.addLast(newPage); newPage.mContainer = navigator; } } } catch (JSONException e) { throw new RuntimeException("Invalid app.json!", e); } navigator.setArguments(bundle); return navigator; }

Target:
public static LigerNavigatorFragment build(String pageName, String pageTitle, String pageArgs, String pageOptions) { LigerNavigatorFragment navigator = new LigerNavigatorFragment(); Bundle bundle = new Bundle(); JSONArray pages = new JSONArray(); if (pageName != null) { bundle.putString("pageName", pageName); } if (pageTitle != null) { bundle.putString("pageTitle", pageTitle); } try { if (pageOptions != null) { bundle.putString("pageOptions", pageOptions); JSONObject jsonPageOptions = new JSONObject(pageOptions); if (jsonPageOptions.has("cached")) { navigator.mCached = jsonPageOptions.getBoolean("cached"); } else { navigator.mCached = true; } } if (pageArgs != null) { bundle.putString("pageArgs", pageArgs); JSONObject jsonPageArgs = new JSONObject(pageArgs); if (jsonPageArgs.has("pages")) { pages = jsonPageArgs.getJSONArray("pages"); } else { pages.put(jsonPageArgs); } } for (int i = 0; i < pages.length(); i++) { JSONObject page = pages.getJSONObject(i); PageFragment newPage = LigerFragmentFactory.openPage(page.getString("page"), page.getString("title"), page.optJSONObject("args"), page.optJSONObject("options")); if (newPage != null) { if (navigator.mCached) { navigator.mFragCache.put(page.getString("page"), newPage); } navigator.mFragDeck.addLast(newPage); newPage.mContainer = navigator; } } } catch (JSONException e) { throw new RuntimeException("Invalid app.json!", e); } navigator.setArguments(bundle); return navigator; }
Source:
public void add(final VmNic iface, CompensationContext compensationContext, boolean reserveExistingMac, int osId, Version clusterCompatibilityVersion) { if (reserveExistingMac) { final MacPoolManagerStrategy macPoolManager = getMacPoolManager(iface.getVmId()); final String ifaceMacAddress = iface.getMacAddress(); if (FeatureSupported.hotPlug(clusterCompatibilityVersion) && getOsRepository().hasNicHotplugSupport(osId, clusterCompatibilityVersion)) { macPoolManager.forceAddMac(ifaceMacAddress); } else if (!macPoolManager.addMac(ifaceMacAddress)) { auditLogMacInUse(iface); throw new VdcBLLException(VdcBllErrors.MAC_ADDRESS_IS_IN_USE); } } getVmNicDao().save(iface); getVmNetworkStatisticsDao().save(iface.getStatistics()); compensationContext.snapshotNewEntity(iface); compensationContext.snapshotNewEntity(iface.getStatistics()); }

Target:
public void add(final VmNic iface, CompensationContext compensationContext, boolean reserveExistingMac, int osId, Version clusterCompatibilityVersion) { if (reserveExistingMac) { if (FeatureSupported.hotPlug(clusterCompatibilityVersion) && getOsRepository().hasNicHotplugSupport(osId, clusterCompatibilityVersion)) { macPool.forceAddMac(iface.getMacAddress()); } else if (!macPool.addMac(iface.getMacAddress())) { auditLogMacInUse(iface); throw new VdcBLLException(VdcBllErrors.MAC_ADDRESS_IS_IN_USE); } } getVmNicDao().save(iface); getVmNetworkStatisticsDao().save(iface.getStatistics()); compensationContext.snapshotNewEntity(iface); compensationContext.snapshotNewEntity(iface.getStatistics()); }
Source:
protected void eventHandle(@NonNull ITmfEvent event) { Integer cpu = TmfTraceUtils.resolveIntEventAspectOfClassForEvent(event.getTrace(), TmfCpuAspect.class, event); if (cpu == null) { return; } ITmfStateSystemBuilder ssb = getStateSystemBuilder(); if (ssb == null) { return; } Integer cpuQuark = fCpuNumToQuark.get(cpu); if (cpuQuark == null) { try { String cpuAttributeName = NonNullUtils.nullToEmptyString(cpu); cpuQuark = ssb.getQuarkAbsoluteAndAdd(cpuAttributeName); fCpuNumToQuark.put(cpu, cpuQuark); } catch (StateValueTypeException e) { throw new IllegalStateException(e); } } if (!event.getName().equals(fSchedSwitch)) { return; } try { int nextTid = ((Long) event.getContent().getField(fNextTid).getValue()).intValue(); final TmfStateValue value = TmfStateValue.newValueInt(nextTid); ssb.modifyAttribute(event.getTimestamp().toNanos(), value, cpuQuark); } catch (StateValueTypeException | AttributeNotFoundException e) { Activator.getDefault().logError(NonNullUtils.nullToEmptyString(e.getMessage()), e); } }

Target:
protected void eventHandle(@NonNull ITmfEvent event) { Integer cpu = TmfTraceUtils.resolveIntEventAspectOfClassForEvent(event.getTrace(), TmfCpuAspect.class, event); if (cpu == null) { return; } ITmfStateSystemBuilder ssb = getStateSystemBuilder(); if (ssb == null) { return; } Integer cpuQuark = fCpuNumToQuark.get(cpu); if (cpuQuark == null) { String cpuAttributeName = NonNullUtils.nullToEmptyString(cpu); cpuQuark = ssb.getQuarkAbsoluteAndAdd(cpuAttributeName); fCpuNumToQuark.put(cpu, cpuQuark); } if (!event.getName().equals(fSchedSwitch)) { return; } try { int nextTid = ((Long) event.getContent().getField(fNextTid).getValue()).intValue(); final TmfStateValue value = TmfStateValue.newValueInt(nextTid); ssb.modifyAttribute(event.getTimestamp().toNanos(), value, cpuQuark); } catch (StateValueTypeException | AttributeNotFoundException e) { Activator.getDefault().logError(NonNullUtils.nullToEmptyString(e.getMessage()), e); } }
Source:
public void onStarted(Run build, TaskListener listener) { if (PluginImpl.shouldScan(build) && build.getParent().getProperty(ScannerJobProperty.class) == null) { try { build.getParent().addProperty(new ScannerJobProperty(false)); } catch (IOException e) { logger.log(Level.WARNING, "Failed to add a ScannerJobProperty to " + build.getParent().getFullDisplayName(), e); listener.getLogger().println("WARNING! Failed to add the scanner property to this job."); } } }

Target:
public void onStarted(Run build, TaskListener listener) { if (PluginImpl.shouldScan(build) && build.getParent().getProperty(ScannerJobProperty.class) == null) { try { build.getParent().addProperty(new ScannerJobProperty(false)); } catch (IOException e) { logger.log(Level.WARNING, "Failed to add a ScannerJobProperty to " + build.getParent().getFullDisplayName(), e); listener.getLogger().println("[BFA] WARNING! Failed to add the scanner property to this job."); } } }
Source:
private void postAdd(Change change, List<PatchSetApproval> added) throws OrmException, EmailException { if (added.isEmpty()) { return; } PatchSet patchSet = dbProvider.get().patchSets().get(change.currentPatchSetId()); for (PatchSetApproval psa : added) { Account account = accountCache.get(psa.getAccountId()).getAccount(); hooks.doReviewerAddedHook(change, account, patchSet, dbProvider.get()); } List<Account.Id> toMail = Lists.newArrayListWithCapacity(added.size()); IdentifiedUser idenitifiedUser = (IdentifiedUser)currentUser.get(); for (PatchSetApproval psa : added) { if (!psa.getAccountId().equals(idenitifiedUser.getAccountId())) { toMail.add(psa.getAccountId()); } } if (!toMail.isEmpty()) { try { AddReviewerSender cm = addReviewerSenderFactory.create(change); cm.setFrom(idenitifiedUser.getAccountId()); cm.addReviewers(toMail); cm.send(); } catch (Exception err) { log.error("Cannot send email to new reviewers of change " + change.getId(), err); } } }

Target:
private void postAdd(Change change, List<PatchSetApproval> added) throws OrmException, EmailException { if (added.isEmpty()) { return; } PatchSet patchSet = dbProvider.get().patchSets().get(change.currentPatchSetId()); for (PatchSetApproval psa : added) { Account account = accountCache.get(psa.getAccountId()).getAccount(); hooks.doReviewerAddedHook(change, account, patchSet, dbProvider.get()); } List<Account.Id> toMail = Lists.newArrayListWithCapacity(added.size()); IdentifiedUser identifiedUser = (IdentifiedUser) currentUser.get(); for (PatchSetApproval psa : added) { if (!psa.getAccountId().equals(identifiedUser.getAccountId())) { toMail.add(psa.getAccountId()); } } if (!toMail.isEmpty()) { try { AddReviewerSender cm = addReviewerSenderFactory.create(change); cm.setFrom(identifiedUser.getAccountId()); cm.addReviewers(toMail); cm.send(); } catch (Exception err) { log.error("Cannot send email to new reviewers of change " + change.getId(), err); } } }
Source:
public void checkNotifyElementUpdatedAndListenerUpdated() { canvasHandler.addRegistrationListener(updateListener); final List<Element> updatedElements = new ArrayList<>(); updatedElements.add(mock(Element.class)); canvasHandler.doBatchUpdate(updatedElements); verify(updateListener, times(1)).updateBatch(any()); }

Target:
public void checkNotifyElementUpdatedAndListenerUpdated() { canvasHandler.addRegistrationListener(updateListener); final List<Element> updatedElements = Collections.singletonList(mock(Element.class)); canvasHandler.doBatchUpdate(updatedElements); verify(updateListener, times(1)).updateBatch(any()); }
Source:
public Map<String, String> getJobMessageProperties() { List<storage_domains> storageDomains = getStorageDomainDAO().getAllForStorageDomain(getParameters().getSourceDomainId().getValue()); String sourceSDName = StringUtils.EMPTY; if (storageDomains.size() > 0) { sourceSDName = storageDomains.get(0).getstorage_name(); } if (jobProperties == null) { jobProperties = super.getJobMessageProperties(); jobProperties.put("sourcesd", sourceSDName); jobProperties.put("targetsd", getStorageDomainName()); if (ImageOperation.Move.equals(getParameters().getOperation())) { jobProperties.put("action", "Moving"); } else { jobProperties.put("action", "Copying"); } } return jobProperties; }

Target:
public Map<String, String> getJobMessageProperties() { List<storage_domains> storageDomains = getStorageDomainDAO().getAllForStorageDomain(getParameters().getSourceDomainId().getValue()); String sourceSDName = StringUtils.EMPTY; if (storageDomains.size() > 0) { sourceSDName = storageDomains.get(0).getstorage_name(); } if (jobProperties == null) { jobProperties = super.getJobMessageProperties(); jobProperties.put("sourcesd", sourceSDName); jobProperties.put("targetsd", getStorageDomainName()); if (ImageOperation.Move == getParameters().getOperation()) { jobProperties.put("action", "Moving"); } else { jobProperties.put("action", "Copying"); } } return jobProperties; }
Source:
private String key(final CreateContainerResponse container) throws IOException { final StringWriter writer = new StringWriter(); IOUtil.copy( this.client.copyFileFromContainerCmd( container.getId(), "/root/.ssh/id_rsa" ).exec(), writer ); final String key = writer.toString(); return key.substring(key.indexOf('-'), key.lastIndexOf('-') + 1); }

Target:
private String key(final CreateContainerResponse container) throws IOException { final StringWriter writer = new StringWriter(); IOUtils.copy( this.client.copyFileFromContainerCmd( container.getId(), "/root/.ssh/id_rsa" ).exec(), writer ); final String key = writer.toString(); return key.substring(key.indexOf('-'), key.lastIndexOf('-') + 1); }