auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void deleteOnExit(final Path path) { recursiveDeleteDir(Paths.get("/tmp/maven-hack")); Runtime.getRuntime().addShutdownHook(new Thread(DockerClientFactory.TESTCONTAINERS_THREAD_GROUP, () -> recursiveDeleteDir(path))); }

Target:
private void deleteOnExit(final Path path) { BiConsumer<Path, DeleteFileVisitor> consumer = PathUtils::recursiveDeleteDir; Runtime.getRuntime().addShutdownHook(new Thread(DockerClientFactory.TESTCONTAINERS_THREAD_GROUP, () -> consumer.accept(path, new DeleteFileVisitor()))); }
Source:
public void configure(final HttpSecurity http) throws Exception { LOG.info("Authentication mode: " + settings.getAuthMode()); if (settings.getAuthMode() == SecuritySettings.AuthMode.FULL) { http.authorizeRequests() .antMatchers(GET, "/event-types events events events **").access(hasScope(nakadiAdminScope)) .antMatchers(POST, "/event-types/**").access(hasScope(eventTypeWriteScope)) .antMatchers(PUT, "/event-types/**").access(hasScope(eventTypeWriteScope)) .antMatchers(GET, "/health/**").permitAll() .anyRequest().access(hasScope(uidScope)); } else if (settings.getAuthMode() == SecuritySettings.AuthMode.BASIC) { http.authorizeRequests() .antMatchers(GET, "/health/**").permitAll() .anyRequest().access(hasScope(uidScope)); } else { http.authorizeRequests() .anyRequest().permitAll(); } }

Target:
public void configure(final HttpSecurity http) throws Exception { LOG.info("Authentication mode: " + settings.getAuthMode()); if (settings.getAuthMode() == SecuritySettings.AuthMode.FULL) { http.authorizeRequests() .antMatchers(GET, "/event-types events events cursors events **").access(hasScope(nakadiAdminScope)) .antMatchers(POST, "/event-types/**").access(hasScope(eventTypeWriteScope)) .antMatchers(PUT, "/event-types/**").access(hasScope(eventTypeWriteScope)) .antMatchers(POST, "/subscriptions/**").access(hasScope(eventStreamReadScope)) .antMatchers(GET, "/health/**").permitAll() .anyRequest().access(hasScope(uidScope)); } else if (settings.getAuthMode() == SecuritySettings.AuthMode.BASIC) { http.authorizeRequests() .antMatchers(GET, "/health/**").permitAll() .anyRequest().access(hasScope(uidScope)); } else { http.authorizeRequests() .anyRequest().permitAll(); } }
Source:
public String name() { return "cooperative"; }

Target:
public String name() { return "cooperative-sticky"; }
Source:
protected void validatePositionOfPortOnContainer(String containerName, String portName, boolean pinBorderedNodes) { super.validatePositionOfPortOnContainer(containerName, portName, pinBorderedNodes); SWTBotGefEditPart swtbotContainerEditPart = editor.getEditPart(containerName); assertNotNull("No container edit part found with this name", swtbotContainerEditPart); EditPart containerSquareEP = swtbotContainerEditPart.part(); final AbstractBorderedShapeEditPart containerEP = (AbstractBorderedShapeEditPart) containerSquareEP.getParent(); final AbstractDiagramBorderNodeEditPart portEP = findPortInContainer(containerEP, portName); assertTrue("The port " + portName + " of the container " + containerName + " is not aligned on the grid.", checkBorderNodeAlignOnGrid(portEP)); }

Target:
protected void validatePositionOfPortOnContainer(String containerName, String portName, boolean pinBorderedNodes) { super.validatePositionOfPortOnContainer(containerName, portName, pinBorderedNodes); SWTBotGefEditPart swtbotContainerEditPart = editor.getEditPart(containerName); assertNotNull("No container edit part found with this name", swtbotContainerEditPart); EditPart containerSquareEP = swtbotContainerEditPart.part(); final AbstractBorderedShapeEditPart containerEP = (AbstractBorderedShapeEditPart) containerSquareEP.getParent(); final AbstractDiagramBorderNodeEditPart portEP = findPortInContainer(containerEP, portName); checkBorderNodeAlignOnGrid(portEP, "port " + portName + " of the container " + containerName); }
Source:
public void incrementAllCounters() { aLong.incrementAndGet(); aInt.incrementAndGet(); evalLong += 1; counter.incr(); }

Target:
private void incrementAllCounters() { aLong.incrementAndGet(); aInt.incrementAndGet(); evalLong += 1; counter.incr(); }
Source:
private void addFreemarkerVariables(Map<String, Object> freemarkerVariables) { }

Target:
protected void addFreemarkerVariables(Map<String, Object> freemarkerVariables) { }
Source:
public static CompletableFuture<AllCoordinatorSnapshots> triggerAllCoordinatorCheckpoints( final Collection<OperatorCoordinatorCheckpointContext> coordinators, final long checkpointId) throws Exception { final Collection<CompletableFuture<CoordinatorSnapshot>> individualSnapshots = new ArrayList<>(coordinators.size()); for (final OperatorCoordinatorCheckpointContext coordinator : coordinators) { final CompletableFuture<CoordinatorSnapshot> checkpointFuture = triggerCoordinatorCheckpoint(coordinator, checkpointId); coordinator.onCallTriggerCheckpoint(checkpointId); individualSnapshots.add(checkpointFuture); checkpointFuture.whenComplete((ignored, failure) -> { if (failure != null) { coordinator.abortCurrentTriggering(); } else { coordinator.onCheckpointStateFutureComplete(checkpointId); } }); } return FutureUtils.combineAll(individualSnapshots).thenApply(AllCoordinatorSnapshots::new); }

Target:
public static CompletableFuture<AllCoordinatorSnapshots> triggerAllCoordinatorCheckpoints( final Collection<OperatorCoordinatorCheckpointContext> coordinators, final long checkpointId) throws Exception { final Collection<CompletableFuture<CoordinatorSnapshot>> individualSnapshots = new ArrayList<>(coordinators.size()); for (final OperatorCoordinatorCheckpointContext coordinator : coordinators) { final CompletableFuture<CoordinatorSnapshot> checkpointFuture = triggerCoordinatorCheckpoint(coordinator, checkpointId); individualSnapshots.add(checkpointFuture); } return FutureUtils.combineAll(individualSnapshots).thenApply(AllCoordinatorSnapshots::new); }
Source:
public void init() throws RepositoryException { super.init(); if (httpFactory != null) { HttpClientBuilder clientBuilder = httpFactory.newBuilder(); clientBuilder.setDefaultSocketConfig( SocketConfig.custom() .setSoTimeout(retryPause) .build()); clientBuilder.setDefaultRequestConfig( RequestConfig.custom() .setConnectTimeout(retryPause) .build() ); httpClient = clientBuilder.build(); clientProvider.setHttpClientSupplier(this::getHttpClient); clientProvider.setUsername(username); clientProvider.setPassword(password); } }

Target:
public void init() throws RepositoryException { super.init(); if (httpFactory != null) { HttpClientBuilder clientBuilder = httpFactory.newBuilder(); clientBuilder.setDefaultSocketConfig( SocketConfig.custom() .setSoTimeout(timeout) .build()); clientBuilder.setDefaultRequestConfig( RequestConfig.custom() .setConnectTimeout(timeout) .build() ); httpClient = clientBuilder.build(); clientProvider.setHttpClientSupplier(this::getHttpClient); clientProvider.setUsername(username); clientProvider.setPassword(password); } }
Source:
public void start(Stage stage) throws Exception { FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/openpane.fxml")); loader.setControllerFactory(new Callback<Class<?>, Object>() { public Object call(Class<?> p) { return new DummyFileOpenController(); } }); AnchorPane openpane = loader.load(); Scene scene = new Scene(openpane, WIDTH, HEIGHT); stage.setScene(scene); stage.show(); control = loader.getController(); }

Target:
public void start(Stage stage) throws Exception { FXMLLoader loader = new FXMLLoader(getClass().getResource("/fxml/openpane.fxml")); loader.setControllerFactory((p) -> new DummyFileOpenController()); AnchorPane openpane = loader.load(); Scene scene = new Scene(openpane, WIDTH, HEIGHT); stage.setScene(scene); stage.show(); control = loader.getController(); }
Source:
public void dumpEntities(@CommandParam(value = "componentNames", required = false) String componentNames) throws IOException { EngineEntityManager engineEntityManager = (EngineEntityManager) entityManager; PrefabSerializer prefabSerializer = new PrefabSerializer(engineEntityManager.getComponentLibrary(), engineEntityManager.getTypeSerializerLibrary()); WorldDumper worldDumper = new WorldDumper(engineEntityManager, prefabSerializer); if (componentNames == null) { worldDumper.save(PathManager.getInstance().getHomePath().resolve("entityDump.txt")); } else { Reflections reflections = new Reflections("org.terasology"); List<Class<? extends Component>> filterComponents = new LinkedList<>(); List<String> componentNamesList = Arrays.asList(componentNames.split(" ")); for (String componentName : componentNamesList) { if (componentName.trim().length() > 0) { Optional<Class<? extends Component>> component = reflections.getSubTypesOf(Component.class).stream().filter(e -> e.getSimpleName().equals(componentName)).findFirst(); component.ifPresent(filterComponents::add); } } if (!filterComponents.isEmpty()) { worldDumper.save(PathManager.getInstance().getHomePath().resolve("entityDump.txt"), filterComponents); } } }

Target:
public String dumpEntities(@CommandParam(value = "componentNames", required = false) String componentNames) throws IOException { int savedEntitiCount = 0; EngineEntityManager engineEntityManager = (EngineEntityManager) entityManager; PrefabSerializer prefabSerializer = new PrefabSerializer(engineEntityManager.getComponentLibrary(), engineEntityManager.getTypeSerializerLibrary()); WorldDumper worldDumper = new WorldDumper(engineEntityManager, prefabSerializer); if (componentNames == null) { savedEntitiCount = worldDumper.save(PathManager.getInstance().getHomePath().resolve("entityDump.txt")); } else { List<String> componentNamesList = new LinkedList<>(Arrays.asList(componentNames.split(" "))); List<Class<? extends Component>> filterComponents = componentNamesList.stream() .filter(o -> o.trim().length() > 0) .map(String::trim) .map(o -> Streams.stream(moduleManager.getEnvironment().getSubtypesOf(Component.class)) .filter(e -> e.getSimpleName().equalsIgnoreCase(o)).findFirst()) .filter(Optional::isPresent) .map(Optional::get) .collect(Collectors.toList()); if (!filterComponents.isEmpty()) { savedEntitiCount = worldDumper.save(PathManager.getInstance().getHomePath().resolve("entityDump.txt"), filterComponents); } } return "Number of entities saved: " + savedEntitiCount; }
Source:
public void remappingFunctionReturnsIterableOfEntriesForEachInputEntry() throws Exception { final Store<K, V> kvStore = factory.newStore(new StoreConfigurationImpl<K, V>(factory.getKeyType(), factory .getValueType(), null, Predicates.<Cache.Entry<K, V>>all(), null, ClassLoader.getSystemClassLoader(), Expirations.noExpiration())); final K k1 = factory.createKey(1L); final V v1 = factory.createValue(1L); Set<K> set = new HashSet<K>(); set.add(k1); kvStore.put(k1, v1); try { kvStore.bulkCompute(Arrays.asList((K[]) set.toArray()), new Function<Iterable<? extends Map.Entry<? extends K, ? extends V>>, Iterable<? extends Map.Entry<? extends K, ? extends V>>>() { @Override public Iterable<? extends Map.Entry<? extends K, ? extends V>> apply(Iterable<? extends Map.Entry<? extends K, ? extends V>> entries) { Map.Entry<? extends K, ? extends V> entry = entries.iterator().next(); assertThat(entry.getValue(), is(v1)); return null; } } ); } catch (CacheAccessException e) { System.err.println("Warning, an exception is thrown due to the SPI test"); e.printStackTrace(); } }

Target:
public void remappingFunctionReturnsIterableOfEntriesForEachInputEntry() throws Exception { final Store<K, V> kvStore = factory.newStore(new StoreConfigurationImpl<K, V>(factory.getKeyType(), factory .getValueType(), null, Predicates.<Cache.Entry<K, V>>all(), null, ClassLoader.getSystemClassLoader(), Expirations.noExpiration())); final K k1 = factory.createKey(1L); final V v1 = factory.createValue(1L); Set<K> set = new HashSet<K>(); set.add(k1); kvStore.put(k1, v1); try { kvStore.bulkCompute(Arrays.asList((K[]) set.toArray()), new Function<Iterable<? extends Map.Entry<? extends K, ? extends V>>, Iterable<? extends Map.Entry<? extends K, ? extends V>>>() { @Override public Iterable<? extends Map.Entry<? extends K, ? extends V>> apply(Iterable<? extends Map.Entry<? extends K, ? extends V>> entries) { Map.Entry<? extends K, ? extends V> entry = entries.iterator().next(); assertThat(entry.getValue(), is(v1)); Map<K, V> map = new HashMap<K, V>(); map.put(entry.getKey(), entry.getValue()); return map.entrySet(); } } ); } catch (CacheAccessException e) { System.err.println("Warning, an exception is thrown due to the SPI test"); e.printStackTrace(); } }
Source:
private void generateFullRangeCheck(Versions ifVersions, Versions ifNotVersions, CodeBuffer buffer) { if (ifMember != null) { buffer.printf("if ((version >= %d) && (version <= %d)) {%n", containingVersions.lowest(), containingVersions.highest()); buffer.incrementIndent(); ifMember.generate(ifVersions); buffer.decrementIndent(); if (ifNotMember != null) { buffer.printf("} else {%n"); buffer.incrementIndent(); ifNotMember.generate(ifNotVersions); buffer.decrementIndent(); buffer.printf("}%n"); } else { buffer.printf("}%n"); } } else if (ifNotMember != null) { buffer.printf("if ((version < %d) || (version > %d)) {%n", containingVersions.lowest(), containingVersions.highest()); buffer.incrementIndent(); ifNotMember.generate(ifNotVersions); buffer.decrementIndent(); buffer.printf("}%n"); } }

Target:
private void generateFullRangeCheck(Versions ifVersions, Versions ifNotVersions, CodeBuffer buffer) { if (ifMember != null) { buffer.printf("if ((version >= %d) && (version <= %d)) {%n", containingVersions.lowest(), containingVersions.highest()); buffer.incrementIndent(); ifMember.generate(ifVersions); buffer.decrementIndent(); if (ifNotMember != null) { buffer.printf("} else {%n"); buffer.incrementIndent(); ifNotMember.generate(ifNotVersions); buffer.decrementIndent(); } buffer.printf("}%n"); } else if (ifNotMember != null) { buffer.printf("if ((version < %d) || (version > %d)) {%n", containingVersions.lowest(), containingVersions.highest()); buffer.incrementIndent(); ifNotMember.generate(ifNotVersions); buffer.decrementIndent(); buffer.printf("}%n"); } }
Source:
public ValidationResult validateOpenStackImageConstraints() { if (ProviderType.OPENSTACK_IMAGE != provider.getType()) { return ValidationResult.VALID; } List<Provider<?>> existingProviders = Injector.get(ProviderDao.class).getAllByTypes(ProviderType.OPENSTACK_IMAGE); if (OpenStackTokenProviderFactory.isApiV3(provider)) { return openStackImageV3Constraints(existingProviders); } else { return openStackImageV2Constraints(existingProviders); } }

Target:
public ValidationResult validateOpenStackImageConstraints() { if (ProviderType.OPENSTACK_IMAGE != provider.getType()) { return ValidationResult.VALID; } List<Provider<?>> existingProviders = Injector.get(ProviderDao.class).getAllByTypes(ProviderType.OPENSTACK_IMAGE); return OpenStackTokenProviderFactory.isApiV3(provider) ? openStackImageV3Constraints(existingProviders) : openStackImageV2Constraints(existingProviders); }
Source:
protected void setUp() throws Exception { shell = Display.getDefault().getActiveShell(); renderer = new StackRendererTestable(); context = EclipseContextFactory.create(); context.set(CSSRenderingUtils.class, new CSSRenderingUtils()); part = (MPart) Proxy.newProxyInstance(getClass().getClassLoader(), new Class<?>[] { MPart.class }, new InvocationHandler() { public Object invoke(Object obj, Method method, Object[] args) throws Throwable { if ("getContext".equals(method.getName())) { return context; } return null; } }); }

Target:
protected void setUp() throws Exception { shell = Display.getDefault().getActiveShell(); renderer = new StackRendererTestable(); part = MBasicFactory.INSTANCE.createPart(); }
Source:
private static Statement parseFormatted(SqlParser sqlParser, ParsingOptions parsingOptions, String sql, Node tree) { try { return sqlParser.createStatement(sql, parsingOptions); } catch (ParsingException e) { String error = format("failed to parse formatted SQL: %s\nerror: %s\ntree: %s", sql, e.getMessage(), tree); throw new AssertionError(error, e); } }

Target:
private static Statement parseFormatted(SqlParser sqlParser, ParsingOptions parsingOptions, String sql, Node tree) { try { return sqlParser.createStatement(sql, parsingOptions); } catch (ParsingException e) { throw new AssertionError(format("failed to parse formatted SQL: %s\nerror: %s\ntree: %s", sql, e.getMessage(), tree), e); } }
Source:
public ILaunchConfiguration getActiveLaunchConfiguration() throws CoreException { ILaunchConfiguration activeConfig = getLaunchConfiguration(activeLaunchDesc, activeLaunchTarget); if (activeConfig != null) { saveActiveTargetMapping(activeConfig, activeLaunchTarget); } return activeConfig; }

Target:
public ILaunchConfiguration getActiveLaunchConfiguration() throws CoreException { ILaunchConfiguration activeConfig = getLaunchConfiguration(activeLaunchDesc, activeLaunchTarget); if (activeConfig != null) { remoteLaunchConfigService.setActiveConnection(activeConfig, activeLaunchTarget); } return activeConfig; }
Source:
synchronized void handleResult(List<MutateRowsResponse> result) { AtomicReference<Long> backoffTime = new AtomicReference<>(); if (this.currentRequestManager == null) { LOG.warn("Got duplicate responses for bulk mutation."); return; } if (result == null || result.isEmpty()) { perfromFullRetry(backoffTime, new IllegalStateException("MutateRowResponse result or statuses")); return; } List<MutateRowsResponse.Entry> entries = new ArrayList<>(); for (MutateRowsResponse response : result) { entries.addAll(response.getEntriesList()); } if (entries.isEmpty()) { perfromFullRetry(backoffTime, new IllegalStateException("MutateRowResponse result or statuses")); return; } try { String tableName = currentRequestManager.request.getTableName(); RequestManager retryRequestManager = new RequestManager(tableName); int processedCount = handleResponses(backoffTime, entries, retryRequestManager); handleExtraFutures(backoffTime, processedCount, retryRequestManager, entries); completeOrRetry(backoffTime, retryRequestManager); } catch (RuntimeException e) { LOG.error( "Unexpected Exception occurred. Treating this issue as a temporary issue and retrying.", e); perfromFullRetry(backoffTime, e); } }

Target:
synchronized void handleResult(List<MutateRowsResponse> result) { AtomicReference<Long> backoffTime = new AtomicReference<>(); if (this.currentRequestManager == null) { LOG.warn("Got duplicate responses for bulk mutation."); return; } if (result == null || result.isEmpty()) { performFullRetry( backoffTime, new IllegalStateException("No MutateRowResponses were found.")); return; } List<MutateRowsResponse.Entry> entries = new ArrayList<>(); for (MutateRowsResponse response : result) { entries.addAll(response.getEntriesList()); } if (entries.isEmpty()) { performFullRetry( backoffTime, new IllegalStateException("No MutateRowsResponses entries were found.")); return; } try { String tableName = currentRequestManager.request.getTableName(); RequestManager retryRequestManager = new RequestManager(tableName); int processedCount = handleResponses(backoffTime, entries, retryRequestManager); handleExtraFutures(backoffTime, processedCount, retryRequestManager, entries); completeOrRetry(backoffTime, retryRequestManager); } catch (RuntimeException e) { LOG.error( "Unexpected Exception occurred. Treating this issue as a temporary issue and retrying.", e); performFullRetry(backoffTime, e); } }
Source:
public static void hideUnecessaryIngredients(State state, Domain domain, IngredientRecipe goal, List<ObjectInstance>allIngredients) { Boolean match; for (ObjectInstance obj : allIngredients) { match = false; List<IngredientRecipe> contents = goal.getContents(); contents.add(goal); for (IngredientRecipe ing : contents) { if (ing.getName().equals(obj.getName())) { IngredientFactory.setAttributes(obj, ing.generateAttributeNumber(), ing.getToolAttributes()); match = true; break; } } if (!match) { for (Entry<String, IngredientRecipe> entry : goal.getNecessaryTraits().entrySet()) { if (IngredientFactory.getTraits(obj).contains(entry.getKey())) { IngredientRecipe ing = entry.getValue(); IngredientFactory.setAttributes(obj, ing.generateAttributeNumber(), ing.getToolAttributes()); match = true; break; } } } if (match) { if (obj.getName().equals(goal.getName()) == !goal.getSwapped()) { if (IngredientFactory.getUseCount(obj) <= 1) { ObjectInstance hidden = makeHiddenObjectCopy(state, domain, obj); ObjectInstance container = state.getObject(IngredientFactory.getContainer(hidden)); ContainerFactory.removeIngredient(container, hidden.getName()); state.removeObject(obj); state.addObject(hidden); } } if (IngredientFactory.getUseCount(obj) > 0) { IngredientFactory.setUseCount(obj, IngredientFactory.getUseCount(obj) -1); } } } }

Target:
public static void hideUnecessaryIngredients(State state, Domain domain, IngredientRecipe goal, List<ObjectInstance>allIngredients) { Boolean match; for (ObjectInstance obj : allIngredients) { match = false; List<IngredientRecipe> contents = goal.getContents(); contents.add(goal); for (IngredientRecipe ing : contents) { if (ing.getName().equals(obj.getName())) { IngredientFactory.setAttributes(obj, ing.generateAttributeNumber(), ing.getToolAttributes()); match = true; break; } } if (!match) { for (Entry<String, IngredientRecipe> entry : goal.getNecessaryTraits().entrySet()) { if (IngredientFactory.getTraits(obj).contains(entry.getKey())) { IngredientRecipe ing = entry.getValue(); IngredientFactory.setAttributes(obj, ing.generateAttributeNumber(), ing.getToolAttributes()); match = true; break; } } } if (match) { boolean bool1 = obj.getName().equals(goal.getName()); boolean bool2 = !goal.getSwapped(); if (bool1 == bool2) { if (IngredientFactory.getUseCount(obj) <= 1) { ObjectInstance hidden = makeHiddenObjectCopy(state, domain, obj); ObjectInstance container = state.getObject(IngredientFactory.getContainer(hidden)); ContainerFactory.removeIngredient(container, hidden.getName()); state.removeObject(obj); state.addObject(hidden); } } if (IngredientFactory.getUseCount(obj) > 0) { IngredientFactory.setUseCount(obj, IngredientFactory.getUseCount(obj) -1); } } } }
Source:
private void runAsJob(final URIish uri, final CloneOperation op) { final Job job = new Job(NLS.bind(UIText.GitCloneWizard_jobName, uri.toString())) { @Override protected IStatus run(final IProgressMonitor monitor) { try { return executeCloneOperation(op, monitor); } catch (InterruptedException e) { return Status.CANCEL_STATUS; } catch (InvocationTargetException e) { Throwable thr = e.getCause(); return new Status(IStatus.ERROR, Activator.getPluginId(), 0, thr.getMessage(), thr); } } }; job.setUser(true); job.belongsTo(CLONE_JOB_FAMILY); job.schedule(); }

Target:
private void runAsJob(final URIish uri, final CloneOperation op) { final Job job = new Job(NLS.bind(UIText.GitCloneWizard_jobName, uri.toString())) { @Override protected IStatus run(final IProgressMonitor monitor) { try { return executeCloneOperation(op, monitor); } catch (InterruptedException e) { return Status.CANCEL_STATUS; } catch (InvocationTargetException e) { Throwable thr = e.getCause(); return new Status(IStatus.ERROR, Activator.getPluginId(), 0, thr.getMessage(), thr); } } @Override public boolean belongsTo(Object family) { return CLONE_JOB_FAMILY.equals(family); } }; job.setUser(true); job.schedule(); }
Source:
private IStatus updateElements(IWorkingSet[] workingSets, IProgressMonitor monitor) { try { if(isDisposed.get() || monitor.isCanceled()) { return Status.CANCEL_STATUS; } IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot(); IJavaModel model= JavaCore.create(root); List<IAdaptable> testResult= new ArrayList<>(); List<IAdaptable> mainResult= new ArrayList<>(); for (IJavaProject jProject : model.getJavaProjects()) { if (monitor.isCanceled() || isDisposed.get()) return Status.CANCEL_STATUS; final IJavaProject project= jProject; if (project.getProject().isOpen()) { for (IPackageFragmentRoot iPackageFragmentRoot : project.getPackageFragmentRoots()) { IClasspathEntry classpathEntry= iPackageFragmentRoot.getRawClasspathEntry(); if (classpathEntry.getEntryKind() == IClasspathEntry.CPE_SOURCE) { if (classpathEntry.isTest()) { testResult.add(iPackageFragmentRoot); } else { mainResult.add(iPackageFragmentRoot); } } } } } IAdaptable[] testArray= testResult.toArray(new IAdaptable[testResult.size()]); IAdaptable[] productionArray= mainResult.toArray(new IAdaptable[mainResult.size()]); fUpdateUIJob.setTask(new Runnable() { @Override public void run() { for (IWorkingSet w : workingSets) { if(this != fUpdateUIJob.getTask()) { break; } if (MAIN_NAME.equals(w.getName())) { w.setElements(productionArray); } else if (TEST_NAME.equals(w.getName())) { w.setElements(testArray); } } } }); } catch (Exception e) { return Status.CANCEL_STATUS; } return Status.OK_STATUS; }

Target:
private IStatus updateElements(IWorkingSet[] workingSets, IProgressMonitor monitor) { try { if(isDisposed.get() || monitor.isCanceled()) { return Status.CANCEL_STATUS; } IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot(); IJavaModel model= JavaCore.create(root); List<IAdaptable> testResult= new ArrayList<>(); List<IAdaptable> mainResult= new ArrayList<>(); for (IJavaProject project : model.getJavaProjects()) { if (monitor.isCanceled() || isDisposed.get()) return Status.CANCEL_STATUS; if (project.getProject().isOpen()) { for (IPackageFragmentRoot iPackageFragmentRoot : project.getPackageFragmentRoots()) { IClasspathEntry classpathEntry= iPackageFragmentRoot.getRawClasspathEntry(); if (classpathEntry.getEntryKind() == IClasspathEntry.CPE_SOURCE) { if (classpathEntry.isTest()) { testResult.add(iPackageFragmentRoot); } else { mainResult.add(iPackageFragmentRoot); } } } } } IAdaptable[] testArray= testResult.toArray(new IAdaptable[testResult.size()]); IAdaptable[] productionArray= mainResult.toArray(new IAdaptable[mainResult.size()]); fUpdateUIJob.setTask(new Runnable() { @Override public void run() { for (IWorkingSet w : workingSets) { if(this != fUpdateUIJob.getTask()) { break; } if (MAIN_NAME.equals(w.getName())) { w.setElements(productionArray); } else if (TEST_NAME.equals(w.getName())) { w.setElements(testArray); } } } }); } catch (Exception e) { return Status.CANCEL_STATUS; } return Status.OK_STATUS; }
Source:
public ValidationResult validate(Object value) { if (!(value instanceof String || value instanceof Double)) { return ValidationResult.ok(); } if (value instanceof String && ((String) value).isEmpty()) { return ValidationResult.ok(); } Double doubleValue = value instanceof String ? tryParse((String) value) : (Double) value; if (doubleValue == null) { return ValidationResult.fail(constants.thisFieldMustContainNumberInvalidReason()); } return ValidationResult.ok(); }

Target:
public ValidationResult validate(Object value) { if (!(value instanceof String || value instanceof Double)) { return ValidationResult.fail(constants.thisFieldMustContainNumberInvalidReason()); } if (value instanceof String && ((String) value).isEmpty()) { return ValidationResult.ok(); } Double doubleValue = value instanceof String ? tryParse((String) value) : (Double) value; if (doubleValue == null) { return ValidationResult.fail(constants.thisFieldMustContainNumberInvalidReason()); } return ValidationResult.ok(); }
Source:
public void testNoUrlDecodingOfResponse() throws Exception { String contentName = "swift-test-content-%20-1401395399020"; String jsonObjectList = "[{\"last_modified\": \"2014-05-29T20:30:03.845660\", " + "\"bytes\": 19, " + "\"name\": \"" + contentName + "\", " + "\"content_type\": \"application/unknown\"}]"; InputStream stream = Strings2.toInputStream(jsonObjectList); ParseObjectInfoListFromJsonResponse parser = new ParseObjectInfoListFromJsonResponse(new GsonWrapper(new Gson())); GeneratedHttpRequest.Builder builder = new GeneratedHttpRequest.Builder(); builder.method("method") .endpoint("<LINK_0>") .invocation(Invocation.create(Invokable.from(Object.class.getMethod("toString", null)), ImmutableList.<Object>of("container-name", new ListContainerOptions[0]))) .caller(null); parser.setContext(builder.build()); ObjectInfo objectInfo = parser.apply(stream).iterator().next(); assertEquals(objectInfo.getName(), contentName); }

Target:
public void testNoUrlDecodingOfResponse() throws Exception { String contentName = "swift-test-content-%x-1401395399020"; String jsonObjectList = "[{\"last_modified\": \"2014-05-29T20:30:03.845660\", " + "\"bytes\": 19, " + "\"name\": \"" + contentName + "\", " + "\"content_type\": \"application/unknown\"}]"; InputStream stream = Strings2.toInputStream(jsonObjectList); ParseObjectInfoListFromJsonResponse parser = new ParseObjectInfoListFromJsonResponse(new GsonWrapper(new Gson())); GeneratedHttpRequest.Builder builder = new GeneratedHttpRequest.Builder(); builder.method("method") .endpoint("<LINK_0>") .invocation(Invocation.create(Invokable.from(Object.class.getMethod("toString", null)), ImmutableList.<Object>of("container-name", new ListContainerOptions[0]))) .caller(null); parser.setContext(builder.build()); ObjectInfo objectInfo = parser.apply(stream).iterator().next(); assertEquals(objectInfo.getName(), contentName); }
Source:
private Map<String, List<List<Integer>>> generateKeys(Ignite ignite, int keysCnt) { Map<String, List<List<Integer>>> cacheKeys = new HashMap<>(); for (CacheConfiguration cfg : cacheConfigurations()) { String cacheName = cfg.getName(); IgniteCache cache = ignite.cache(cacheName); List<List<Integer>> keys = new ArrayList<>(); for (KeyType keyType : KeyType.values()) { if (cfg.getCacheMode() == LOCAL) continue; if (keyType == KeyType.BACKUP && cfg.getCacheMode() == PARTITIONED && cfg.getBackups() == 0) continue; if (keyType == KeyType.NEAR && cfg.getCacheMode() == REPLICATED) continue; List<Integer> keys0 = findKeys(cache, keysCnt, keyType.getKeyIndex() * 100_000, keyType); assertEquals(cacheName, keysCnt, keys0.size()); keys.add(keys0); } if (!keys.isEmpty()) cacheKeys.put(cacheName, keys); } return cacheKeys; }

Target:
private Map<String, List<List<Integer>>> generateKeys(Ignite ignite, int keysCnt) { Map<String, List<List<Integer>>> cacheKeys = new HashMap<>(); for (CacheConfiguration cfg : cacheConfigurations()) { String cacheName = cfg.getName(); IgniteCache cache = ignite.cache(cacheName); List<List<Integer>> keys = new ArrayList<>(); for (TypePartitionForKey typePartitionForKey : TypePartitionForKey.values()) { if ((cfg.getCacheMode() == LOCAL) || (typePartitionForKey == TypePartitionForKey.BACKUP && cfg.getCacheMode() == PARTITIONED && cfg.getBackups() == 0) || (typePartitionForKey == TypePartitionForKey.OTHER && cfg.getCacheMode() == REPLICATED)) continue; List<Integer> keys0 = findKeys(cache, keysCnt, 0, typePartitionForKey); assertEquals(cacheName, keysCnt, keys0.size()); keys.add(keys0); } if (!keys.isEmpty()) cacheKeys.put(cacheName, keys); } return cacheKeys; }
Source:
public boolean exists(Serializable id) { String columnName = null; boolean doesExists = false; columnName = getPrimaryColumnName(); if (columnName != null) { String jpql = "SELECT count(t) FROM " + entityType.getCanonicalName() + " t WHERE " + columnName + " = :id"; if (this.getEntityManager().createQuery(jpql, Long.class) .setParameter("id", id) .getSingleResult() > 0) { doesExists = true; } } return doesExists; }

Target:
public boolean exists(Serializable id) { boolean doesExists = false; String columnName = getPrimaryKeyName(); if (columnName != null) { CriteriaBuilder builder = this.getEntityManager().getCriteriaBuilder(); CriteriaQuery<Long> query = builder.createQuery(Long.class); query.select(builder.count(query.from(entityType))); Root<E> root = query.from(entityType); query.where(builder.equal(root.get(columnName), id)); if (this.getEntityManager().createQuery(query).getSingleResult() > 0) { doesExists = true; } } return doesExists; }
Source:
public void onBlockFlowTo(BlockFromToEvent event) { Block toblock = event.getToBlock(); Block fromblock = event.getBlock(); if (ElementalAbility.isLava(fromblock)) { event.setCancelled(!EarthPassive.canFlowFromTo(fromblock, toblock)); } if (ElementalAbility.isWater(fromblock)) { event.setCancelled(!WaterBubble.isAir(toblock)); if (!event.isCancelled()) { event.setCancelled(!WaterManipulation.canFlowFromTo(fromblock, toblock)); } if (!event.isCancelled()) { if (Illumination.isIlluminationTorch(block)) { TempBlock temp = TempBlock.get(block); if (temp != null) temp.revertBlock(); } } } }

Target:
public void onBlockFlowTo(BlockFromToEvent event) { Block toblock = event.getToBlock(); Block fromblock = event.getBlock(); if (ElementalAbility.isLava(fromblock)) { event.setCancelled(!EarthPassive.canFlowFromTo(fromblock, toblock)); } if (ElementalAbility.isWater(fromblock)) { event.setCancelled(!WaterBubble.isAir(toblock)); if (!event.isCancelled()) { event.setCancelled(!WaterManipulation.canFlowFromTo(fromblock, toblock)); } if (!event.isCancelled()) { if (Illumination.isIlluminationTorch(toblock)) { TempBlock temp = TempBlock.get(toblock); if (temp != null) temp.revertBlock(); } } } }
Source:
public boolean forgetAllParticipants() { boolean notifiedAll = true; Iterator<LRARecord> iterator = pending.iterator(); while (iterator.hasNext()) { LRARecord record = iterator.next(); if (record.forget()) { iterator.remove(); } else { notifiedAll = false; } } return notifiedAll; }

Target:
public boolean forgetAllParticipants() { if (pending == null) { return true; } pending.removeIf(LRARecord::forget); return pending.isEmpty(); }
Source:
public void binaryExcludedTrue() throws SQLException { boolean original = P6LogOptions.getActiveInstance().getExcludebinary(); try { P6LogOptions.getActiveInstance().setExcludebinary(true); String update = "insert into img values (?, ?, ?)"; PreparedStatement prep = getPreparedStatement(update); prep.setInt(1, 1); prep.setBytes(2, "foo".getBytes(StandardCharsets.UTF_8)); Blob data = connection.createBlob(); data.setBytes(1, "foo".getBytes(StandardCharsets.UTF_8)); prep.setBlob(3, data); prep.execute(); assertTrue(super.getLastLogEntry().contains("insert into img values (1, '[binary]', ")); } finally { P6LogOptions.getActiveInstance().setExcludebinary(original); } }

Target:
public void binaryExcludedTrue() throws SQLException { P6LogOptions.getActiveInstance().setExcludebinary(true); String update = "insert into img values (?, ?, ?)"; PreparedStatement prep = getPreparedStatement(update); prep.setInt(1, 1); prep.setBytes(2, "foo".getBytes(StandardCharsets.UTF_8)); if( "PostgreSQL".equals(db) || "Firebird".equals(db) || "SQLite".equals(db)) { prep.setBytes(3, "foo".getBytes(StandardCharsets.UTF_8)); } else { Blob data = connection.createBlob(); data.setBytes(1, "foo".getBytes(StandardCharsets.UTF_8)); prep.setBlob(3, data); } prep.execute(); assertTrue(super.getLastLogEntry().contains("insert into img values (1, '[binary]', ")); }
Source:
public Set<K> keySet(Predicate predicate) { checkNotNull(predicate, "Predicate cannot be null!"); Set<K> resultingSet = new HashSet<K>(); Set<QueryableEntry> query = indexes.query(predicate, -1); if (query != null) { for (QueryableEntry entry : query) { K key = toObject(entry.getKeyData()); resultingSet.add(key); } } else { doFullKeyScan(predicate, resultingSet); } return resultingSet; }

Target:
public Set<K> keySet(Predicate predicate) { checkNotNull(predicate, "Predicate cannot be null!"); Set<K> resultingSet = new HashSet<K>(); Set<QueryableEntry> query = indexes.query(predicate, SKIP_PARTITIONS_COUNT_CHECK); if (query != null) { for (QueryableEntry entry : query) { K key = toObject(entry.getKeyData()); resultingSet.add(key); } } else { doFullKeyScan(predicate, resultingSet); } return resultingSet; }
Source:
public void testToStringCheckObjectRecursionPrevention() throws Exception { Node n1 = new Node(); Node n2 = new Node(); Node n3 = new Node(); Node n4 = new Node(); n1.name = "n1"; n2.name = "n2"; n3.name = "n3"; n4.name = "n4"; n1.next = n2; n2.next = n3; n3.next = n4; n4.next = n3; try { assertTrue("Wrong toString behaviour", n1.toString().length() == 106); assertTrue("Wrong toString behaviour", n2.toString().length() == 85); assertTrue("Wrong toString behaviour", n3.toString().length() == 64); assertTrue("Wrong toString behaviour", n4.toString().length() == 64); } catch (StackOverflowError e) { fail("Recursion happened."); } }

Target:
public void testToStringCheckObjectRecursionPrevention() throws Exception { Node n1 = new Node(); Node n2 = new Node(); Node n3 = new Node(); Node n4 = new Node(); n1.name = "n1"; n2.name = "n2"; n3.name = "n3"; n4.name = "n4"; n1.next = n2; n2.next = n3; n3.next = n4; n4.next = n3; n1.nodes = new Node[4]; n2.nodes = n1.nodes; n3.nodes = n1.nodes; n4.nodes = n1.nodes; n1.nodes[0] = n1; n1.nodes[1] = n2; n1.nodes[2] = n3; n1.nodes[3] = n4; String expN1 = n1.toString(); String expN2 = n2.toString(); String expN3 = n3.toString(); String expN4 = n4.toString(); info(expN1); info(expN2); info(expN3); info(expN4); info(GridToStringBuilder.toString("Test", "Appended vals", n1)); CyclicBarrier bar = new CyclicBarrier(4); IgniteInternalFuture<String> fut1 = GridTestUtils.runAsync(new BarrierCallable(bar, n1, expN1)); IgniteInternalFuture<String> fut2 = GridTestUtils.runAsync(new BarrierCallable(bar, n2, expN2)); IgniteInternalFuture<String> fut3 = GridTestUtils.runAsync(new BarrierCallable(bar, n3, expN3)); IgniteInternalFuture<String> fut4 = GridTestUtils.runAsync(new BarrierCallable(bar, n4, expN4)); fut1.get(3_000); fut2.get(3_000); fut3.get(3_000); fut4.get(3_000); }
Source:
protected void prepareBuffer() { if (toSend != null && toSend.content() != null) { bufferToSend = PooledByteBufAllocator.DEFAULT.heapBuffer((int) sizeInBytes()); } else { bufferToSend = PooledByteBufAllocator.DEFAULT.heapBuffer( (int) super.sizeInBytes() + (Partition_Response_Info_List_Size + partitionResponseInfoSize)); } writeHeader(); if (partitionResponseInfoList != null) { bufferToSend.writeInt(partitionResponseInfoList.size()); for (PartitionResponseInfo partitionResponseInfo : partitionResponseInfoList) { partitionResponseInfo.writeTo(bufferToSend); } } if (toSend != null) { if (toSend.content() != null) { int maxNumComponent = 1 + toSend.content().nioBufferCount(); CompositeByteBuf compositeByteBuf = bufferToSend.alloc().compositeHeapBuffer(maxNumComponent); compositeByteBuf.addComponent(true, bufferToSend); if (toSend.content() instanceof CompositeByteBuf) { Iterator<ByteBuf> iter = ((CompositeByteBuf) toSend.content()).iterator(); while (iter.hasNext()) { compositeByteBuf.addComponent(true, iter.next()); } } else { compositeByteBuf.addComponent(true, toSend.content()); } bufferToSend = compositeByteBuf; toSend = null; } } }

Target:
protected void prepareBuffer() { bufferToSend = PooledByteBufAllocator.DEFAULT.ioBuffer( (int) super.sizeInBytes() + (Partition_Response_Info_List_Size + partitionResponseInfoSize)); writeHeader(); if (partitionResponseInfoList != null) { bufferToSend.writeInt(partitionResponseInfoList.size()); for (PartitionResponseInfo partitionResponseInfo : partitionResponseInfoList) { partitionResponseInfo.writeTo(bufferToSend); } } if (toSend != null) { if (toSend.content() != null) { int maxNumComponent = 1 + toSend.content().nioBufferCount(); CompositeByteBuf compositeByteBuf = bufferToSend.alloc().compositeHeapBuffer(maxNumComponent); compositeByteBuf.addComponent(true, bufferToSend); if (toSend.content() instanceof CompositeByteBuf) { Iterator<ByteBuf> iter = ((CompositeByteBuf) toSend.content()).iterator(); while (iter.hasNext()) { compositeByteBuf.addComponent(true, iter.next()); } } else { compositeByteBuf.addComponent(true, toSend.content()); } bufferToSend = compositeByteBuf; toSend = null; } } }
Source:
protected DiagramEventBroker getDiagramEventBroker() { TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain(); if (null != theEditingDomain) { return DiagramEventBroker.getInstance(theEditingDomain); } return null; }

Target:
protected DiagramEventBroker getDiagramEventBroker() { DiagramEventBroker eventBorker = null; TransactionalEditingDomain theEditingDomain = ((IGraphicalEditPart) getHost()).getEditingDomain(); if (null != theEditingDomain) { eventBorker = DiagramEventBroker.getInstance(theEditingDomain); } return eventBorker; }
Source:
public ValidationResult checkAccount(String chartOfAccountsCode, String accountNumber) { Account account = accountService.getByPrimaryId(chartOfAccountsCode, accountNumber); String accountErrorMessageString = ConcurConstants.AccountingStringFieldNames.ACCOUNT_NUMBER + CUKFSConstants.COLON + chartOfAccountsCode + KFSConstants.COMMA + accountNumber; return checkMissingOrInactive(account, MessageFormat.format(configurationService.getPropertyValueAsString(KFSKeyConstants.ERROR_EXISTENCE), accountErrorMessageString), MessageFormat.format(configurationService.getPropertyValueAsString(KFSKeyConstants.ERROR_INACTIVE), accountErrorMessageString)); }

Target:
public ValidationResult checkAccount(String chartOfAccountsCode, String accountNumber) { Account account = accountService.getByPrimaryId(chartOfAccountsCode, accountNumber); String accountErrorMessageString = ConcurUtils.formatStringForErrorMessage(ConcurConstants.AccountingStringFieldNames.ACCOUNT_NUMBER, chartOfAccountsCode, accountNumber); return checkMissingOrInactive(account, MessageFormat.format(configurationService.getPropertyValueAsString(KFSKeyConstants.ERROR_EXISTENCE), accountErrorMessageString), MessageFormat.format(configurationService.getPropertyValueAsString(KFSKeyConstants.ERROR_INACTIVE), accountErrorMessageString)); }
Source:
public static void main(String[] args) { String connectionString = "endpoint={endpoint_value};id={id_value};secret={secret_value}"; final ConfigurationAsyncClient client = new ConfigurationClientBuilder() .connectionString(connectionString) .buildAsyncClient(); final String key = "hello"; final String value = "world"; client.setConfigurationSetting(key, null, value).subscribe( result -> { final ConfigurationSetting setting = result; System.out.println(String.format("[SetConfigurationSetting] Key: %s, Value: %s", setting.getKey(), setting.getValue())); }, error -> System.err.println("There was an error while adding the setting: " + error.toString()), () -> System.out.println(String.format("Set setting with key=%s and value=%s added or updated.", key, value))); client.setReadOnly(key, null).subscribe( result -> { final ConfigurationSetting setting = result; System.out.println(String.format("[Read-Only Setting] Key: %s, Value: %s", setting.getKey(), setting.getValue())); }, error -> System.err.println("There was an error while making the setting to read-only: " + error.toString()), null ); client.clearReadOnly(key, null).subscribe( result -> { final ConfigurationSetting setting = result; System.out.println(String.format("[Cleared Read-Only Setting] Key: %s, Value: %s", setting.getKey(), setting.getValue())); }, error -> System.err.println("There was an error while making the setting to read-only: " + error.toString()), null ); }

Target:
public static void main(String[] args) { String connectionString = "endpoint={endpoint_value};id={id_value};secret={secret_value}"; final ConfigurationAsyncClient client = new ConfigurationClientBuilder() .connectionString(connectionString) .buildAsyncClient(); final String key = "hello"; final String value = "world"; client.setConfigurationSetting(key, null, value).subscribe( result -> { final ConfigurationSetting setting = result; System.out.printf(String.format("[SetConfigurationSetting] Key: %s, Value: %s", setting.getKey(), setting.getValue())); }, error -> System.err.println("There was an error while adding the setting: " + error), () -> System.out.printf(String.format("Set setting with key=%s and value=%s added or updated.", key, value))); client.setReadOnly(key, null).subscribe( result -> { final ConfigurationSetting setting = result; System.out.printf(String.format("[Read-Only Setting] Key: %s, Value: %s", setting.getKey(), setting.getValue())); }, error -> System.err.println("There was an error while making the setting to read-only: " + error), null ); client.clearReadOnly(key, null).subscribe( result -> { final ConfigurationSetting setting = result; System.out.printf(String.format("[Cleared Read-Only Setting] Key: %s, Value: %s", setting.getKey(), setting.getValue())); }, error -> System.err.println("There was an error while making the setting to read-only: " + error), null ); }
Source:
public void setUp() throws Exception { this.client = helper.createClientForBasicAuth(); this.project = helper.getOrCreateIntegrationTestProject(client); IImageStream is = client.getResourceFactory().stub( ResourceKind.IMAGE_STREAM, IntegrationTestHelper.appendRandom("ruby-hello-world"), project.getName()); LOG.debug("Creating imagestream {}", is); this.is = client.create(is); LOG.debug("Generated imagestream {}", is); IBuildConfigBuilder builder = client.adapt(IBuildConfigBuilder.class); assertNotNull("Exp. the client to be able to use a buildconfigbuilder", builder); LOG.debug("Creating BUILDCONFIG {}", bc); this.bc = client.create( helper.stubBuildConfig(client, project.getNamespaceName(), IntegrationTestHelper.appendRandom("test-bc"), "<LINK_0>", Collections.emptyMap())); LOG.debug("Created BUILDCONFIG {}", bc); assertNotNull(bc); }

Target:
public void setUp() throws Exception { this.client = helper.createClientForBasicAuth(); this.project = helper.getOrCreateIntegrationTestProject(client); IImageStream is = client.getResourceFactory().stub( ResourceKind.IMAGE_STREAM, IntegrationTestHelper.appendRandom("ruby-hello-world"), project.getName()); LOG.debug("Creating imagestream {}", is); this.is = client.create(is); LOG.debug("Generated imagestream {}", is); IBuildConfigBuilder builder = client.adapt(IBuildConfigBuilder.class); assertNotNull("Exp. the client to be able to use a buildconfigbuilder", builder); LOG.debug("Creating BuildConfig {}", bc); this.bc = client.create( helper.stubBuildConfig(client, project.getNamespaceName(), IntegrationTestHelper.appendRandom("test-bc"), "<LINK_0>", Collections.emptyMap())); LOG.debug("Created BuildConfig {}", bc); assertNotNull(bc); }
Source:
@Override public boolean onDone(@Nullable Boolean res, @Nullable Throwable err, boolean cancel) { assert !cancel; long time = System.currentTimeMillis(); if (startTime != -1) endTime.compareAndSet(-1, time); boolean byThisCall = super.onDone(res, err, cancel); if (byThisCall && (res == false || isFailed())) lastCancelledTime.accumulateAndGet(time, Math::max); return byThisCall; }

Target:
@Override public boolean onDone(@Nullable Boolean res, @Nullable Throwable err, boolean cancel) { assert !cancel : "RebalanceFuture cancel is not supported. Use res = false."; boolean byThisCall = super.onDone(res, err, cancel); boolean isCancelled = res == Boolean.FALSE || isFailed(); if (byThisCall) { if (isCancelled) lastCancelledTime.accumulateAndGet(System.currentTimeMillis(), Math::max); else if (startTime != -1) endTime = System.currentTimeMillis(); } return byThisCall; }
Source:
public void updateParentCommandId(ArrayList<VdcActionParametersBase> parameters, CommandBase command) { for (VdcActionParametersBase param : parameters) { param.setParentCommand(command.getActionType()); param.setParentParameters(command.getParameters()); } }

Target:
public void updateParentCommandId(ArrayList<VdcActionParametersBase> parameters, CommandBase command) { parameters.forEach(param -> { param.setParentCommand(command.getActionType()); param.setParentParameters(command.getParameters()); }); }