auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void configureReflections() { Optional<String> basePackage = Optional.of(ninjaProperties.get(NinjaConstant.APPLICATION_MODULES_BASE_PACKAGE)); if(basePackage.isPresent()) { reflections = new Reflections( basePackage.get() + "." + NinjaConstant.CONTROLLERS_DIR, new MethodAnnotationsScanner()); } else { reflections = new Reflections( NinjaConstant.CONTROLLERS_DIR, new MethodAnnotationsScanner()); } }

Target:
private void configureReflections() { Optional<String> basePackage = Optional.ofNullable(ninjaProperties.get(NinjaConstant.APPLICATION_MODULES_BASE_PACKAGE)); if (basePackage.isPresent()) { reflections = new Reflections( basePackage.get() + "." + NinjaConstant.CONTROLLERS_DIR, new MethodAnnotationsScanner()); } else { reflections = new Reflections( NinjaConstant.CONTROLLERS_DIR, new MethodAnnotationsScanner()); } }
Source:
private static int maxPartition(Collection<StreamEdge> edges) { if (edges.size() == 0) { return StreamEdge.PARTITIONS_UNKNOWN; } return edges.stream().map(StreamEdge::getPartitionCount).reduce(Integer::max).get(); }

Target:
static int maxPartition(Collection<StreamEdge> edges) { return edges.stream().map(StreamEdge::getPartitionCount).reduce(Integer::max).orElse(StreamEdge.PARTITIONS_UNKNOWN); }
Source:
public void testWithParameters() throws IOException { try (Analyzer ws = newHomoglyphStemmer()) { TokenStream ts = ws.tokenStream("", input); BaseTokenStreamTestCase.assertTokenStreamContents(ts, expected); } }

Target:
public void testWithParameters() throws IOException { try (Analyzer ws = newHomoglyphFilter()) { TokenStream ts = ws.tokenStream("", input); BaseTokenStreamTestCase.assertTokenStreamContents(ts, expected); } }
Source:
public static int[] getFileVersionDetails(String filePath) { IntByReference dwDummy = new IntByReference(); dwDummy.setValue(0); int versionlength = Version.INSTANCE.GetFileVersionInfoSize(filePath, dwDummy); if (versionlength == 0) { return null; } byte[] bufferarray = new byte[versionlength]; Pointer lpData = new Memory(bufferarray.length); PointerByReference lplpBuffer = new PointerByReference(); IntByReference puLen = new IntByReference(); if (Version.INSTANCE.GetFileVersionInfo(filePath, 0, versionlength, lpData) && Version.INSTANCE.VerQueryValue(lpData, "\\", lplpBuffer, puLen)) { VS_FIXEDFILEINFO lplpBufStructure = new VS_FIXEDFILEINFO(lplpBuffer.getValue()); lplpBufStructure.read(); int[] v = new int[4]; v[0] = lplpBufStructure.dwFileVersionMS.intValue() >> 16; v[1] = lplpBufStructure.dwFileVersionMS.intValue() & 0xffff; v[2] = lplpBufStructure.dwFileVersionLS.intValue() >> 16; v[3] = lplpBufStructure.dwFileVersionLS.intValue() & 0xffff; return v; } return null; }

Target:
public static int[] getFileVersionDetails(String filePath) { IntByReference dwDummy = new IntByReference(); dwDummy.setValue(0); int versionLength = Version.INSTANCE.GetFileVersionInfoSize(filePath, dwDummy); if (versionLength == 0) { return null; } byte[] bufferarray = new byte[versionLength]; Pointer lpData = new Memory(bufferarray.length); PointerByReference lplpBuffer = new PointerByReference(); IntByReference puLen = new IntByReference(); if (Version.INSTANCE.GetFileVersionInfo(filePath, 0, versionLength, lpData) && Version.INSTANCE.VerQueryValue(lpData, "\\", lplpBuffer, puLen)) { VS_FIXEDFILEINFO lplpBufStructure = new VS_FIXEDFILEINFO(lplpBuffer.getValue()); lplpBufStructure.read(); int[] v = new int[4]; v[0] = lplpBufStructure.dwFileVersionMS.intValue() >> 16; v[1] = lplpBufStructure.dwFileVersionMS.intValue() & 0xffff; v[2] = lplpBufStructure.dwFileVersionLS.intValue() >> 16; v[3] = lplpBufStructure.dwFileVersionLS.intValue() & 0xffff; return v; } return null; }
Source:
public void serialize(Date dateValue, JsonGenerator gen, SerializerProvider serializers) throws IOException { SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"); format.setTimeZone(TimeZone.getTimeZone("UTC")); String dateString = format.format(dateValue); gen.writeString(dateString); }

Target:
public void serialize(Date dateValue, JsonGenerator gen, SerializerProvider serializers) throws IOException { String dateString = dateValue.toInstant().atOffset(ZoneOffset.UTC) .format(DateTimeFormatter.ISO_OFFSET_DATE_TIME); gen.writeString(dateString); }
Source:
public boolean isHealthy(ServiceEndPoint endPoint) { URI adminUrl = Payload.valueOf(endPoint.getPayload()).getAdminUrl(); Response response = _client.target(adminUrl).path("/healthcheck").request().method("HEAD"); int status = response.getStatus(); response.close(); return status == 200; }

Target:
public boolean isHealthy(ServiceEndPoint endPoint) { URI adminUrl = Payload.valueOf(endPoint.getPayload()).getAdminUrl(); Response response = _client.target(adminUrl).path("/healthcheck").request().method("HEAD"); int status = response.getStatus(); response.close(); return status == Response.Status.OK.getStatusCode(); }
Source:
protected void resetAlignment() { markAlignmentEnd(0); latestAlignmentDurationNanos = new CompletableFuture<>(); }

Target:
private void resetAlignment() { markAlignmentEnd(0); latestAlignmentDurationNanos = new CompletableFuture<>(); latestBytesProcessedDuringAlignment = new CompletableFuture<>(); }
Source:
private int nameScore(String a, String b) { int aDirLen = a.lastIndexOf("/") + 1; int bDirLen = b.lastIndexOf("/") + 1; int dirMin = Math.min(aDirLen, bDirLen); int dirMax = Math.max(aDirLen, bDirLen); final int dirScoreLtr; final int dirScoreRtl; if (dirMax == 0) { dirScoreLtr = 100; dirScoreRtl = 100; } else { int dirSim = 0; for (; dirSim < dirMin; dirSim++) { if (a.charAt(dirSim) != b.charAt(dirSim)) break; } dirScoreLtr = (dirSim * 100) / dirMax; for (dirSim = 0; dirSim < dirMin; dirSim++) { if (a.charAt(aDirLen - 1 - dirSim) != b.charAt(bDirLen - 1 - dirSim)) break; } dirScoreRtl = (dirSim * 100) / dirMax; } int fileMin = Math.min(a.length() - aDirLen, b.length() - bDirLen); int fileMax = Math.max(a.length() - aDirLen, b.length() - bDirLen); int fileSim = 0; for (; fileSim < fileMin; fileSim++) { if (a.charAt(a.length() - 1 - fileSim) != b.charAt(b.length() - 1 - fileSim)) break; } int fileScore = (fileSim * 100) / fileMax; int nameScore = (((dirScoreLtr + dirScoreRtl) * 25) + (fileScore * 50)) / 100; return nameScore; }

Target:
private int nameScore(String a, String b) { int aDirLen = a.lastIndexOf("/") + 1; int bDirLen = b.lastIndexOf("/") + 1; int dirMin = Math.min(aDirLen, bDirLen); int dirMax = Math.max(aDirLen, bDirLen); final int dirScoreLtr; final int dirScoreRtl; if (dirMax == 0) { dirScoreLtr = 100; dirScoreRtl = 100; } else { int dirSim = 0; for (; dirSim < dirMin; dirSim++) { if (a.charAt(dirSim) != b.charAt(dirSim)) break; } dirScoreLtr = (dirSim * 100) / dirMax; if (dirScoreLtr == 100) { dirScoreRtl = 100; } else { for (dirSim = 0; dirSim < dirMin; dirSim++) { if (a.charAt(aDirLen - 1 - dirSim) != b.charAt(bDirLen - 1 - dirSim)) break; } dirScoreRtl = (dirSim * 100) / dirMax; } } int fileMin = Math.min(a.length() - aDirLen, b.length() - bDirLen); int fileMax = Math.max(a.length() - aDirLen, b.length() - bDirLen); int fileSim = 0; for (; fileSim < fileMin; fileSim++) { if (a.charAt(a.length() - 1 - fileSim) != b.charAt(b.length() - 1 - fileSim)) break; } int fileScore = (fileSim * 100) / fileMax; return (((dirScoreLtr + dirScoreRtl) * 25) + (fileScore * 50)) / 100; }
Source:
void deleteBucket(final String rawPath, final MantaHttpHeaders requestHeaders) throws IOException { Validate.notBlank(rawPath, "rawPath must not be blank"); final String path = formatPath(rawPath); LOG.debug("DELETE bucket", path); try { httpHelper.httpDelete(path, requestHeaders); } catch (MantaClientHttpResponseException e) { if (e.getServerCode().equals(MantaErrorCode.BUCKET_NOT_FOUND_ERROR) || e.getServerCode().equals(MantaErrorCode.BUCKET_NOT_EMPTY_ERROR)) { final MantaIOException mioe = new MantaIOException("Unable to delete bucket", e); mioe.setContextValue("bucket", path); throw mioe; } } catch (ConnectionPoolTimeoutException e) { final MantaClientException clientException = new MantaClientException( "Connection pool timeout while deleting bucket" + e.getMessage()); clientException.setContextValue("path", path); throw clientException; } catch (IOException e) { throw new IOException(e); } LOG.debug("Finished deleting bucket {}.", path); }

Target:
void deleteBucket(final String rawPath, final MantaHttpHeaders requestHeaders) throws IOException { Validate.notBlank(rawPath, "rawPath must not be blank"); final String path = formatPath(rawPath); LOG.debug("DELETE bucket", path); try { httpHelper.httpDelete(path, requestHeaders); } catch (MantaClientHttpResponseException e) { if (e.getServerCode().equals(MantaErrorCode.BUCKET_NOT_FOUND_ERROR) || e.getServerCode().equals(MantaErrorCode.BUCKET_NOT_EMPTY_ERROR)) { final MantaIOException mioe = new MantaIOException("Unable to delete bucket", e); mioe.setContextValue("bucket", path); throw mioe; } } catch (ConnectionPoolTimeoutException e) { final MantaClientException clientException = new MantaClientException( "Connection pool timeout while deleting bucket" + e.getMessage()); clientException.setContextValue("path", path); throw clientException; } LOG.debug("DELETE [bucket]", path); }
Source:
public void apply(OnlineCommandContext ctx) throws Exception { Operations ops = new Operations(ctx.client); Address address = Address.subsystem("resource-adapters").and("resource-adapter", resourceAdapterId) .and("admin-objects", poolName); ops.add(address, Values.of("class-name", className) .and("jndi-name", localJndiName).and("use-java-context", useJavaContext)); if (properties.size() > 0) { Iterator it = properties.entrySet().iterator(); while (it.hasNext()) { Map.Entry pair = (Map.Entry) it.next(); Address configPropsAddress = Address.subsystem("resource-adapters") .and("resource-adapter", resourceAdapterId) .and("admin-objects", poolName).and("config-properties", (String) pair.getKey()); ops.add(configPropsAddress, Values.of("value", (String) pair.getValue())); } } }

Target:
public void apply(OnlineCommandContext ctx) throws Exception { Batch batch = new Batch(); Address address = Address.subsystem("resource-adapters").and("resource-adapter", resourceAdapterId) .and("admin-objects", poolName); batch.add(address, Values.of("class-name", className) .and("jndi-name", localJndiName).and("use-java-context", useJavaContext)); for (Map.Entry<String, String> pair : properties.entrySet()) { Address configPropsAddress = Address.subsystem("resource-adapters") .and("resource-adapter", resourceAdapterId) .and("admin-objects", poolName).and("config-properties", pair.getKey()); batch.add(configPropsAddress, Values.of("value", pair.getValue())); } new Operations(ctx.client).batch(batch); }
Source:
public long tryLockBlock(long sessionId, long blockId, BlockLockType blockLockType, long time, TimeUnit unit) { ClientRWLock blockLock = getBlockLock(blockId); Lock lock = blockLockType == BlockLockType.READ ? blockLock.readLock() : blockLock.writeLock(); if (blockLockType == BlockLockType.WRITE && sessionHoldsLock(sessionId, blockId)) { throw new IllegalStateException(String .format("Session %s attempted to take a write lock on block %s, but the session already" + " holds a lock on the block", sessionId, blockId)); } try { if (!lock.tryLock(time, unit)) { LOG.warn("Failed to acquire lock for block after {}. " + "session: {}, blockLockType: {}, lock reference count = {}", blockId, time, unit, sessionId, blockLockType, blockLock.getReferenceCount()); return INVALID_LOCK_ID; } } catch (InterruptedException e) { Thread.currentThread().interrupt(); } try { return allocateLockId(sessionId, blockId, lock); } catch (Throwable e) { unlock(lock, blockId); throw e; } }

Target:
public long tryLockBlock(long sessionId, long blockId, BlockLockType blockLockType, long time, TimeUnit unit) { return lockBlockInternal(sessionId, blockId, blockLockType, false, time, unit); }
Source:
private void assertDispatchForCommand(ReplicableCommand command, boolean expected) throws Exception { log.debugf("Testing " + command.getClass().getCanonicalName()); commandsFactory.initializeReplicableCommand(command, true); executorService.reset(); CountDownLatchResponse response = new CountDownLatchResponse(); invocationHandler.handleFromCluster(address, command, response, DeliverOrder.NONE); transport.receiveRequest(address, command, Request.NO_REQUEST_ID, DeliverOrder.NONE); response.await(30, TimeUnit.SECONDS); Assert.assertEquals(executorService.hasExecutedCommand, expected, "Command " + command.getClass() + " dispatched wrongly."); executorService.reset(); response = new CountDownLatchResponse(); invocationHandler.handleFromCluster(address, command, response, DeliverOrder.PER_SENDER); response.await(30, TimeUnit.SECONDS); Assert.assertFalse(executorService.hasExecutedCommand, "Command " + command.getClass() + " dispatched wrongly."); }

Target:
private void assertDispatchForCommand(ReplicableCommand command, boolean expected) throws Exception { log.debugf("Testing " + command.getClass().getCanonicalName()); commandsFactory.initializeReplicableCommand(command, true); executorService.reset(); CountDownLatchResponse response = new CountDownLatchResponse(); invocationHandler.handleFromCluster(address, command, response, DeliverOrder.NONE); response.await(30, TimeUnit.SECONDS); Assert.assertEquals(executorService.hasExecutedCommand, expected, "Command " + command.getClass() + " dispatched wrongly."); executorService.reset(); response = new CountDownLatchResponse(); invocationHandler.handleFromCluster(address, command, response, DeliverOrder.PER_SENDER); response.await(30, TimeUnit.SECONDS); Assert.assertFalse(executorService.hasExecutedCommand, "Command " + command.getClass() + " dispatched wrongly."); }
Source:
public BoundingBox getBoundingBox() { if (getPathPartList().size() < 1) { if (!parse(getAttributes())) { return new BoundingBox(0, 0, 0, 0); } } return getPathPartList().getBoundingBox(); }

Target:
public BoundingBox getBoundingBox() { if (getPathPartList().size() < 1) { return new BoundingBox(0, 0, 0, 0); } return getPathPartList().getBoundingBox(); }
Source:
public void testSqlPathCreation() { ImmutableList.Builder<SqlPathElement> correctValues = ImmutableList.builder(); correctValues.add(new SqlPathElement("normal", "schema")); correctValues.add(new SqlPathElement("\"who.uses.periods\"", "\"in.schema.names\"")); correctValues.add(new SqlPathElement("\"same,deal\"", "\"with,commas\"")); correctValues.add(new SqlPathElement("a\"\"terrible", "\"thing!@#$%^&*()\"")); List<SqlPathElement> correctList = correctValues.build(); SqlPath path = new SqlPath("normal.schema," + "\"who.uses.periods\".\"in.schema.names\"," + "\"same,deal\".\"with,commas\"," + "a\"\"terrible.\"thing!@#$%^&*()\""); List<SqlPathElement> testList = path.getParsedPath(); assertEquals(correctList, testList); }

Target:
public void testSqlPathCreation() { ImmutableList.Builder<SqlPathElement> correctValues = ImmutableList.builder(); correctValues.add(new SqlPathElement( Optional.of(new Identifier("normal")), new Identifier("schema"))); correctValues.add(new SqlPathElement( Optional.of(new Identifier("who.uses.periods")), new Identifier("in.schema.names"))); correctValues.add(new SqlPathElement( Optional.of(new Identifier("same,deal")), new Identifier("with,commas"))); correctValues.add(new SqlPathElement( Optional.of(new Identifier("aterrible")), new Identifier("thing!@#$%^&*()"))); List<SqlPathElement> expected = correctValues.build(); SqlPath path = new SqlPath(Optional.of("normal.schema," + "\"who.uses.periods\".\"in.schema.names\"," + "\"same,deal\".\"with,commas\"," + "aterrible.\"thing!@#$%^&*()\"")); assertEquals(path.getParsedPath(), expected); assertEquals(path.toString(), Joiner.on(", ").join(expected)); }
Source:
public void copyVhdImageIfNecessary(AuthenticatedContext ac, CloudStack stack, Image image, String region, AzureClient client) { CloudContext cloudContext = ac.getCloudContext(); String resourceGroupName = azureResourceGroupMetadataProvider.getResourceGroupName(cloudContext, stack); String imageStorageName = armStorage.getImageStorageName(new AzureCredentialView(ac.getCloudCredential()), cloudContext, stack); String imageResourceGroupName = azureResourceGroupMetadataProvider.getImageResourceGroupName(cloudContext, stack); createResourceGroupIfNotExists(client, resourceGroupName, region, stack); createResourceGroupIfNotExists(client, imageResourceGroupName, region, stack); azureStorageAccountService.createStorageAccount(ac, client, imageResourceGroupName, imageStorageName, region, stack); if (!storageContainsImage(client, imageResourceGroupName, imageStorageName, image.getImageName())) { try { LOGGER.info("Starting to copy image: {}, into storage account: {}", image.getImageName(), imageStorageName); client.copyImageBlobInStorageContainer(imageResourceGroupName, imageStorageName, IMAGES_CONTAINER, image.getImageName()); } catch (CloudConnectorException e) { LOGGER.warn("Something happened during start image copy.", e); } } }

Target:
public void copyVhdImageIfNecessary(AuthenticatedContext ac, CloudStack stack, Image image, String region, AzureClient client) { CloudContext cloudContext = ac.getCloudContext(); String resourceGroupName = azureResourceGroupMetadataProvider.getResourceGroupName(cloudContext, stack); String imageStorageName = armStorage.getImageStorageName(new AzureCredentialView(ac.getCloudCredential()), cloudContext, stack); String imageResourceGroupName = azureResourceGroupMetadataProvider.getImageResourceGroupName(cloudContext, stack); createResourceGroupIfNotExists(client, resourceGroupName, region, stack); createResourceGroupIfNotExists(client, imageResourceGroupName, region, stack); azureStorageAccountService.createStorageAccount(ac, client, imageResourceGroupName, imageStorageName, region, stack); azureStorageAccountService.createContainerInStorage(client, imageResourceGroupName, imageStorageName); if (!storageContainsImage(client, imageResourceGroupName, imageStorageName, image.getImageName())) { try { LOGGER.info("Starting to copy image: {}, into storage account: {}", image.getImageName(), imageStorageName); client.copyImageBlobInStorageContainer(imageResourceGroupName, imageStorageName, IMAGES_CONTAINER, image.getImageName()); } catch (CloudConnectorException e) { LOGGER.warn("Something happened during start image copy.", e); } } else { LOGGER.info("The image is already exists in the storage account."); } }
Source:
public static Pipeline getFromProtobuf(HddsProtos.Pipeline pipeline) throws UnknownPipelineStateException { Preconditions.checkNotNull(pipeline, "Pipeline is null"); return new Builder().setId(PipelineID.getFromProtobuf(pipeline.getId())) .setFactor(pipeline.getFactor()) .setType(pipeline.getType()) .setState(PipelineState.fromProtobuf(pipeline.getState())) .setLeaderId(StringUtils.isNotEmpty(pipeline.getLeaderID()) ? RaftPeerId.valueOf(pipeline.getLeaderID()) : null) .setNodes(pipeline.getMembersList().stream() .map(DatanodeDetails::getFromProtoBuf).collect(Collectors.toList())) .setNodesInOrder(pipeline.getMemberOrdersList()) .build(); }

Target:
public static Pipeline getFromProtobuf(HddsProtos.Pipeline pipeline) throws UnknownPipelineStateException { Preconditions.checkNotNull(pipeline, "Pipeline is null"); return new Builder().setId(PipelineID.getFromProtobuf(pipeline.getId())) .setFactor(pipeline.getFactor()) .setType(pipeline.getType()) .setState(PipelineState.fromProtobuf(pipeline.getState())) .setLeaderId(pipeline.getLeaderID()) .setNodes(pipeline.getMembersList().stream() .map(DatanodeDetails::getFromProtoBuf).collect(Collectors.toList())) .setNodesInOrder(pipeline.getMemberOrdersList()) .build(); }
Source:
public void testStitchPointsHashCode() { StitchPoint stitchPoint1 = new DSTStitchPoint(1, 2); StitchPoint stitchPoint2 = new DSTStitchPoint(0, 0); stitchPoint2.setJump(true); StitchPoint stitchPoint3 = new DSTStitchPoint(0, 0); stitchPoint1.setColorChange(true); StitchPoint stitchPoint4 = new DSTStitchPoint(2, 1); StitchPoint stitchPoint5 = stitchPoint1; assertNotEquals(stitchPoint1.hashCode(), stitchPoint2.hashCode()); assertNotEquals(stitchPoint1.hashCode(), stitchPoint3.hashCode()); assertNotEquals(stitchPoint1.hashCode(), stitchPoint4.hashCode()); assertEquals(stitchPoint1.hashCode(), stitchPoint5.hashCode()); }

Target:
public void testStitchPointsHashCode() { StitchPoint stitchPoint1 = new DSTStitchPoint(1, 2); StitchPoint stitchPoint2 = new DSTStitchPoint(0, 0); stitchPoint2.setJump(true); StitchPoint stitchPoint3 = new DSTStitchPoint(0, 0); stitchPoint3.setColorChange(true); StitchPoint stitchPoint4 = new DSTStitchPoint(2, 1); StitchPoint stitchPoint5 = new DSTStitchPoint(1, 2); assertNotEquals(stitchPoint1.hashCode(), stitchPoint2.hashCode()); assertNotEquals(stitchPoint1.hashCode(), stitchPoint3.hashCode()); assertNotEquals(stitchPoint1.hashCode(), stitchPoint4.hashCode()); assertEquals(stitchPoint1.hashCode(), stitchPoint5.hashCode()); }
Source:
public void whenSchedulerRestartedThenTimerIsFired() throws Exception { countDownListener.configure(PROCESS_ID, 1); long processInstanceId = processService.startProcess(unit.getIdentifier(), PROCESS_ID); assertNotNull(processInstanceId); pauseScheduler(); CountDownLatch latch = new CountDownLatch(1); latch.await(20, TimeUnit.SECONDS); restartScheduler(); countDownListener.getCountDown().await(); assertTrue(countDownListener.getExecutingThread().startsWith("SpringBootScheduler")); ProcessInstance pi = processService.getProcessInstance(processInstanceId); assertNull(pi); }

Target:
public void whenSchedulerRestartedThenTimerIsFired() throws Exception { long processInstanceId = processService.startProcess(unit.getIdentifier(), PROCESS_ID); assertNotNull(processInstanceId); pauseScheduler(); awaitWithoutInterruption(); restartScheduler(); countDownListener.getCountDown().await(); assertTrue(countDownListener.getExecutingThread().startsWith("SpringBootScheduler")); ProcessInstance pi = processService.getProcessInstance(processInstanceId); assertNull(pi); }
Source:
public void deleteServiceTypes(String Uuid) { RestApi restApi = RestServiceBuilder.createService(RestApi.class); Call<Services> call = restApi.deleteServiceTypes(Uuid, true); call.enqueue(new Callback<Services>() { @Override public void onResponse(Call<Services> call, Response<Services> response) { if (response.isSuccessful()) { mFormAddEditServiceView.endActivity(); } } @Override public void onFailure(Call<Services> call, Throwable t) { Log.e("jvk", "vkvkjkj"); } }); }

Target:
public void deleteServiceTypes(String Uuid) { RestApi restApi = RestServiceBuilder.createService(RestApi.class); Call<Services> call = restApi.deleteServiceTypes(Uuid, true); call.enqueue(new Callback<Services>() { @Override public void onResponse(Call<Services> call, Response<Services> response) { if (response.isSuccessful()) { mFormAddEditServiceView.endActivity(); } } @Override public void onFailure(Call<Services> call, Throwable t) { } }); }
Source:
private synchronized void fetchLatestTopology() { LOG.log(Level.INFO, "Fetching topology from state manager: {0}", topologyName); this.topology = stateManagerAdaptor.getTopology(topologyName); if (topology == null) { throw new RuntimeException("Failed to fetch topology from the State Manager"); } }

Target:
private synchronized void fetchLatestTopology() { LOG.log(Level.INFO, "Fetching topology from state manager: {0}", topologyName); this.topology = stateManagerAdaptor.getPhysicalPlan(topologyName).getTopology(); if (topology == null) { throw new InvalidStateException(topologyName, "Failed to fetch topology info"); } }
Source:
public Runtime getServerRuntime(String name) { List<Runtime> resultRuntimes = getServerRuntimes() .stream() .filter((runtime) -> runtime.getName().equals(name)) .collect(Collectors.toList()); if (resultRuntimes.size() > 1) { throw new IllegalStateException("There are more than one runtime fulfilling conditions. Result is ambiguous."); } return resultRuntimes.isEmpty() ? null : resultRuntimes.get(0); }

Target:
public Runtime getServerRuntime(String name) { List<Runtime> resultRuntimes = getServerRuntimes() .stream() .filter((runtime) -> runtime.getName().equals(name)) .collect(Collectors.toList()); if (resultRuntimes.size() > 1) { throw new EclipseLayerException("There are more than one runtime fulfilling conditions. Result is ambiguous."); } return resultRuntimes.isEmpty() ? null : resultRuntimes.get(0); }
Source:
private LocalDBEntry getLocalDBEntry(final FileUploadResult fileUploadResult, final LocalDB localDB) throws Exception { if (localDB == null || localDB.getLocalDb().isEmpty()) return null; List<LocalDBEntry> localDBEntries = localDB.getLocalDb().stream().filter(localDBEntry -> (localDBEntry.getFileUploadResult().getFileName().toFile().getName().toLowerCase().equals(fileUploadResult.getFileName().toFile().getName().toLowerCase()))) .filter(localDBEntry -> (localDBEntry.getFileUploadResult().getLastModifiedTime().equals(fileUploadResult.getLastModifiedTime()))) .filter(localDBEntry -> (localDBEntry.getFileUploadResult().getCompression().equals(fileUploadResult.getCompression()))) .collect(Collectors.toList()); if (localDBEntries == null || localDBEntries.isEmpty()) return null; if (localDBEntries.size() == 1) { if (logger.isDebugEnabled()) logger.debug("Local entry found: {}", localDBEntries.get(0)); return localDBEntries.get(0); } throw new Exception("Unexpected behavior: More than one entry found in local database for the same file. FileUploadResult: " + fileUploadResult); }

Target:
private LocalDBEntry getLocalDBEntry(final FileUploadResult fileUploadResult, final LocalDB localDB) throws Exception { if (localDB == null || localDB.getLocalDBEntries() == null || localDB.getLocalDBEntries().isEmpty()) return null; List<LocalDBEntry> localDBEntries = localDB.getLocalDBEntries().stream().filter(localDBEntry -> (localDBEntry.getFileUploadResult().getFileName().toFile().getName().toLowerCase(). equals(fileUploadResult.getFileName().toFile().getName().toLowerCase()))) .filter(localDBEntry -> (localDBEntry.getFileUploadResult().getLastModifiedTime(). equals(fileUploadResult.getLastModifiedTime()))) .filter(localDBEntry -> (localDBEntry.getFileUploadResult().getCompression(). equals(fileUploadResult.getCompression()))) .collect(Collectors.toList()); if (localDBEntries.isEmpty()) return null; if (localDBEntries.size() == 1) { if (logger.isDebugEnabled()) logger.debug("Local entry found: {}", localDBEntries.get(0)); return localDBEntries.get(0); } throw new Exception("Unexpected behavior: More than one entry found in local database for the same file. FileUploadResult: " + fileUploadResult); }
Source:
private void commandLineReport(String reportName, String command) { System.err.println(reportName + ":"); Runtime rt = Runtime.getRuntime(); Writer logOutput = null; try { java.lang.Process p = Runtime.getRuntime().exec(command); if (mRequestBugreport) { logOutput = new BufferedWriter(new FileWriter(new File(Environment .getLegacyExternalStorageDirectory(), reportName), true)); } InputStream inStream = p.getInputStream(); InputStreamReader inReader = new InputStreamReader(inStream); BufferedReader inBuffer = new BufferedReader(inReader); String s; while ((s = inBuffer.readLine()) != null) { if (mRequestBugreport && logOutput != null) { try { logOutput.write(s); logOutput.write("\n"); } catch (IOException e) { while(inBuffer.readLine() != null) System.err.println(e.toString()); break; } } else { System.err.println(s); } } int status = p.waitFor(); System.err.println(" if (logOutput != null) { logOutput.close(); } } catch (Exception e) { System.err.println(" System.err.println(e.toString()); } }

Target:
private void commandLineReport(String reportName, String command) { System.err.println(reportName + ":"); Runtime rt = Runtime.getRuntime(); Writer logOutput = null; try { java.lang.Process p = Runtime.getRuntime().exec(command); if (mRequestBugreport) { logOutput = new BufferedWriter(new FileWriter(new File(Environment .getLegacyExternalStorageDirectory(), reportName), true)); } InputStream inStream = p.getInputStream(); InputStreamReader inReader = new InputStreamReader(inStream); BufferedReader inBuffer = new BufferedReader(inReader); String s; while ((s = inBuffer.readLine()) != null) { if (mRequestBugreport) { try { logOutput.write(s); logOutput.write("\n"); } catch (IOException e) { while(inBuffer.readLine() != null) System.err.println(e.toString()); break; } } else { System.err.println(s); } } int status = p.waitFor(); System.err.println(" if (logOutput != null) { logOutput.close(); } } catch (Exception e) { System.err.println(" System.err.println(e.toString()); } }
Source:
private boolean setBlockOnFire(GlowPlayer player, GlowBlock clicked, BlockFace face, ItemStack holding, Vector clickedLoc) { GlowBlock fireBlock = clicked.getRelative(face); if (fireBlock.getType() != Material.AIR) { return true; } if (clicked.getType() != Material.LEAVES && fireBlock.getRelative(BlockFace.DOWN).getType() == Material.AIR) { return false; } BlockIgniteEvent event = EventFactory.callEvent(new BlockIgniteEvent(fireBlock, BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL, player, null)); if (event.isCancelled()) { player.setItemInHand(holding); return false; } ItemTable.instance().getBlock(Material.FIRE).rightClickBlock(player, clicked, face, holding.clone(), clickedLoc); return true; }

Target:
private boolean setBlockOnFire(GlowPlayer player, GlowBlock clicked, BlockFace face, ItemStack holding, Vector clickedLoc) { GlowBlock fireBlock = clicked.getRelative(face); if (fireBlock.getType() != Material.AIR) { return true; } if (!clicked.getType().isBurnable() && fireBlock.getRelative(BlockFace.DOWN).getType() == Material.AIR) { return false; } BlockIgniteEvent event = EventFactory.callEvent(new BlockIgniteEvent(fireBlock, BlockIgniteEvent.IgniteCause.FLINT_AND_STEEL, player, null)); if (event.isCancelled()) { player.setItemInHand(holding); return false; } ItemTable.instance().getBlock(Material.FIRE).rightClickBlock(player, clicked, face, holding.clone(), clickedLoc); return true; }
Source:
public void clickWikiArticlecard() { wikiArticleCard.click(); }

Target:
public ArticlePageObject clickWikiArticlecard() { wait.forElementClickable(wikiArticleCard); wikiArticleCard.click(); return new ArticlePageObject(); }
Source:
public void testFindLiveVersionContentlet() throws Exception{ Structure testStructure = APILocator.getStructureAPI().findByVarName("webPageContent", user); Contentlet cont=new Contentlet(); cont.setStructureInode(testStructure.getInode()); cont.setStringProperty("title", "Testing Working"); cont.setStringProperty("body", "TESTING"); cont.setStringProperty("contentHost", host.getIdentifier()); cont.setReviewInterval( "1m" ); cont.setStructureInode( testStructure.getInode() ); cont.setHost( host.getIdentifier() ); cont = APILocator.getContentletAPI().checkin(cont, user, false); Versionable verAPI = APILocator.getVersionableAPI().findLiveVersion(cont.getIdentifier(), user, false); }

Target:
public void testFindLiveVersionContentlet() throws Exception{ Structure structure = new StructureDataGen().nextPersisted(); Contentlet contentlet = new ContentletDataGen(structure.getInode()).nextPersisted(); Versionable verAPI = APILocator.getVersionableAPI().findLiveVersion(contentlet.getIdentifier(), user, false); }
Source:
public Set<Location> getAllowedLocations() { Set<Location> allowedLocations = new HashSet<Location>(); allowedLocations.addAll(Arrays.asList(Location.CONSTRUCTOR, Location.METHOD, Location.FIELD, Location.OVERVIEW, Location.PACKAGE, Location.TYPE)); return allowedLocations; }

Target:
public Set<Location> getAllowedLocations() { return new HashSet<Location>(asList(CONSTRUCTOR, METHOD, FIELD, OVERVIEW, PACKAGE, TYPE)); }
Source:
public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || this.getClass() != o.getClass()) { return false; } final GraphMLVertexStatus that = (GraphMLVertexStatus) o; return com.google.common.base.Objects.equal(this.getSeverity(), that.getSeverity()) && com.google.common.base.Objects.equal(this.getAlarmCount(), that.getAlarmCount()) && com.google.common.base.Objects.equal(this.getStyleProperties(), that.getStyleProperties()); }

Target:
public boolean equals(final Object o) { if (this == o) { return true; } if (!(o instanceof GraphMLVertexStatus)) { return false; } final GraphMLVertexStatus that = (GraphMLVertexStatus) o; return com.google.common.base.Objects.equal(this.getSeverity(), that.getSeverity()) && com.google.common.base.Objects.equal(this.getAlarmCount(), that.getAlarmCount()) && com.google.common.base.Objects.equal(this.getStyleProperties(), that.getStyleProperties()); }
Source:
public void getJetpackSettings(long siteId, Listener listener, ErrorListener errorListener) { String path = String.format(Locale.US, "jetpack-blogs/%d", siteId); Map<String, String> params = new HashMap<>(); get(path, params, null, listener, errorListener); }

Target:
public void getJetpackSettings(long siteId, Listener listener, ErrorListener errorListener) { String path = String.format(Locale.US, "jetpack-blogs/%d", siteId); get(path, listener, errorListener); }
Source:
public boolean hasDiagnosis(Encounter encounter, Diagnosis diagnosis) { for (Diagnosis diagnosisFound : encounter.getDiagnoses()) { if (diagnosis == diagnosisFound) { return true; } } return false; }

Target:
public boolean hasDiagnosis(Encounter encounter, Diagnosis diagnosis) { for (Diagnosis diagnosisFound : encounter.getDiagnoses()) { if (diagnosis.equals(diagnosisFound) && !diagnosisFound.getVoided()) { return true; } } return false; }
Source:
public void addCreatorData(Map<String, Object> comment) { Map<String, Object> creator = (Map<String, Object>) comment.remove(CREATOR_KEY); String nedId = creator.get("userId").toString(); IndividualComposite individual; try { individual = userApi.requestObject("individuals/" + nedId, IndividualComposite.class); } catch (IOException e) { throw new RuntimeException(e); } Individualprofile profile = individual.getIndividualprofiles().get(0); comment.put(CREATOR_KEY, profile); }

Target:
private void addCreatorData(Map<String, Object> comment) { Map<String, Object> creator = (Map<String, Object>) comment.remove(CREATOR_KEY); String nedId = creator.get("userId").toString(); IndividualComposite individual; try { individual = userApi.requestObject("individuals/" + nedId, IndividualComposite.class); } catch (IOException e) { throw new RuntimeException(e); } comment.put(CREATOR_KEY, getAmbraProfile(individual)); }
Source:
public void update() { Stock updatedStock = (Stock) subject.getUpdate(); if (market.getStockForSymbol(updatedStock.getSymbol()) == null) { return; } if (history.containsKey(updatedStock.getSymbol())) { List<Double> priceList = history.get(updatedStock.getSymbol()); priceList.add(updatedStock.getPrice()); history.put(updatedStock.getSymbol(), priceList); } else { List<Double> priceList = new ArrayList<Double>(); priceList.add(updatedStock.getPrice()); history.put(updatedStock.getSymbol(), priceList); } }

Target:
public void update() { Stock updatedStock = (Stock) priceSetterSubject.getUpdate(); if (market.getStockForSymbol(updatedStock.getSymbol()) == null) { return; } if (history.containsKey(updatedStock.getSymbol())) { List<Double> priceList = history.get(updatedStock.getSymbol()); priceList.add(updatedStock.getPrice()); history.put(updatedStock.getSymbol(), priceList); } else { List<Double> priceList = new ArrayList<Double>(); priceList.add(updatedStock.getPrice()); history.put(updatedStock.getSymbol(), priceList); } }
Source:
public int getGlobalTargetTaskThreadPoolSize() { ClusterConfig clusterConfig = _accessor.getProperty(_accessor.keyBuilder().clusterConfig()); if (clusterConfig == null) { throw new IllegalStateException("Failed to find ClusterConfig!"); } return clusterConfig.getGlobalTargetTaskThreadPoolSize(); }

Target:
public int getGlobalTargetTaskThreadPoolSize() { ClusterConfig clusterConfig = getClusterConfig(); return clusterConfig.getGlobalTargetTaskThreadPoolSize(); }
Source:
private void checkAgentIsAcceptingDeployments() throws InterruptedException, IOException { int tries = 0; boolean acceptingDeployments; do { TemporaryFolder folder = new TemporaryFolder(); File dummyFile = folder.newFile("dummy.zip"); AgentClient agentClient = new AgentClient(new SystemStreamLog(), "http://localhost:9999/"); try { log.info("Checking if agent is accepting deployments..."); agentClient.deployApplication("dummy", dummyFile); acceptingDeployments = true; } catch (Exception e) { log.info("Agent is not accepting deployments yet. Trying again..."); log.error("Cause: " + e.getLocalizedMessage()); Thread.sleep(TEN_SECONDS); acceptingDeployments = false; tries++; } if (tries == 30) { fail("Could not have agent accepting deployments"); } } while (!acceptingDeployments); log.info("Agent is accepting deployments."); }

Target:
private void checkAgentIsAcceptingDeployments() throws InterruptedException, IOException { int tries = 0; boolean acceptingDeployments; TemporaryFolder folder = new TemporaryFolder(); File dummyFile = folder.newFile("dummy.zip"); AgentClient agentClient = new AgentClient(new SystemStreamLog(), "http://localhost:9999/"); do { try { log.info("Checking if agent is accepting deployments..."); agentClient.deployApplication("dummy", dummyFile); acceptingDeployments = true; } catch (Exception e) { log.info("Agent is not accepting deployments yet. Trying again..."); log.error("Cause: " + e.getLocalizedMessage()); Thread.sleep(TEN_SECONDS); acceptingDeployments = false; tries++; } if (tries == ATTEMPTS) { fail("Could not have agent accepting deployments"); } } while (!acceptingDeployments); log.info("Agent is accepting deployments."); }
Source:
public int hashCode() { int hash = 7; hash = 11 * hash + (this.principal != null ? this.principal.hashCode() : 0); return hash; }

Target:
public int hashCode() { return this.principal.hashCode(); }
Source:
@Override protected AbstractBinder getAuthBinder() { final Set<Class<? extends PrincipalImpl>> principalClassSet = new HashSet<>(); principalClassSet.add(JsonPrincipal.class); principalClassSet.add(NullPrincipal.class); return new PolymorphicAuthValueFactoryProvider.Binder<PrincipalImpl>(principalClassSet); }

Target:
@Override protected AbstractBinder getAuthBinder() { return new PolymorphicAuthValueFactoryProvider.Binder<PrincipalImpl>( ImmutableSet.of(JsonPrincipal.class, NullPrincipal.class)); }
Source:
private void scheduleInitialization() { EXECUTOR_SERVICE.schedule(() -> { synchronized (this) { try { tryToInitializeIfNotInitialized(); log.warn("Initialized asynchronously.", SafeArg.of("className", this.getClass().getName())); } catch (Throwable throwable) { cleanUpOnInitFailure(); scheduleInitialization(); } } }, sleepIntervalInMillis(), TimeUnit.MILLISECONDS); }

Target:
private void scheduleInitialization() { singleThreadedExecutor.schedule(() -> { if (canceledInitialization) { return; } try { tryInitializeInternal(); log.info("Initialized asynchronously.", SafeArg.of("className", getInitializingClassName())); } catch (Throwable throwable) { log.info("Failed to initialize asynchronously.", SafeArg.of("className", getInitializingClassName()), throwable); cleanUpOnInitFailure(); scheduleInitialization(); } }, sleepIntervalInMillis(), TimeUnit.MILLISECONDS); }
Source:
MutableSpan doTakeSpan(boolean flushed) { MutableSpan result; try { result = spans.poll(20, TimeUnit.SECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new AssertionError(e); } assertThat(result) .withFailMessage("Timeout waiting for span") .isNotNull(); assertThat(result.startTimestamp()) .withFailMessage("Expected a startTimestamp: %s", result) .isNotZero(); if (flushed) { assertThat(result.finishTimestamp()) .withFailMessage("Expected no finishTimestamp: %s", result) .isZero(); } else { assertThat(result.finishTimestamp()) .withFailMessage("Expected a finishTimestamp: %s", result) .isNotZero(); } return result; }

Target:
MutableSpan doTakeSpan(boolean flushed) { MutableSpan result; try { result = spans.poll(10, TimeUnit.SECONDS); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new AssertionError(e); } assertThat(result) .withFailMessage("Timeout waiting for span") .isNotNull(); assertThat(result.startTimestamp()) .withFailMessage("Expected a startTimestamp: %s", result) .isNotZero(); if (flushed) { assertThat(result.finishTimestamp()) .withFailMessage("Expected no finishTimestamp: %s", result) .isZero(); } else { assertThat(result.finishTimestamp()) .withFailMessage("Expected a finishTimestamp: %s", result) .isNotZero(); } return result; }
Source:
public KafkaAdminClient(String kafkaInternalHost) { Properties config = new Properties(); config.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, kafkaInternalHost); adminClient = AdminClient.create(config); }

Target:
public KafkaAdminClient(String kafkaInternalHost) { Properties config = new Properties(); config.setProperty(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, kafkaInternalHost); adminClient = AdminClient.create(config); }
Source:
private void rentVideo(@NonNull final Video video) { new DatePickerFragment() .setTitle("Select Rental Expiry Date") .setListener(new DatePickerFragment.Listener() { @Override public void onDateSelected(@NonNull Date expiryDate) { long playDuration = video.getDuration() + 10000; if (playDuration == 0) { playDuration = DEFAULT_RENTAL_PLAY_DURATION; } HttpRequestConfig.Builder httpRequestConfigBuilder = new HttpRequestConfig.Builder(); httpRequestConfigBuilder.setBrightcoveAuthorizationToken(pasToken); httpRequestConfig = httpRequestConfigBuilder.build(); catalog.requestRentalLicense(video, expiryDate, playDuration, licenseEventListener, httpRequestConfig); } }) .show(getFragmentManager(), "rentalExpiryDatePicker"); }

Target:
private void rentVideo(@NonNull final Video video) { new DatePickerFragment() .setTitle("Select Rental Expiry Date") .setListener(new DatePickerFragment.Listener() { @Override public void onDateSelected(@NonNull Date expiryDate) { long playDuration = video.getDuration() + PLAYDURATION_EXTENSION; if (playDuration == 0) { playDuration = DEFAULT_RENTAL_PLAY_DURATION; } HttpRequestConfig.Builder httpRequestConfigBuilder = new HttpRequestConfig.Builder(); httpRequestConfigBuilder.setBrightcoveAuthorizationToken(pasToken); httpRequestConfig = httpRequestConfigBuilder.build(); catalog.requestRentalLicense(video, expiryDate, playDuration, licenseEventListener, httpRequestConfig); } }) .show(getFragmentManager(), "rentalExpiryDatePicker"); }
Source:
public static boolean isAztecEditorAvailable() { return getBoolean(UndeletablePrefKey.AZTEC_EDITOR_AVAILABLE, BuildConfig.AZTEC_EDITOR_AVAILABLE); }

Target:
public static boolean isAztecEditorAvailable() { return BuildConfig.AZTEC_EDITOR_AVAILABLE || getBoolean(UndeletablePrefKey.AZTEC_EDITOR_AVAILABLE, false); }
Source:
private List<RepositoryChangeLog> getAllLogs() { return changeLogCache.execute( c -> new ArrayList<>( c.values() ) ); }

Target:
private List<RepositoryChangeLog> getAllLogs() { final ArrayList<RepositoryChangeLog> results = new ArrayList<>( RESULT_LIMITATION_FOR_TESTING ); return changeLogCache.execute( c -> { for ( RepositoryChangeLog log : c.values() ) { results.add( log ); if ( results.size() >= RESULT_LIMITATION_FOR_TESTING ) { return results; } } return results; } ); }
Source:
public static void testErrorMessageInvalidValueNoncompoundAttribute(WebDriver driver, By context, String simpleName, String value) { String originalValue = FormsUtils.getValueNoncompoundAttribute(driver, context, simpleName); WebElement attribuetContainer = findAttributeContainerWebElement(driver, context, simpleName, false); changeValueAttribute(attribuetContainer, simpleName, value); assertTrue(FormsUtils.formHasErrors(driver, context)); FormsUtils.getValueNoncompoundAttribute(driver, context, simpleName); changeValueAttribute(attribuetContainer, simpleName, originalValue); }

Target:
public static void testErrorMessageInvalidValueNoncompoundAttribute(WebDriver driver, By context, String simpleName, String value) { String originalValue = FormsUtils.getValueNoncompoundAttribute(driver, context, simpleName); WebElement attributeContainer = findAttributeContainerWebElement(driver, context, simpleName, false); changeValueAttributeTextNumberEmailUrl(attributeContainer, simpleName, value); assertTrue(FormsUtils.formHasErrors(driver, context)); FormsUtils.getValueNoncompoundAttribute(driver, context, simpleName); changeValueAttributeTextNumberEmailUrl(attributeContainer, simpleName, originalValue); }
Source:
protected Value<ParrotVariant> constructValue(ParrotVariant actualValue) { return new SpongeValue<>(Keys.PARROT_VARIANT, ParrotVariants.RED, actualValue); }

Target:
protected Value<ParrotVariant> constructValue(ParrotVariant actualValue) { return new SpongeValue<>(this.key, ParrotVariants.RED, actualValue); }
Source:
public void prepareListTest() { for (DataType rawType : primitiveTypes) { if (exclude(rawType)) continue; String name = "c_list_" + rawType; DataType type = DataType.list(rawType); List<Object> value = (List<Object>)getFixedValue(type); ; PreparedStatement ps = session.prepare(String.format("INSERT INTO %s(k, %s) VALUES ('prepared_list', ?)", ALL_LIST_TABLE, name)); BoundStatement bs = ps.bind(); session.execute(setBoundValue(bs, name, type, value)); Row row = session.execute(String.format("SELECT %s FROM %s WHERE k='prepared_list'", name, ALL_LIST_TABLE)).one(); assertEquals(getValue(row, name, type, cluster.getConfiguration().getCodecRegistry()), value, "For type " + type); } }

Target:
public void prepareListTest() { for (DataType rawType : primitiveTypes) { if (exclude(rawType)) continue; String name = "c_list_" + rawType; DataType type = DataType.list(rawType); List<Object> value = (List<Object>)getFixedValue(type); PreparedStatement ps = session.prepare(String.format("INSERT INTO %s(k, %s) VALUES ('prepared_list', ?)", ALL_LIST_TABLE, name)); BoundStatement bs = ps.bind(); session.execute(setBoundValue(bs, name, type, value)); Row row = session.execute(String.format("SELECT %s FROM %s WHERE k='prepared_list'", name, ALL_LIST_TABLE)).one(); assertEquals(getValue(row, name, type, cluster.getConfiguration().getCodecRegistry()), value, "For type " + type); } }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); FeatureRebaseOperation rebaseOperation = new FeatureRebaseOperation(gfRepo); JobUtil.scheduleUserWorkspaceJob(rebaseOperation, UIText.FeatureRebaseHandler_rebasingFeature, JobFamilies.GITFLOW_FAMILY); IJobManager jobMan = Job.getJobManager(); try { jobMan.join(GITFLOW_FAMILY, null); } catch (OperationCanceledException | InterruptedException e) { return error(e.getMessage(), e); } RebaseResult operationResult = rebaseOperation.getOperationResult(); RebaseResult.Status status = operationResult.getStatus(); if (status.isSuccessful()) { return null; } openWarning(operationResult); if (STOPPED.equals(status)) { try { showInteractiveRebaseView(); } catch (PartInitException e) { return error(e.getMessage(), e); } } return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { final GitFlowRepository gfRepo = GitFlowHandlerUtil.getRepository(event); FeatureRebaseOperation rebaseOperation = new FeatureRebaseOperation(gfRepo); JobUtil.scheduleUserWorkspaceJob(rebaseOperation, UIText.FeatureRebaseHandler_rebasingFeature, JobFamilies.GITFLOW_FAMILY); IJobManager jobMan = Job.getJobManager(); try { jobMan.join(GITFLOW_FAMILY, null); } catch (OperationCanceledException | InterruptedException e) { return error(e.getMessage(), e); } RebaseResult operationResult = rebaseOperation.getOperationResult(); RebaseResult.Status status = operationResult.getStatus(); if (status.isSuccessful()) { return null; } if (STOPPED.equals(status)) { try { showInteractiveRebaseView(event); } catch (PartInitException e) { return error(e.getMessage(), e); } } openWarning(operationResult); return null; }