auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected Object doExecute() throws Exception { printInitCommand("Create Static Route"); try { IResource router = getResourceFromFriendlyName(resourceId); <START> StaticRouteCapability staticRouteCapability=(StaticRouteCapability) router.getCapabilitiesByInterface(IStaticRouteCapability.class); <END> staticRouteCapability.createStaticRoute(netIdIpAdress, maskIpAdress, nextHopIpAddress); } catch (ResourceException e) { printError(e); printEndCommand(); return -1; } catch (Exception e) { printError("Error creating Static route."); printError(e); printEndCommand(); return -1; } printEndCommand(); return null; }</code><technical_language>IStaticRouteCapability instead of implementation. Ideally, implementation in tests</technical_language>

Target:
protected Object doExecute() throws Exception { printInitCommand("Create Static Route"); try { IResource router = getResourceFromFriendlyName(resourceId); IStaticRouteCapability staticRouteCapability=(IStaticRouteCapability) router.getCapabilitiesByInterface(IStaticRouteCapability.class); staticRouteCapability.createStaticRoute(netIdIpAdress, maskIpAdress, nextHopIpAddress); } catch (ResourceException e) { printError(e); printEndCommand(); return -1; } catch (Exception e) { printError("Error creating Static route."); printError(e); printEndCommand(); return -1; } printEndCommand(); return null; }
Source:
<code>public void verifyFromModuleHasImages() { <START> List<WebElement> communityImagesList = driver.findElements(fromCommunityImageBy); <END> for (int i = 0; i < communityImagesList.size(); i++) { PageObjectLogging.log("verifyFromModuleHasImages", "Checking image number "+(i+1), true); scrollToElement(communityImagesList.get(i)); waitForElementByElement(communityImagesList.get(i)); } PageObjectLogging.log("verifyFromModuleHasImages", "Verify that from the community module has images", true); }</code><technical_language>move this UI mapping</technical_language>

Target:
public void verifyFromModuleHasImages() { for (WebElement element : fromCommunityImage) { scrollToElement(element); waitForElementByElement(element); } PageObjectLogging.log( "verifyFromModuleHasImages", "Verify that from the community module has images", true ); }
Source:
<code>protected String getExpectedMailContent(DocumentModel documentModel, Event event) { URL url = TestEmailNotification.class.getResource("/templates/dummyExpectedMail.html"); <START> String author = ((String[]) documentModel.getPropertyValue("dc:contributors"))[0]; <END> try { String content = Files.readString(Paths.get(url.toURI())); var model = Map.of("TITLE", documentModel.getTitle(), "CREATION_DATE", EVENT_DATE_FORMAT.format(Date.from(Instant.ofEpochMilli(event.getTime()))), "AUTHOR", author, "LOCATION", documentModel.getPathAsString(), "VERSION", documentModel.getVersionLabel(), "STATE", documentModel.getCurrentLifeCycleState()); return StringUtils.expandVars(content, model).replaceAll("\\n", ""); } catch (URISyntaxException | IOException e) { throw new NuxeoException(e); } }</code><technical_language>put Map.of, for other fields</technical_language>

Target:
protected String getExpectedMailContent(DocumentModel documentModel, Event event) { try { URL url = TestEmailNotification.class.getResource("/templates/dummyExpectedMail.html"); String fileContent = Files.readString(Paths.get(url.toURI())); var model = Map.of("TITLE", documentModel.getTitle(), "CREATION_DATE", EVENT_DATE_FORMAT.format(Date.from(Instant.ofEpochMilli(event.getTime()))), "AUTHOR", ((String[]) documentModel.getPropertyValue("dc:contributors"))[0], "LOCATION", documentModel.getPathAsString(), "VERSION", documentModel.getVersionLabel(), "STATE", documentModel.getCurrentLifeCycleState()); String content = StringUtils.expandVars(fileContent, model); return content.replaceAll("\\n", ""); } catch (URISyntaxException | IOException e) { throw new NuxeoException(e); } }
Source:
<code><START> public boolean shouldSortOptions() { <END> return shouldSortOptions; }</code><technical_language>propose "boolean isSortOptions()" JavaBeans standard in naming of "getUsageWidth()"</technical_language>

Target:
boolean shouldSortOptions() { return shouldSortOptions; }
Source:
<code>public void prepareDAG(LogicalPlan dag, StreamingApplication app, String name) { String connectAddress = conf.get(StreamingApplication.DT_PREFIX + Context.DAGContext.GATEWAY_CONNECT_ADDRESS.getName()); dag.setAttribute(Context.DAGContext.GATEWAY_CONNECT_ADDRESS, connectAddress == null ? conf.get(GATEWAY_LISTEN_ADDRESS) : connectAddress); if (app != null) { app.populateDAG(dag, conf); } String appAlias = getAppAlias(name); String appName = appAlias == null ? name : appAlias; List<AppConf> appConfs = stramConf.getMatchingChildConf(appName, StramElement.APPLICATION); setApplicationConfiguration(dag, appConfs, app); if (dag.getAttributes().get(Context.DAGContext.APPLICATION_NAME) == null) { dag.setAttribute(Context.DAGContext.APPLICATION_NAME, appName); } setModuleProperties(dag, appName); flattenDAG(dag, conf); setOperatorConfiguration(dag, appConfs, appName); setStreamConfiguration(dag, appConfs, appName); <START> <END> }</code><technical_language>Extra newline</technical_language>

Target:
public void prepareDAG(LogicalPlan dag, StreamingApplication app, String name) { String connectAddress = conf.get(StreamingApplication.DT_PREFIX + Context.DAGContext.GATEWAY_CONNECT_ADDRESS.getName()); dag.setAttribute(Context.DAGContext.GATEWAY_CONNECT_ADDRESS, connectAddress == null ? conf.get(GATEWAY_LISTEN_ADDRESS) : connectAddress); DAGSetupPluginContext context = new DAGSetupPluginContext(dag, this.conf); if (app != null) { pluginManager.dispatch(SETUP, context); pluginManager.dispatch(PRE_POPULATE, context); app.populateDAG(dag, conf); pluginManager.dispatch(POST_POPULATE, context); } pluginManager.dispatch(PRE_CONFIGURE, context); String appAlias = getAppAlias(name); String appName = appAlias == null ? name : appAlias; List<AppConf> appConfs = stramConf.getMatchingChildConf(appName, StramElement.APPLICATION); setApplicationConfiguration(dag, appConfs, app); if (dag.getAttributes().get(Context.DAGContext.APPLICATION_NAME) == null) { dag.setAttribute(Context.DAGContext.APPLICATION_NAME, appName); } setModuleProperties(dag, appName); flattenDAG(dag, conf); setOperatorConfiguration(dag, appConfs, appName); setStreamConfiguration(dag, appConfs, appName); pluginManager.dispatch(POST_CONFIGURE, context); }
Source:
<code>public void close() { <START> logger.trace("Closing the SocketNetworkClient"); <END> closed = true; }</code><technical_language>minor: change SocketNetworkClient LocalNetworkClient in line 98 102</technical_language>

Target:
public void close() { logger.trace("Closing the LocalNetworkClient"); closed = true; }
Source:
<code>public List<Tree.Kind> nodesToVisit() { <START> return ImmutableList.of(Tree.Kind.METHOD); <END> }</code><technical_language>Collections.singletonList guava for this</technical_language>

Target:
public List<Tree.Kind> nodesToVisit() { return Collections.singletonList(Tree.Kind.METHOD); }
Source:
<code><START> public ClassifierCompositeItemWriterBuilder classifier(Classifier<T, ItemWriter<? super T>> classifier) { <END> Assert.notNull(classifier, "A classifier is required."); this.classifier = classifier; return this; }</code><technical_language>Missing generic return</technical_language>

Target:
public ClassifierCompositeItemWriterBuilder<T> classifier(Classifier<T, ItemWriter<? super T>> classifier) { this.classifier = classifier; return this; }
Source:
<code>public Date getDcTermsDate() { <START> return dcTermsDate; <END> }</code><technical_language>return new Date(dcTermsDate);</technical_language>

Target:
public Date getDcTermsDate() { if (dcTermsDate == null) { return dcTermsDate; } return new Date(dcTermsDate.getTime()); }
Source:
<code>public void publishUpdate(String id, boolean isPresent) { for (AKM868BindingProvider provider : providers) { for (String itemName : provider.getItemNames()) { if (provider.getId(itemName).equals(id) && provider.getChannel(itemName).equals("0")) { <START> logger.debug("Publishing state for: "+itemName+" -state: "+provider.getId(itemName)); <END> eventPublisher.postUpdate(itemName, isPresent==true ? OnOffType.ON : OnOffType.OFF); } } } }</code><technical_language>parameterised logging</technical_language>

Target:
public void publishUpdate(String id, boolean isPresent) { for (AKM868BindingProvider provider : providers) { for (String itemName : provider.getItemNames()) { if (provider.getId(itemName).equals(id) && provider.getChannel(itemName).equals("0")) { logger.debug("Publishing state for - state: ",itemName,provider.getId(itemName)); eventPublisher.postUpdate(itemName, isPresent==true ? OnOffType.ON : OnOffType.OFF); } } } }
Source:
<code>public void testStoreAndQueryAll() { Trace trace1 = new Trace(); trace1.setId("1"); <START> trace1.setStartTime(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis()) - 4000); END> List<Trace> traces = new ArrayList<>(); traces.add(trace1); try { tracePublisher.publish(null, traces); } catch (Exception e1) { fail("Failed to store: " + e1); } Wait.until(() -> traceService.searchFragments(null, new Criteria()).size() == 1); List<Trace> result = traceService.searchFragments(null, new Criteria()); assertEquals(1, result.size()); assertEquals("1", result.get(0).getId()); }</code><technical_language>issue converting 4000 microseconds - if change is applied other files</technical_language>

Target:
public void testStoreAndQueryAll() { Trace trace1 = new Trace(); trace1.setId("1"); trace1.setStartTime(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis()) - FOUR_MS_IN_MICRO_SEC); List<Trace> traces = new ArrayList<>(); traces.add(trace1); try { tracePublisher.publish(null, traces); } catch (Exception e1) { fail("Failed to store: " + e1); } Wait.until(() -> traceService.searchFragments(null, new Criteria()).size() == 1); List<Trace> result = traceService.searchFragments(null, new Criteria()); assertEquals(1, result.size()); assertEquals("1", result.get(0).getId()); }
Source:
<code>protected Collection<Event> analyzePosition(Position position) { Device device = Context.getIdentityManager().getDeviceById(position.getDeviceId()); if (device == null) { return null; } if (!Context.getIdentityManager().isLatestPosition(position) || !position.getValid()) { return null; } Collection<Event> result = null; boolean ignition = false; Object ignitionObject = position.getAttributes().get(Position.KEY_IGNITION); if (ignitionObject != null && Boolean.parseBoolean(ignitionObject.toString())) { ignition = true; } boolean oldIgnition = false; Object oldIgnitionObject = null; Position lastPosition = Context.getIdentityManager().getLastPosition(position.getDeviceId()); if (lastPosition != null) { oldIgnitionObject = lastPosition.getAttributes().get(Position.KEY_IGNITION); } <START> if (oldIgnitionObject != null && Boolean.parseBoolean(oldIgnitionObject.toString())) { <END> oldIgnition = true; } if (ignition && !oldIgnition) { result = new ArrayList<>(); result.add(new Event(Event.TYPE_IGNITION_ON, position.getDeviceId(), position.getId())); } else if (!ignition && oldIgnition) { result = new ArrayList<>(); result.add(new Event(Event.TYPE_IGNITION_OFF, position.getDeviceId(), position.getId())); } return result; }</code><technical_language>Ignition boolean value. If not, ignore it</technical_language>

Target:
protected Collection<Event> analyzePosition(Position position) { Device device = Context.getIdentityManager().getDeviceById(position.getDeviceId()); if (device == null) { return null; } if (!Context.getIdentityManager().isLatestPosition(position) || !position.getValid()) { return null; } Collection<Event> result = null; boolean ignition = false; Object ignitionObject = position.getAttributes().get(Position.KEY_IGNITION); if (ignitionObject != null && ignitionObject instanceof Boolean) { ignition = (Boolean) ignitionObject; } boolean oldIgnition = false; Object oldIgnitionObject = null; Position lastPosition = Context.getIdentityManager().getLastPosition(position.getDeviceId()); if (lastPosition != null) { oldIgnitionObject = lastPosition.getAttributes().get(Position.KEY_IGNITION); } if (oldIgnitionObject != null && oldIgnitionObject instanceof Boolean) { oldIgnition = (Boolean) oldIgnitionObject; } if (ignition && !oldIgnition) { result = new ArrayList<>(); result.add(new Event(Event.TYPE_IGNITION_ON, position.getDeviceId(), position.getId())); } else if (!ignition && oldIgnition) { result = new ArrayList<>(); result.add(new Event(Event.TYPE_IGNITION_OFF, position.getDeviceId(), position.getId())); } return result; }
Source:
<code>protected void openGitTreeCompare(IResource[] resources, String leftRev, String rightRev, boolean includeLocal) { Display display = PlatformUI.getWorkbench().getDisplay(); display.asyncExec(new Runnable() { @Override public void run() { CompareTreeView view; try { view = (CompareTreeView) PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getActivePage() .showView(CompareTreeView.ID); <START> if (includeLocal) <END> view.setInput(resources, rightRev); else view.setInput(resources, leftRev, rightRev); } catch (PartInitException e) { Activator.handleError(e.getMessage(), e, true); } } }); }</code><technical_language>style nit: missing braces</technical_language>

Target:
protected void openGitTreeCompare(IResource[] resources, String leftRev, String rightRev, boolean includeLocal) { Display display = PlatformUI.getWorkbench().getDisplay(); display.asyncExec(new Runnable() { @Override public void run() { CompareTreeView view; try { view = (CompareTreeView) PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getActivePage() .showView(CompareTreeView.ID); if (includeLocal) { view.setInput(resources, rightRev); } else { view.setInput(resources, leftRev, rightRev); } } catch (PartInitException e) { Activator.handleError(e.getMessage(), e, true); } } }); }
Source:
<code>protected Object doGetValue() { CapsulePartKindEnum kind = null; setUMLPropertiesValue(); if (capsulePartElement.getLower() == capsulePartElement.getUpper()) { kind = CapsulePartKindEnum.FIXED; <START> } else if (capsulePartElement.getLower() == 0) { <END> if (AggregationKind.COMPOSITE_LITERAL.equals(aggregation)) { kind = CapsulePartKindEnum.OPTIONAL; } else if (AggregationKind.SHARED_LITERAL.equals(aggregation)) { kind = CapsulePartKindEnum.PLUGIN; } } return kind; }</code><technical_language>invert == 0</technical_language>

Target:
protected Object doGetValue() { CapsulePartKindEnum kind = null; setUMLPropertiesValue(); if (capsulePartElement.getLower() == capsulePartElement.getUpper()) { kind = CapsulePartKindEnum.FIXED; } else if (0 == capsulePartElement.getLower()) { if (AggregationKind.COMPOSITE_LITERAL.equals(aggregation)) { kind = CapsulePartKindEnum.OPTIONAL; } else if (AggregationKind.SHARED_LITERAL.equals(aggregation)) { kind = CapsulePartKindEnum.PLUGIN; } } return kind; }
Source:
<code>private void initDataReader(Encoding dataEncoding, byte[] bytes, int offset, int valueCount) { ValuesReader previousReader = this.dataColumn; this.currentEncoding = dataEncoding; this.pageValueCount = valueCount; this.endOfPageValueCount = readValues + pageValueCount; if (dataEncoding.usesDictionary()) { if (dictionary == null) { throw new ParquetDecodingException( "could not read page in col " + path + " as the dictionary was missing for encoding " + dataEncoding); } this.dataColumn = dataEncoding.getDictionaryBasedValuesReader(path, VALUES, dictionary); } else { this.dataColumn = dataEncoding.getValuesReader(path, VALUES); } if (dataEncoding.usesDictionary() && converter.hasDictionarySupport()) { bindToDictionary(dictionary); } else { bind(path.getType()); } try { dataColumn.initFromPage(pageValueCount, bytes, offset); } catch (IOException e) { throw new ParquetDecodingException("could not read page in col " + path, e); } <START> if (dataEncoding.requiresSequentialReads(writerVersion) && previousReader != null) { <END> ((RequiresPreviousReader) dataColumn).setPreviousReader(previousReader); } }</code><technical_language>Is this code for case of fixing DeltaByteArrayReader bug? If is, is generalization of RequiresPreviousReader necessary</technical_language>

Target:
private void initDataReader(Encoding dataEncoding, byte[] bytes, int offset, int valueCount) { ValuesReader previousReader = this.dataColumn; this.currentEncoding = dataEncoding; this.pageValueCount = valueCount; this.endOfPageValueCount = readValues + pageValueCount; if (dataEncoding.usesDictionary()) { if (dictionary == null) { throw new ParquetDecodingException( "could not read page in col " + path + " as the dictionary was missing for encoding " + dataEncoding); } this.dataColumn = dataEncoding.getDictionaryBasedValuesReader(path, VALUES, dictionary); } else { this.dataColumn = dataEncoding.getValuesReader(path, VALUES); } if (dataEncoding.usesDictionary() && converter.hasDictionarySupport()) { bindToDictionary(dictionary); } else { bind(path.getType()); } try { dataColumn.initFromPage(pageValueCount, bytes, offset); } catch (IOException e) { throw new ParquetDecodingException("could not read page in col " + path, e); } if (CorruptDeltaByteArrays.requiresSequentialReads(writerVersion, dataEncoding) && previousReader != null && previousReader instanceof RequiresPreviousReader) { ((RequiresPreviousReader) dataColumn).setPreviousReader(previousReader); } }
Source:
<code>public IBinding getTemplateDefinition() { <START> return getValue().getTemplateDefinition(); <END> }</code><technical_language>parent.getTemplateDefinition()</technical_language>

Target:
public IBinding getTemplateDefinition() { return parent.getTemplateDefinition(); }
Source:
<code>public void createCheckout(final Product product, final Callback<Checkout> callback) { Cart cart = new Cart(); cart.addVariant(product.getVariants().get(0)); checkout = new Checkout(cart); Address address = new Address(); address.setFirstName("Dinosaur"); address.setLastName("Banana"); address.setAddress1("421 8th Ave"); address.setCity("New York"); address.setProvince("NY"); address.setZip("10001"); address.setCountryCode("US"); checkout.setShippingAddress(address); <START> if (customer != null) { <END> checkout.setEmail(customer.getEmail()); } else { checkout.setEmail("something@somehost.com"); } checkout.setWebReturnToUrl(getString(R.string.web_return_to_url)); checkout.setWebReturnToLabel(getString(R.string.web_return_to_label)); buyClient.createCheckout(checkout, wrapCheckoutCallback(callback)); }</code><technical_language>set address based Customer information if is available. Customer a default address in it</technical_language>

Target:
public void createCheckout(final Product product, final Callback<Checkout> callback) { Cart cart = new Cart(); cart.addVariant(product.getVariants().get(0)); checkout = new Checkout(cart); if (customer != null) { checkout.setEmail(customer.getEmail()); } else { checkout.setEmail("something@somehost.com"); } if (customer != null && customer.getDefaultAddress() != null) { checkout.setShippingAddress(customer.getDefaultAddress()); } else { final Address address = new Address(); address.setFirstName("Dinosaur"); address.setLastName("Banana"); address.setAddress1("421 8th Ave"); address.setCity("New York"); address.setProvince("NY"); address.setZip("10001"); address.setCountryCode("US"); checkout.setShippingAddress(address); } checkout.setWebReturnToUrl(getString(R.string.web_return_to_url)); checkout.setWebReturnToLabel(getString(R.string.web_return_to_label)); buyClient.createCheckout(checkout, wrapCheckoutCallback(callback)); }
Source:
<code>private void handleProcessShutdown(Signal lastSignal) { if (Thread.interrupted()) { Signal cleanup = Signal.of(CLEANUP, lastSignal.getTarget()); <START> logger.info("Consumer process was interrupted. Its last processed signal is {}. Accepting {}", lastSignal, cleanup); <END> accept(cleanup); } else { accept(lastSignal.childOf(CLEANUP)); } }</code><technical_language>Inconsistent logging. Please consider earlier suggestion</technical_language>

Target:
private void handleProcessShutdown(Signal lastSignal) { if (Thread.interrupted()) { Signal cleanup = Signal.of(CLEANUP, lastSignal.getTarget()); logger.info("Consumer process was interrupted. Its last processed signal is {}. Accepting {}", lastSignal, cleanup); accept(cleanup); } else { accept(lastSignal.createChild(CLEANUP)); } }
Source:
<code>public Response undoSnapshot(Action action) { RestoreAllSnapshotsParameters restoreParams = new RestoreAllSnapshotsParameters(guid, SnapshotActionEnum.UNDO); <START> Response response = doAction(VdcActionType.RestoreAllSnapshots, <END> restoreParams, action); return response; }</code><technical_language>sorry, noticed this - calling performAction() doAction()</technical_language>

Target:
public Response undoSnapshot(Action action) { RestoreAllSnapshotsParameters restoreParams = new RestoreAllSnapshotsParameters(guid, SnapshotActionEnum.UNDO); Response response = performAction(VdcActionType.RestoreAllSnapshots, restoreParams, action); return response; }
Source:
<code>private void PostUpdatePriority() { ArrayList<EntityModel> items = new ArrayList<EntityModel>(); EntityModel tempVar = new EntityModel(); tempVar.setTitle(ConstantsManager.getInstance().getConstants().lowTitle()); tempVar.setEntity(1); items.add(tempVar); EntityModel tempVar2 = new EntityModel(); tempVar2.setTitle(ConstantsManager.getInstance().getConstants().mediumTitle()); tempVar2.setEntity(cachedMaxPriority / 2); items.add(tempVar2); EntityModel tempVar3 = new EntityModel(); tempVar3.setTitle(ConstantsManager.getInstance().getConstants().highTitle()); tempVar3.setEntity(cachedMaxPriority); items.add(tempVar3); EntityModel oldPriority = (EntityModel) getModel().getPriority().getSelectedItem(); getModel().getPriority().setItems(items); if (oldPriority != null) { for (EntityModel item : items) { int val1 = (Integer) item.getEntity(); int val2 = (Integer) oldPriority.getEntity(); <START> if ((Integer.valueOf(val1)).equals(val2)) <END> { getModel().getPriority().setSelectedItem(item); break; } } } else { getModel().getPriority().setSelectedItem(Linq.FirstOrDefault(items)); } }</code><technical_language>define val1 val2 integers instead of ints. This solve NPE if item oldPriority nulls</technical_language>

Target:
private void PostUpdatePriority() { ArrayList<EntityModel> items = new ArrayList<EntityModel>(); EntityModel tempVar = new EntityModel(); tempVar.setTitle(ConstantsManager.getInstance().getConstants().lowTitle()); tempVar.setEntity(1); items.add(tempVar); EntityModel tempVar2 = new EntityModel(); tempVar2.setTitle(ConstantsManager.getInstance().getConstants().mediumTitle()); tempVar2.setEntity(cachedMaxPriority / 2); items.add(tempVar2); EntityModel tempVar3 = new EntityModel(); tempVar3.setTitle(ConstantsManager.getInstance().getConstants().highTitle()); tempVar3.setEntity(cachedMaxPriority); items.add(tempVar3); EntityModel oldPriority = (EntityModel) getModel().getPriority().getSelectedItem(); getModel().getPriority().setItems(items); if (oldPriority != null) { for (EntityModel item : items) { Integer val1 = (Integer)item.getEntity(); Integer val2 = (Integer)oldPriority.getEntity(); if (val1 != null && val1.equals(val2)) { getModel().getPriority().setSelectedItem(item); break; } } } else { getModel().getPriority().setSelectedItem(Linq.FirstOrDefault(items)); } }
Source:
<code>public String removeCategory() { <START> logger.debug("removeCategory"); <END> getFileDescriptions(); fetchMetadataEdit(); return super.removeCategory(); }</code><technical_language>Add context log message</technical_language>

Target:
public String removeCategory() { logger.debug("RemoveCategory in multiple resource action for id {}", this.getResourceId()); getFileDescriptions(); fetchMetadataEdit(); return super.removeCategory(); }
Source:
<code>public void init() throws Throwable { LogPosition recoveryFromPosition = spi.getPositionToRecoverFrom(); if ( LogPosition.UNSPECIFIED.equals( recoveryFromPosition ) ) { return; } monitor.recoveryRequired( recoveryFromPosition ); spi.startRecovery(); long checkpointTxId = TransactionIdStore.BASE_TX_ID; try ( TransactionCursor transactionsToRecover = spi.getTransactionsInReverseOrder( recoveryFromPosition ); <START> RecoveryApplier recoveryVisitor = spi.getRecoveryApplier( REVERSE_RECOVERY ); ) <END> { while ( transactionsToRecover.next() ) { recoveryVisitor.visit( transactionsToRecover.get() ); checkpointTxId = transactionsToRecover.get().getCommitEntry().getTxId(); } } monitor.reverseStoreRecoveryCompleted( checkpointTxId ); LogPosition recoveryToPosition; CommittedTransactionRepresentation lastTransaction = null; try ( TransactionCursor transactionsToRecover = spi.getTransactions( recoveryFromPosition ); RecoveryApplier recoveryVisitor = spi.getRecoveryApplier( RECOVERY ); ) { while ( transactionsToRecover.next() ) { lastTransaction = transactionsToRecover.get(); long txId = lastTransaction.getCommitEntry().getTxId(); recoveryVisitor.visit( lastTransaction ); monitor.transactionRecovered( txId ); numberOfRecoveredTransactions++; } recoveryToPosition = transactionsToRecover.position(); } if ( recoveryToPosition.equals( LogPosition.UNSPECIFIED ) ) { recoveryToPosition = recoveryFromPosition; } spi.allTransactionsRecovered( lastTransaction, recoveryToPosition ); recoveredLog = true; }</code><technical_language>spaces a top</technical_language>

Target:
public void init() throws Throwable { LogPosition recoveryFromPosition = spi.getPositionToRecoverFrom(); if ( LogPosition.UNSPECIFIED.equals( recoveryFromPosition ) ) { return; } monitor.recoveryRequired( recoveryFromPosition ); spi.startRecovery(); long lowestRecoveredTxId = TransactionIdStore.BASE_TX_ID; try ( TransactionCursor transactionsToRecover = spi.getTransactionsInReverseOrder( recoveryFromPosition ); RecoveryApplier recoveryVisitor = spi.getRecoveryApplier( REVERSE_RECOVERY ); ) { while ( transactionsToRecover.next() ) { recoveryVisitor.visit( transactionsToRecover.get() ); lowestRecoveredTxId = transactionsToRecover.get().getCommitEntry().getTxId(); } } monitor.reverseStoreRecoveryCompleted( lowestRecoveredTxId ); LogPosition recoveryToPosition; CommittedTransactionRepresentation lastTransaction = null; try ( TransactionCursor transactionsToRecover = spi.getTransactions( recoveryFromPosition ); RecoveryApplier recoveryVisitor = spi.getRecoveryApplier( RECOVERY ); ) { while ( transactionsToRecover.next() ) { lastTransaction = transactionsToRecover.get(); long txId = lastTransaction.getCommitEntry().getTxId(); recoveryVisitor.visit( lastTransaction ); monitor.transactionRecovered( txId ); numberOfRecoveredTransactions++; } recoveryToPosition = transactionsToRecover.position(); } if ( recoveryToPosition.equals( LogPosition.UNSPECIFIED ) ) { recoveryToPosition = recoveryFromPosition; } spi.allTransactionsRecovered( lastTransaction, recoveryToPosition ); recoveredLog = true; }
Source:
<code>private double logTransitionProbability(final Integer currentState, final Integer nextState, final double distance) { final double pRemember = Math.exp(-distance / memoryLength); <START> return Math.log((nextState == currentState ? pRemember : 0) + (1 - pRemember)*weights[nextState]); <END> }</code><technical_language>intellij suggests nextState.equals(currentState)</technical_language>

Target:
private double logTransitionProbability(final Integer currentState, final Integer nextState, final double distance) { final double pRemember = Math.exp(-distance / memoryLength); return Math.log((nextState.equals(currentState) ? pRemember : 0) + (1 - pRemember)*weights[nextState]); }
Source:
<code>public boolean loadBlocks(Function<Path, DumpWalker> walkerFactory, Path... paths) { if (ArrayUtils.isEmpty(paths)) { <START> throw new FatalEthereumException("There is nothing to import."); <END> } initPipelines(); AtomicLong maxBlockNumber = new AtomicLong(); boolean allBlocksImported; try { for (Path dump : paths) { try (DumpWalker walker = walkerFactory.apply(dump)) { walker.forEach(rlp -> { Block block = new Block(rlp); if (maxBlockNumber.get() < block.getNumber()) { maxBlockNumber.set(block.getNumber()); } exec1.push(block); }); } } exec1.join(); dbFlushManager.flushSync(); allBlocksImported = maxBlockNumber.get() == blockchain.getBestBlock().getNumber(); } catch (Exception e) { e.printStackTrace(); allBlocksImported = false; } if (allBlocksImported) { System.out.printf("All of %s blocks was successfully loaded.\n", maxBlockNumber); } else { System.out.printf("Some blocks have been lost during the loading."); } return allBlocksImported; }</code><technical_language>This fatal input me. 0 input, 0 processed, fine</technical_language>

Target:
public boolean loadBlocks(Function<Path, DumpWalker> walkerFactory, Path... paths) { if (ArrayUtils.isEmpty(paths)) { logger.warn("There is nothing to import."); return false; } initPipelines(); AtomicLong maxBlockNumber = new AtomicLong(); boolean allBlocksImported; try { for (Path dump : paths) { try (DumpWalker walker = walkerFactory.apply(dump)) { walker.forEach(rlp -> { Block block = new Block(rlp); if (maxBlockNumber.get() < block.getNumber()) { maxBlockNumber.set(block.getNumber()); } exec1.push(block); }); } } exec1.join(); dbFlushManager.flushSync(); allBlocksImported = maxBlockNumber.get() == blockchain.getBestBlock().getNumber(); } catch (Exception e) { e.printStackTrace(); allBlocksImported = false; } if (allBlocksImported) { System.out.printf("All of %s blocks was successfully loaded.\n", maxBlockNumber); } else { System.out.printf("Some blocks have been lost during the loading."); } return allBlocksImported; }
Source:
<code>public <NEW_TYPE> FluentIterable<NEW_TYPE> map(Function<? super TYPE, NEW_TYPE> function) { return new LazyFluentIterable<NEW_TYPE>() { @Override public Iterator<NEW_TYPE> iterator() { return new DecoratingIterator<NEW_TYPE>(null) { Iterator<TYPE> oldTypeIterator = iterable.iterator(); @Override public NEW_TYPE computeNext() { <START> while(true) { <END> if(oldTypeIterator.hasNext()) { TYPE candidate = oldTypeIterator.next(); return function.apply(candidate); } return null; } } }; } }; }</code><technical_language>Logic: while(oldTypeIterator.hasNext())</technical_language>

Target:
public <NEW_TYPE> FluentIterable<NEW_TYPE> map(Function<? super TYPE, NEW_TYPE> function) { return new LazyFluentIterable<NEW_TYPE>() { @Override public Iterator<NEW_TYPE> iterator() { return new DecoratingIterator<NEW_TYPE>(null) { Iterator<TYPE> oldTypeIterator = iterable.iterator(); @Override public NEW_TYPE computeNext() { while (oldTypeIterator.hasNext()) { TYPE candidate = oldTypeIterator.next(); return function.apply(candidate); } return null; } }; } }; }
Source:
<code><START> public PayaraNotificationBuilder newBuilder() { <END> return new PayaraNotificationBuilder(createEvent()); }</code><technical_language>I this a static method in PayaraNotificationBuilder. factory class artefact of is longer needed build create messages</technical_language>

Target:
public PayaraNotificationBuilder newBuilder() { String hostName; try { hostName = InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException ex) { LOGGER.log(Level.WARNING, "Unable to resolve local hostname", ex); hostName = "?.?.?.?"; } final String domainName = environment.getDomainName(); final String instanceName = environment.getInstanceName(); final Server server = habitat.getService(Server.class, environment.getInstanceName()); final String serverName = server.getName(); return new PayaraNotificationBuilder(hostName, domainName, instanceName, serverName); }
Source:
<code>public HashHitInfo lookupMD5(Content content) throws TskCoreException { HashHitInfo result = null; assert content instanceof AbstractFile; if (content instanceof AbstractFile) { AbstractFile file = (AbstractFile) content; if (null != file.getMd5Hash()) { try{ if(EamDb.getInstance().isFileHashInReferenceSet(file.getMd5Hash(), this.referenceSetID)){ result = new HashHitInfo(file.getMd5Hash(), "", ""); } } catch (EamDbException ex){ <START> Logger.getLogger(SleuthkitHashSet.class.getName()).log(Level.SEVERE, "Error performing central reposiotry hash lookup", ex); END> throw new TskCoreException("Error performing central reposiotry hash lookup", ex); } } } return result; }</code><technical_language>I in debugging if identify database experienced error</technical_language>

Target:
public HashHitInfo lookupMD5(Content content) throws TskCoreException { HashHitInfo result = null; assert content instanceof AbstractFile; if (content instanceof AbstractFile) { AbstractFile file = (AbstractFile) content; if (null != file.getMd5Hash()) { try{ if(EamDb.getInstance().isFileHashInReferenceSet(file.getMd5Hash(), this.referenceSetID)){ result = new HashHitInfo(file.getMd5Hash(), "", ""); } } catch (EamDbException ex){ Logger.getLogger(SleuthkitHashSet.class.getName()).log(Level.SEVERE, "Error performing central reposiotry hash lookup for hash " + file.getMd5Hash() + " in reference set " + referenceSetID, ex); throw new TskCoreException("Error performing central reposiotry hash lookup", ex); } } } return result; }
Source:
<code>@Test void testRelShuttleForLogicalCalc() { final String sql = "select ename from emp"; final RelNode rel = tester.convertSqlToRel(sql).rel; final HepProgramBuilder programBuilder = HepProgram.builder(); programBuilder.addRuleInstance(ProjectToCalcRule.INSTANCE); <START> HepPlanner planner = new HepPlanner(programBuilder.build()); <END> planner.setRoot(rel); final LogicalCalc calc = (LogicalCalc) planner.findBestExp(); final List<RelNode> rels = new ArrayList<>(); final RelShuttleImpl visitor = new RelShuttleImpl() { @Override public RelNode visit(LogicalCalc calc) { RelNode visitedRel = super.visit(calc); rels.add(visitedRel); return visitedRel; } }; visitor.visit(calc); assertThat(rels.size(), is(1)); assertThat(rels.get(0), isA(LogicalCalc.class)); }</code><technical_language>final</technical_language>

Target:
@Test void testRelShuttleForLogicalCalc() { final String sql = "select ename from emp"; final RelNode rel = tester.convertSqlToRel(sql).rel; final HepProgramBuilder programBuilder = HepProgram.builder(); programBuilder.addRuleInstance(ProjectToCalcRule.INSTANCE); final HepPlanner planner = new HepPlanner(programBuilder.build()); planner.setRoot(rel); final LogicalCalc calc = (LogicalCalc) planner.findBestExp(); final List<RelNode> rels = new ArrayList<>(); final RelShuttleImpl visitor = new RelShuttleImpl() { @Override public RelNode visit(LogicalCalc calc) { RelNode visitedRel = super.visit(calc); rels.add(visitedRel); return visitedRel; } }; visitor.visit(calc); assertThat(rels.size(), is(1)); assertThat(rels.get(0), isA(LogicalCalc.class)); }
Source:
<code>private String findAvailableInstructorGoogleIdForCourse(String courseId){ if(tempCourseIdToInstructorGoogleIdMap.get(courseId) != null){ return tempCourseIdToInstructorGoogleIdMap.get(courseId); } String googleId = ""; List<InstructorAttributes> instructorList = logic.getInstructorsForCourse(courseId); if(instructorList == null || instructorList.isEmpty()){ return googleId; } for (InstructorAttributes instructor : instructorList) { <START> if (instructor.isRegistered() && instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR)) { <END> googleId = instructor.googleId; break; } } tempCourseIdToInstructorGoogleIdMap.put(courseId, googleId); return googleId; }</code><technical_language>@unyoungwax, explain modifications? Explain code work, work? is INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR</technical_language>

Target:
private String findAvailableInstructorGoogleIdForCourse(String courseId){ if(tempCourseIdToInstructorGoogleIdMap.get(courseId) != null){ return tempCourseIdToInstructorGoogleIdMap.get(courseId); } List<InstructorAttributes> instructorList = logic.getInstructorsForCourse(courseId); if(instructorList == null || instructorList.isEmpty()){ return ""; } for (InstructorAttributes instructor : instructorList) { if (instructor.isRegistered() && instructor.hasCoownerPrivileges()) { tempCourseIdToInstructorGoogleIdMap.put(courseId, instructor.googleId); return instructor.googleId; } } for (InstructorAttributes instructor : instructorList) { if (instructor.isRegistered() && instructor.isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_INSTRUCTOR)) { tempCourseIdToInstructorGoogleIdMap.put(courseId, instructor.googleId); return instructor.googleId; } } return ""; }
Source:
<code>private boolean waitForChanges(int direction, long timeout, TimeUnit unit) throws InterruptedException { if (direction != DIRECTION_DOWNLOAD && direction != DIRECTION_UPLOAD) { throw new IllegalArgumentException("Unknown direction: " + direction); } boolean result = false; if (!isClosed) { String realmPath = configuration.getPath(); WaitForSessionWrapper wrapper = new WaitForSessionWrapper(); waitingForServerChanges.set(wrapper); int callbackId = waitCounter.incrementAndGet(); boolean listenerRegistered = (direction == DIRECTION_DOWNLOAD) ? nativeWaitForDownloadCompletion(callbackId, realmPath) : nativeWaitForUploadCompletion(callbackId, realmPath); if (!listenerRegistered) { waitingForServerChanges.set(null); String errorMsg; switch (direction) { case DIRECTION_DOWNLOAD: errorMsg = "It was not possible to download all remote changes."; break; case DIRECTION_UPLOAD: errorMsg = "It was not possible upload all local changes."; break; default: throw new IllegalArgumentException("Unknown direction: " + direction); } throw new ObjectServerError(ErrorCode.UNKNOWN, errorMsg + " Has the SyncClient been started?"); } try { result = wrapper.waitForServerChanges(timeout, unit); <START> RealmLog.error("Success: " + result); <END> } catch(InterruptedException e) { RealmLog.error("Download interrupted"); waitingForServerChanges.set(null); throw e; } try { if (!isClosed) { if (!wrapper.isSuccess()) { wrapper.throwExceptionIfNeeded(); } } } finally { waitingForServerChanges.set(null); } } return result; }</code><technical_language>remove change log level debug/info</technical_language>

Target:
private boolean waitForChanges(int direction, long timeout, TimeUnit unit) throws InterruptedException { if (direction != DIRECTION_DOWNLOAD && direction != DIRECTION_UPLOAD) { throw new IllegalArgumentException("Unknown direction: " + direction); } boolean result = false; if (!isClosed) { String realmPath = configuration.getPath(); WaitForSessionWrapper wrapper = new WaitForSessionWrapper(); waitingForServerChanges.set(wrapper); int callbackId = waitCounter.incrementAndGet(); boolean listenerRegistered = (direction == DIRECTION_DOWNLOAD) ? nativeWaitForDownloadCompletion(callbackId, realmPath) : nativeWaitForUploadCompletion(callbackId, realmPath); if (!listenerRegistered) { waitingForServerChanges.set(null); String errorMsg; switch (direction) { case DIRECTION_DOWNLOAD: errorMsg = "It was not possible to download all remote changes."; break; case DIRECTION_UPLOAD: errorMsg = "It was not possible upload all local changes."; break; default: throw new IllegalArgumentException("Unknown direction: " + direction); } throw new ObjectServerError(ErrorCode.UNKNOWN, errorMsg + " Has the SyncClient been started?"); } try { result = wrapper.waitForServerChanges(timeout, unit); } catch(InterruptedException e) { waitingForServerChanges.set(null); throw e; } try { if (!isClosed) { if (!wrapper.isSuccess()) { wrapper.throwExceptionIfNeeded(); } } } finally { waitingForServerChanges.set(null); } } return result; }
Source:
<code>public void write( SystemInputDef systemInput) { xmlWriter_.writeDeclaration(); xmlWriter_.writeTagStart( SYSTEM_TAG); xmlWriter_.writeAttribute( NAME_ATR, systemInput.getName()); <START> xmlWriter_.writeTagEnd(); <END> xmlWriter_.indent(); writeAnnotations( systemInput); toStream( systemInput.getFunctionInputDefs()).forEach( function -> writeFunction( function)); xmlWriter_.unindent(); xmlWriter_.writeElementEnd( SYSTEM_TAG); }</code><technical_language>consider refactor sequences a single writeTag method for readability in Writers</technical_language>

Target:
public void write( SystemInputDef systemInput) { xmlWriter_.writeDeclaration(); xmlWriter_ .element( SYSTEM_TAG) .attribute( NAME_ATR, systemInput.getName()) .content( () -> { writeAnnotations( systemInput); toStream( systemInput.getFunctionInputDefs()).forEach( function -> writeFunction( function)); }) .write(); }
Source:
<code>public void closeEditors() { IFile file = getBookmarksFile(); FileEditorInput input = new FileEditorInput(file); IWorkbench wb = PlatformUI.getWorkbench(); for (IWorkbenchWindow wbWindow : wb.getWorkbenchWindows()) { for (IWorkbenchPage wbPage : wbWindow.getPages()) { for (IEditorReference editorReference : wbPage.getEditorReferences()) { try { IEditorPart editor = editorReference.getEditor(false); if (editor instanceof <START> TmfEditor && <END> editorReference.getEditorInput().equals(input)) { wbPage.closeEditor(editorReference.getEditor(false), false); } } catch (PartInitException e) { Activator.getDefault().logError(NLS.bind(Messages.TmfCommonProjectElement_ErrorClosingEditor, getName()), e); } } } } }</code><technical_language>I ITmfTraceEditor more check</technical_language>

Target:
public void closeEditors() { IFile file = getBookmarksFile(); FileEditorInput input = new FileEditorInput(file); IWorkbench wb = PlatformUI.getWorkbench(); for (IWorkbenchWindow wbWindow : wb.getWorkbenchWindows()) { for (IWorkbenchPage wbPage : wbWindow.getPages()) { for (IEditorReference editorReference : wbPage.getEditorReferences()) { try { IEditorPart editor = editorReference.getEditor(false); if (editor instanceof ITmfTraceEditor && editorReference.getEditorInput().equals(input)) { wbPage.closeEditor(editor, false); } } catch (PartInitException e) { Activator.getDefault().logError(NLS.bind(Messages.TmfCommonProjectElement_ErrorClosingEditor, getName()), e); } } } } }
Source:
<code>private void drawStar(Tessellator buffer, int solarOrbitalDistance, float sunSize, float r, float g, float b, float multiplier) { <START> IPlanetaryProvider planetaryProvider = (IPlanetaryProvider)mc.theWorld.provider; <END> DimensionProperties properties = (DimensionProperties)planetaryProvider.getDimensionProperties((int)mc.thePlayer.posX, (int)mc.thePlayer.posZ); GL11.glColor4f(r, g , b ,Math.min((multiplier)*2f,1f)); buffer.startDrawingQuads(); float f10 = sunSize*20f*AstronomicalBodyHelper.getBodySizeMultiplier(solarOrbitalDistance); buffer.addVertexWithUV((double)(-f10), 100.0D, (double)(-f10), 0.0D, 0.0D); buffer.addVertexWithUV((double)f10, 100.0D, (double)(-f10), 1.0D, 0.0D); buffer.addVertexWithUV((double)f10, 100.0D, (double)f10, 1.0D, 1.0D); buffer.addVertexWithUV((double)(-f10), 100.0D, (double)f10, 0.0D, 1.0D); buffer.draw(); }</code><technical_language>want calls here, "planetaryProvider" "properties" used</technical_language>

Target:
private void drawStar(Tessellator buffer, int solarOrbitalDistance, float sunSize, float r, float g, float b, float multiplier) { GL11.glColor4f(r, g , b ,Math.min((multiplier)*2f,1f)); buffer.startDrawingQuads(); float f10 = sunSize*20f*AstronomicalBodyHelper.getBodySizeMultiplier(solarOrbitalDistance); buffer.addVertexWithUV((double)(-f10), 100.0D, (double)(-f10), 0.0D, 0.0D); buffer.addVertexWithUV((double)f10, 100.0D, (double)(-f10), 1.0D, 0.0D); buffer.addVertexWithUV((double)f10, 100.0D, (double)f10, 1.0D, 1.0D); buffer.addVertexWithUV((double)(-f10), 100.0D, (double)f10, 0.0D, 1.0D); buffer.draw(); }
Source:
<code>public void sendPushMessage(Variant variant, Collection<String> tokens, UnifiedPushMessage pushMessage, NotificationSenderCallback callback) { if (tokens.isEmpty()) { return; } String payload = pushMessage.getMessage().getSimplePush(); if (payload == null) { payload = ""; } boolean hasWarning = false; for (String clientURL : tokens) { HttpURLConnection conn = null; try { logger.finest("Sending out SimplePush payload: " + payload); conn = put(clientURL, payload); int simplePushStatusCode = conn.getResponseCode(); logger.info("SimplePush Status: " + simplePushStatusCode); if (Status.OK.getStatusCode() != simplePushStatusCode) { logger.severe("Error during PUT execution to SimplePush Network, status code was: " + simplePushStatusCode); hasWarning = true; } } catch (IOException e) { logger.severe("Error during PUT execution to SimplePush Network", e); hasWarning = true; } catch (IllegalArgumentException e) { logger.severe(e.getMessage(), e); hasWarning = true; } finally { if (conn != null) { conn.disconnect(); } } } <START> if(hasWarning){ <END> callback.onError("Error delivering SimplePush payload"); } else { callback.onSuccess(); } }</code><technical_language>formatting</technical_language>

Target:
public void sendPushMessage(Variant variant, Collection<String> tokens, UnifiedPushMessage pushMessage, NotificationSenderCallback callback) { if (tokens.isEmpty()) { return; } String payload = pushMessage.getMessage().getSimplePush(); if (payload == null) { payload = ""; } boolean hasWarning = false; for (String clientURL : tokens) { HttpURLConnection conn = null; try { logger.finest("Sending out SimplePush payload: " + payload); conn = put(clientURL, payload); int simplePushStatusCode = conn.getResponseCode(); logger.info("SimplePush Status: " + simplePushStatusCode); if (Status.OK.getStatusCode() != simplePushStatusCode) { hasWarning = true; } } catch (Exception e) { logger.severe("Error delivering SimplePush payload", e); hasWarning = true; } finally { if (conn != null) { conn.disconnect(); } } } if (hasWarning) { callback.onError("Error delivering SimplePush payload"); } else { callback.onSuccess(); } }
Source:
<code>public boolean shouldModifyIndexes(FlagAffectedCommand command, InvocationContext ctx, DistributionManager distributionManager, RpcManager rpcManager, Object key) { <START> if (key == null || distributionManager == null) { <END> return true; } DistributionInfo info = distributionManager.getCacheTopology().getDistribution(key); return info.isPrimary() || info.isWriteOwner() && (ctx.isInTxScope() || !ctx.isOriginLocal() || command != null && command.hasAnyFlag(FlagBitSets.PUT_FOR_STATE_TRANSFER)); }</code><technical_language>is true key is null de distributionManager is null</technical_language>

Target:
public boolean shouldModifyIndexes(FlagAffectedCommand command, InvocationContext ctx, DistributionManager distributionManager, RpcManager rpcManager, Object key) { return false; }
Source:
<code>public void run() { List<VDSGroup> vdsGroups = DbFacade.getInstance().getVdsGroupDao().getTrustedClusters(); List<String> curVdsNames = new ArrayList<String>(); List<String> curVdsNames1 = curVdsNames; List<String> curVdsNames2 = new ArrayList<String>(); List<AttestationValue> valueList1 = new ArrayList<AttestationValue> (); List<AttestationValue> valueList2 = new ArrayList<AttestationValue> (); if (vdsGroups == null || vdsGroups.size()==0) { return; } for (VDSGroup vdsGroup: vdsGroups){ vdss = DbFacade.getInstance().getVdsDao().getAllForVdsGroup(vdsGroup.getId()); if (vdss == null || vdss.size() == 0){ break; } for (VDS vds: vdss){ <START> curVdsNames.add(vds.gethost_name()); <END> } } if (curVdsNames.size()> attestationFirstStageSize) { curVdsNames1 = curVdsNames.subList(0,attestationFirstStageSize-1); curVdsNames2 = curVdsNames.subList(attestationFirstStageSize,curVdsNames.size()-1); } valueList1 = AttestationService.getInstance().attestHosts(curVdsNames1); updateCache(valueList1); if (curVdsNames2.size() > 0) { valueList2 = AttestationService.getInstance().attestHosts(curVdsNames2); updateCache(valueList2); } }</code><technical_language>method gethost_name() longer exist - changed getHostName()</technical_language>

Target:
public void run() { List<VDSGroup> vdsGroups = DbFacade.getInstance().getVdsGroupDao().getTrustedClusters(); List<String> vdsNames = new ArrayList<String>(); List<String> curVdsNames = new ArrayList<String>(); int i=0; boolean secondStageFlag =true; List<AttestationValue> valueList = new ArrayList<AttestationValue> (); if (vdsGroups == null || vdsGroups.size()==0) { return; } for (VDSGroup vdsGroup: vdsGroups){ vdss = DbFacade.getInstance().getVdsDao().getAllForVdsGroup(vdsGroup.getId()); if (vdss == null || vdss.size() == 0){ break; } for (VDS vds: vdss){ vdsNames.add(vds.getHostName()); } } while(vdsNames.size()>0 && i<2 && secondStageFlag){ if (vdsNames.size() <=attestationFirstStageSize){ curVdsNames = vdsNames; secondStageFlag=false; }else{ curVdsNames=(i==0)?vdsNames.subList(i, attestationFirstStageSize) :vdsNames.subList(attestationFirstStageSize, vdsNames.size()); } valueList = AttestationService.getInstance().attestHosts(curVdsNames); updateCache(valueList); i++; } }