auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testClusterNodeMetrics() throws Exception { <START> IgniteEx ignite0 = grid(); <END> final Ignite ignite1 = startGrid(1); GridTestUtils.waitForCondition(new GridAbsPredicate() { @Override public boolean apply() { return ignite0.cluster().nodes().size() == 2 && ignite1.cluster().nodes().size() == 2; } }, 3000L); ClusterMetrics metrics0 = ignite0.cluster().localNode().metrics(); ClusterMetrics nodesMetrics = ignite0.cluster().forNode(ignite0.cluster().localNode(), ignite1.cluster().localNode()).metrics(); assertEquals(metrics0.getTotalCpus(), nodesMetrics.getTotalCpus()); assertEquals(1, metrics0.getTotalNodes()); assertEquals(2, nodesMetrics.getTotalNodes()); assert metrics0.getHeapMemoryUsed() > 0; assert metrics0.getHeapMemoryTotal() > 0; }</code><technical_language>return final modifier</technical_language>

Target:
public void testClusterNodeMetrics() throws Exception { final Ignite ignite0 = grid(); final Ignite ignite1 = startGrid(1); GridTestUtils.waitForCondition(new GridAbsPredicate() { @Override public boolean apply() { return ignite0.cluster().nodes().size() == 2 && ignite1.cluster().nodes().size() == 2; } }, 3000L); ClusterMetrics metrics0 = ignite0.cluster().localNode().metrics(); ClusterMetrics nodesMetrics = ignite0.cluster().forNode(ignite0.cluster().localNode(), ignite1.cluster().localNode()).metrics(); assertEquals(metrics0.getTotalCpus(), nodesMetrics.getTotalCpus()); assertEquals(1, metrics0.getTotalNodes()); assertEquals(2, nodesMetrics.getTotalNodes()); assert metrics0.getHeapMemoryUsed() > 0; assert metrics0.getHeapMemoryTotal() > 0; }
Source:
<code>public void testMaxBreadcrumbs() { Client client = generateClient(); assertEquals(0, client.breadcrumbs.store.size()); client.setMaxBreadcrumbs(1); client.leaveBreadcrumb("test"); client.leaveBreadcrumb("another"); <START> assertEquals(1, client.breadcrumbs.store.size()); <END> }</code><technical_language>This check remaining breadcrumb is correct one</technical_language>

Target:
public void testMaxBreadcrumbs() { Client client = generateClient(); assertEquals(0, client.breadcrumbs.store.size()); client.setMaxBreadcrumbs(1); client.leaveBreadcrumb("test"); client.leaveBreadcrumb("another"); assertEquals(1, client.breadcrumbs.store.size()); Breadcrumb poll = client.breadcrumbs.store.poll(); assertEquals(BreadcrumbType.MANUAL, poll.getType()); assertEquals("manual", poll.getName()); assertEquals("another", poll.getMetadata().get("message")); }
Source:
<code>public void testExcludeNested() throws URISyntaxException { <START> Response response = given().param("species", "mmusculus_grcm38").param("exclude", "filesAttrs").get(new URI("/v1/segments/20:60000-62000/variants")); <END> response.then().statusCode(200); List<Map> result = JsonPath.from(response.asString()).getJsonObject("response[0].result"); for (Map m : result) { for (Map sourceEntry: (Collection<Map>) ((Map) m.get("sourceEntries")).values()) { System.out.println(sourceEntry); assertTrue(((Map) sourceEntry.get("attributes")).isEmpty()); } } }</code><technical_language>key sourceEntries.attributes match names returned web service</technical_language>

Target:
public void testExcludeNested() throws URISyntaxException { Response response = given().param("species", "mmusculus_grcm38").param("exclude", "sourceEntries.attributes").get(new URI("/v1/segments/20:60000-62000/variants")); response.then().statusCode(200); List<Map> result = JsonPath.from(response.asString()).getJsonObject("response[0].result"); for (Map m : result) { for (Map sourceEntry: (Collection<Map>) ((Map) m.get("sourceEntries")).values()) { System.out.println(sourceEntry); assertTrue(((Map) sourceEntry.get("attributes")).isEmpty()); } } }
Source:
<code>public static String cleanUri(String uri) { if (uri.charAt(0) == '<') { uri = uri.substring(1, uri.length() - 1).toLowerCase(); } <START> uri = uri.replaceAll("^<LINK_0>", "fb:"); <END> uri = uri.replaceAll("^<LINK_1>", "fbkey:"); return uri; }</code><technical_language>Minor - do fb: fbkey: static final strings instead of hard-coding here</technical_language>

Target:
public static String cleanUri(String uri) { if (uri.charAt(0) == '<') { uri = uri.substring(1, uri.length() - 1).toLowerCase(); } uri = uri.replaceAll(FREEBASE_NS_LONG, FREEBASE_NS_SHORT); uri = uri.replaceAll(FREEBASE_KEY_LONG, FREEBASE_KEY_SHORT); return uri; }
Source:
<code>public void onAdd(IForgeRegistryInternal<Item> owner, RegistryManager stage, int id, Item item, @Nullable Item oldItem) { if (oldItem instanceof BlockItem) { @SuppressWarnings("unchecked") <START> Map<Block, Item> blockToItem = owner.getSlaveMap(BLOCK_TO_ITEM, Map.class); <END> blockToItem.remove(((BlockItem)oldItem).getBlock()); } if (item instanceof BlockItem) { @SuppressWarnings("unchecked") Map<Block, Item> blockToItem = owner.getSlaveMap(BLOCK_TO_ITEM, Map.class); ((BlockItem)item).addToBlockToItemMap(blockToItem, item); } }</code><technical_language>This sufficient: Mojang changed code due WallOrFloorItem, this symmetric ((BlockItem)item).addToBlockToItemMap(blockToItem, item); call</technical_language>

Target:
public void onAdd(IForgeRegistryInternal<Item> owner, RegistryManager stage, int id, Item item, @Nullable Item oldItem) { if (oldItem instanceof BlockItem) { @SuppressWarnings("unchecked") Map<Block, Item> blockToItem = owner.getSlaveMap(BLOCK_TO_ITEM, Map.class); ((BlockItem)oldItem).removeFromBlockToItemMap(blockToItem, item); } if (item instanceof BlockItem) { @SuppressWarnings("unchecked") Map<Block, Item> blockToItem = owner.getSlaveMap(BLOCK_TO_ITEM, Map.class); ((BlockItem)item).addToBlockToItemMap(blockToItem, item); } }
Source:
<code>protected void checkTxCommandResponses(Map<Address, Response> responseMap, TransactionBoundaryCommand command, TxInvocationContext<LocalTransaction> context, Collection<Address> recipients) { OutdatedTopologyException outdatedTopologyException = null; <START> if (command.getTopologyId() != stateTransferManager.getCacheTopology().getTopologyId()) { <END> if (trace) log.tracef("We have a newer topology, ignoring responses and retrying"); throw OutdatedTopologyException.INSTANCE; } for (Map.Entry<Address, Response> e : responseMap.entrySet()) { Address recipient = e.getKey(); Response response = e.getValue(); if (response == CacheNotFoundResponse.INSTANCE) { if (!rpcManager.getMembers().contains(recipient)) { if (trace) log.tracef("Ignoring response from node not targeted %s", recipient); } else { if (checkCacheNotFoundResponseInPartitionHandling(command, context, recipients)) { if (trace) log.tracef("Cache not running on node %s, or the node is missing. It will be handled by the PartitionHandlingManager", recipient); return; } else { if (trace) log.tracef("Cache not running on node %s, or the node is missing", recipient); outdatedTopologyException = new OutdatedTopologyException(format("Cache not running on node %s, or the node is missing", recipient)); } } } else if (response == UnsureResponse.INSTANCE) { if (trace) log.tracef("Node %s has a newer topology id", recipient); outdatedTopologyException = new OutdatedTopologyException(format("Node %s has a newer topology id", recipient)); } } if (outdatedTopologyException != null) { throw outdatedTopologyException; } }</code><technical_language>checking STM DM? checkTopologyId in</technical_language>

Target:
protected void checkTxCommandResponses(Map<Address, Response> responseMap, TransactionBoundaryCommand command, TxInvocationContext<LocalTransaction> context, Collection<Address> recipients) { LocalizedCacheTopology cacheTopology = checkTopologyId(command); for (Map.Entry<Address, Response> e : responseMap.entrySet()) { Address recipient = e.getKey(); Response response = e.getValue(); if (response == CacheNotFoundResponse.INSTANCE) { if (!cacheTopology.getMembers().contains(recipient)) { if (trace) log.tracef("Ignoring response from node not targeted %s", recipient); } else { if (checkCacheNotFoundResponseInPartitionHandling(command, context, recipients)) { if (trace) log.tracef("Cache not running on node %s, or the node is missing. It will be handled by the PartitionHandlingManager", recipient); return; } else { if (trace) log.tracef("Cache not running on node %s, or the node is missing", recipient); throw OutdatedTopologyException.INSTANCE; } } } else if (response == UnsureResponse.INSTANCE) { if (trace) log.tracef("Node %s has a newer topology id", recipient); throw OutdatedTopologyException.INSTANCE; } } }
Source:
<code>private <T> Collection<? extends Callable<T>> instrument(Collection<? extends Callable<T>> tasks) { <START> List<InstrumentedCallable<T>> instrumented = new ArrayList<InstrumentedCallable<T>>(); <END> for (Callable<T> task : tasks) { instrumented.add(new InstrumentedCallable(task)); } return instrumented; }</code><technical_language>this final tasks dealing with, creating a list right capacity</technical_language>

Target:
private <T> Collection<? extends Callable<T>> instrument(Collection<? extends Callable<T>> tasks) { final List<InstrumentedCallable<T>> instrumented = new ArrayList<InstrumentedCallable<T>>(tasks.size()); for (Callable<T> task : tasks) { instrumented.add(new InstrumentedCallable(task)); } return instrumented; }
Source:
<code>protected void initActionContext(ActionContext actionContext) { actionContext.setParameters(HttpParameters.create(request.getParameterMap()).build()); initSession(actionContext); applyAdditionalParams(actionContext); <START> ActionContext.bound(actionContext); <END> }</code><technical_language>candidate for bind() if method is created</technical_language>

Target:
protected void initActionContext(ActionContext actionContext) { actionContext.setParameters(HttpParameters.create(request.getParameterMap()).build()); initSession(actionContext); applyAdditionalParams(actionContext); ActionContext.bind(actionContext); }
Source:
<code>public boolean isValid(Object[] value, ConstraintValidatorContext context) { if ( value.length != 3 ) { <START> throw new IllegalStateException( "Unexpected method signature" ); <END> } if ( value[1] == null || value[2] == null ) { return true; } return ( (Date) value[1] ).before( (Date) value[2] ); }</code><technical_language>tangential, IllegalArgumentException more reasonable</technical_language>

Target:
public boolean isValid(Object[] value, ConstraintValidatorContext context) { if ( value.length != 3 ) { throw new IllegalArgumentException( "Unexpected method signature" ); } if ( value[1] == null || value[2] == null ) { return true; } return ( (Date) value[1] ).before( (Date) value[2] ); }
Source:
<code>public void testDocumentIdAsPrimaryKey() throws Exception { indexType2TweeterDocuments(); final Table table = dataContext.getDefaultSchema().getTableByName(DEFAULT_TABLE_NAME); <START> final Column[] pks = table.getPrimaryKeys().toArray(new Column[0]); <END> assertEquals(1, pks.length); assertEquals("_id", pks[0].getName()); try (DataSet ds = dataContext.query().from(table).select("user", "_id").orderBy("_id").asc().execute()) { assertTrue(ds.next()); assertEquals("Row[values=[user1, tweet_tweet2_1]]", ds.getRow().toString()); } }</code><technical_language>Please a name (primaryKeys, primaryKeyColumns)</technical_language>

Target:
public void testDocumentIdAsPrimaryKey() throws Exception { indexType2TweeterDocuments(); final Table table = dataContext.getDefaultSchema().getTableByName(DEFAULT_TABLE_NAME); final Column[] primaryKeys = table.getPrimaryKeys().toArray(new Column[0]); assertEquals(1, primaryKeys.length); assertEquals("_id", primaryKeys[0].getName()); try (DataSet dataSet = dataContext.query().from(table).select("user", "_id").orderBy("_id").asc().execute()) { assertTrue(dataSet.next()); assertEquals("Row[values=[user1, tweet_tweet2_1]]", dataSet.getRow().toString()); } }
Source:
<code>public Change createChange(IProgressMonitor pm) throws CoreException { Assert.isTrue(fMovePolicy.getJavaElementDestination() == null || fMovePolicy.getResourceDestination() == null); Assert.isTrue(fMovePolicy.getJavaElementDestination() != null || fMovePolicy.getResourceDestination() != null); try { final DynamicValidationStateChange result= new DynamicValidationStateChange(RefactoringCoreMessages.JavaMoveProcessor_change_name) { @Override public ChangeDescriptor getDescriptor() { return fMovePolicy.getDescriptor(); } @Override public Change perform(IProgressMonitor pm2) throws CoreException { Change change= super.perform(pm2); for (Change <START> c : <END> getChildren()) { if (!(c instanceof TextEditBasedChange)) { return null; } } return change; } }; CreateTargetExecutionLog log= null; if (fCreateTargetQueries instanceof MonitoringCreateTargetQueries) { final MonitoringCreateTargetQueries queries= (MonitoringCreateTargetQueries) fCreateTargetQueries; final ICreateTargetQueries delegate= queries.getDelegate(); if (delegate instanceof LoggedCreateTargetQueries) log= queries.getCreateTargetExecutionLog(); } if (log != null) { for (Object s : log.getSelectedElements()) { result.add(new LoggedCreateTargetChange(s, fCreateTargetQueries)); } } Change change= fMovePolicy.createChange(pm); if (change instanceof CompositeChange) { CompositeChange subComposite= (CompositeChange) change; result.merge(subComposite); } else { result.add(change); } return result; } finally { pm.done(); } }</code><technical_language>rename change</technical_language>

Target:
public Change createChange(IProgressMonitor pm) throws CoreException { Assert.isTrue(fMovePolicy.getJavaElementDestination() == null || fMovePolicy.getResourceDestination() == null); Assert.isTrue(fMovePolicy.getJavaElementDestination() != null || fMovePolicy.getResourceDestination() != null); try { final DynamicValidationStateChange result= new DynamicValidationStateChange(RefactoringCoreMessages.JavaMoveProcessor_change_name) { @Override public ChangeDescriptor getDescriptor() { return fMovePolicy.getDescriptor(); } @Override public Change perform(IProgressMonitor pm2) throws CoreException { Change change= super.perform(pm2); for (Change c : getChildren()) { if (!(c instanceof TextEditBasedChange)) { return null; } } return change; } }; CreateTargetExecutionLog log= null; if (fCreateTargetQueries instanceof MonitoringCreateTargetQueries) { final MonitoringCreateTargetQueries queries= (MonitoringCreateTargetQueries) fCreateTargetQueries; final ICreateTargetQueries delegate= queries.getDelegate(); if (delegate instanceof LoggedCreateTargetQueries) log= queries.getCreateTargetExecutionLog(); } if (log != null) { for (Object element : log.getSelectedElements()) { result.add(new LoggedCreateTargetChange(element, fCreateTargetQueries)); } } Change change= fMovePolicy.createChange(pm); if (change instanceof CompositeChange) { CompositeChange subComposite= (CompositeChange) change; result.merge(subComposite); } else { result.add(change); } return result; } finally { pm.done(); } }
Source:
<code>public ConcordanceIterator(final Iterator<VariantContext> truthIterator, final Iterator<VariantContext> evalIterator) { <START> this.truthIterator = new PeekableIterator<VariantContext>(truthIterator); <END> this.evalIterator = new PeekableIterator<VariantContext>(evalIterator); }</code><technical_language>java this.truthIterator = new PeekableIterator<>(truthIterator);</technical_language>

Target:
protected ConcordanceIterator(final Iterator<VariantContext> truthIterator, final Iterator<VariantContext> evalIterator) { this.truthIterator = new PeekableIterator<>(truthIterator); this.evalIterator = new PeekableIterator<>(evalIterator); }
Source:
<code>public void ensureSuiteLevelBeanshellIsAppliedToAllTests() throws IOException { Parser parser = new Parser("src/test/resources/xml/issue1674.xml"); List<XmlSuite> suites = parser.parseToList(); XmlSuite xmlsuite = suites.get(0); assertThat(xmlsuite.getTests().get(0).getMethodSelectors().size()).isEqualTo(0); TestNG testNG = create(); testNG.setXmlSuites(suites); testNG.setUseDefaultListeners(false); testNG.run(); <START> assertThat(xmlsuite.getTests().get(0).getMethodSelectors().size()).isEqualTo(1); <END> }</code><technical_language>Is assert BeanShell code ran instead of testing this</technical_language>

Target:
public void ensureSuiteLevelBeanshellIsAppliedToAllTests() throws IOException { PrintStream current = System.out; StringOutputStream stream = new StringOutputStream(); try { System.setOut(new PrintStream(stream)); Parser parser = new Parser("src/test/resources/xml/issue1674.xml"); List<XmlSuite> suites = parser.parseToList(); XmlSuite xmlsuite = suites.get(0); assertThat(xmlsuite.getTests().get(0).getMethodSelectors().size()).isEqualTo(0); TestNG testNG = create(); testNG.setXmlSuites(suites); testNG.setUseDefaultListeners(false); testNG.run(); assertThat(xmlsuite.getTests().get(0).getMethodSelectors().size()).isEqualTo(1); assertThat(stream.toString()).contains(Arrays.asList("rajni", "kamal", "mgr")); } finally { System.setOut(current); } }
Source:
<code>private static Status mappedStatus(EurekaHttpResponse<?> httpResponse) { int category = httpResponse.getStatusCode() / 100; switch (category) { case 1: return Status.x100; case 2: return Status.x100; case 3: return Status.x100; case 4: return Status.x100; case 5: <START> return Status.x100; <END> } return Status.Unknown; }</code><technical_language>Typos</technical_language>

Target:
private static Status mappedStatus(EurekaHttpResponse<?> httpResponse) { int category = httpResponse.getStatusCode() / 100; switch (category) { case 1: return Status.x100; case 2: return Status.x200; case 3: return Status.x300; case 4: return Status.x400; case 5: return Status.x500; } return Status.Unknown; }
Source:
<code>@Override protected void onFinishInflate() { super.onFinishInflate(); ButterKnife.inject(this); titleView.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (!hasFocus) { <START> EditText editText = (EditText) v; <END> editText.setError(Strings.isBlank(editText.getText()) ? "Cannot be empty." : null); } } }); titleView.addTextChangedListener(new EmptyTextWatcher() { @Override public void afterTextChanged(Editable s) { if (listener != null) { listener.onStateChanged(!Strings.isBlank(s)); } } }); screenshotView.setChecked(true); }</code><technical_language>titleView</technical_language>

Target:
@Override protected void onFinishInflate() { super.onFinishInflate(); ButterKnife.inject(this); titleView.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (!hasFocus) { titleView.setError(Strings.isBlank(titleView.getText()) ? "Cannot be empty." : null); } } }); titleView.addTextChangedListener(new EmptyTextWatcher() { @Override public void afterTextChanged(Editable s) { if (listener != null) { listener.onStateChanged(!Strings.isBlank(s)); } } }); screenshotView.setChecked(true); }
Source:
<code>public BlobProperties getBlobProperties(BlobId blobId, ClusterMap map, boolean expiredBlobs) { List<ReplicaId> replicas = blobId.getPartition().getReplicaIds(); BlobProperties blobProperties = null; for (ReplicaId replicaId : replicas) { try { blobProperties = getBlobProperties(blobId, map, replicaId, expiredBlobs); break; } catch (Exception e) { <START> } <END> } return blobProperties; }</code><technical_language>out of scope of this PR. If is, please feel free ignore - exception here. A message stack trace</technical_language>

Target:
public BlobProperties getBlobProperties(BlobId blobId, ClusterMap map, boolean expiredBlobs) { List<ReplicaId> replicas = blobId.getPartition().getReplicaIds(); BlobProperties blobProperties = null; for (ReplicaId replicaId : replicas) { try { blobProperties = getBlobProperties(blobId, map, replicaId, expiredBlobs); break; } catch (Exception e) { System.out.println("Get blob properties error "); e.printStackTrace(); } } return blobProperties; }
Source:
<code>public void addListenerOnButton() { button = (Button)findViewById(R.id.log); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { EditText value = (EditText) findViewById(R.id.bg_value); int intValue = Integer.parseInt(value.getText().toString()); BgReading bgReading = BgReading.create(intValue * 1000, getApplicationContext()); Intent intent = new Intent(getApplicationContext(), Home.class); startActivity(intent); finish(); } }); button = (Button)findViewById(R.id.StartTest); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { ActiveBgAlert aba = ActiveBgAlert.getOnly(); ActiveBgAlert.ClearData(); <START> ActiveBgAlert.Create("some string", true, new Date().getTime()); <END> } }); button = (Button)findViewById(R.id.StartTestAlerts); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { AlertType.TestAll(); } }); }</code><technical_language>I get a compile error here: Error:(55, 63) error: find symbol class Date Missing import..</technical_language>

Target:
public void addListenerOnButton() { button = (Button)findViewById(R.id.log); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { EditText value = (EditText) findViewById(R.id.bg_value); int intValue = Integer.parseInt(value.getText().toString()); int filterdValue = intValue; if (intValue > 200) { filterdValue = (int)(filterdValue * 1.2); } BgReading bgReading = BgReading.create(intValue * 1000, filterdValue* 1000, getApplicationContext(), new Date().getTime()); Intent intent = new Intent(getApplicationContext(), Home.class); startActivity(intent); finish(); } }); button = (Button)findViewById(R.id.StartTest); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { ActiveBgAlert aba = ActiveBgAlert.getOnly(); ActiveBgAlert.ClearData(); ActiveBgAlert.Create("some string", true, new Date().getTime()); } }); button = (Button)findViewById(R.id.StartTestAlerts); button.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { AlertType.testAll(getApplicationContext()); BgReading.TestgetUnclearTimes(); } }); }
Source:
<code>public void stop(long timeoutMs) { <START> LOG.info("Shutting down KafkaConsumerProxy poll thread:" + consumerPollThread.getName()); <END> isRunning = false; try { consumerPollThread.join(timeoutMs); if (consumerPollThread.isAlive()) { consumerPollThread.interrupt(); consumerPollThread.join(timeoutMs); } } catch (InterruptedException e) { LOG.warn("Join in KafkaConsumerProxy has failed", e); consumerPollThread.interrupt(); } }</code><technical_language>Log systemName/this</technical_language>

Target:
public void stop(long timeoutMs) { LOG.info("Shutting down KafkaConsumerProxy poll thread for {}", consumerPollThread.getName(), this); isRunning = false; try { consumerPollThread.join(timeoutMs/2); if (consumerPollThread.isAlive()) { consumerPollThread.interrupt(); consumerPollThread.join(timeoutMs/2); } } catch (InterruptedException e) { LOG.warn("Join in KafkaConsumerProxy has failed", e); consumerPollThread.interrupt(); } }
Source:
<code>protected void doSetValue(Object value) { int index = indexOfValue(value); try { updating = true; for (int i = 0; i < options.size(); i++) { <START> options.get(i).observable.setValue(i == index ? Boolean.TRUE : Boolean.FALSE); <END> } } finally { updating = false; } notifyIfChanged(index); }</code><technical_language>This code simplified rely autoboxing</technical_language>

Target:
protected void doSetValue(Object value) { int index = indexOfValue(value); try { updating = true; for (int i = 0; i < options.size(); i++) { options.get(i).observable.setValue(i == index); } } finally { updating = false; } notifyIfChanged(index); }
Source:
<code>private void addBondToUpdateList(Bond bond) { <START> while (hostSetupNetworksParametersData.newOrModifiedBonds.iterator().hasNext()) { <END> Bond oldModifiedBond = hostSetupNetworksParametersData.newOrModifiedBonds.iterator().next(); if (oldModifiedBond.getName().equals(bond.getName())) { hostSetupNetworksParametersData.newOrModifiedBonds.iterator().remove(); break; } } hostSetupNetworksParametersData.newOrModifiedBonds.add(bond); }</code><technical_language>no...no...this create new iterator loop. in other words - this is infinite loop. please replace hostSetupNetworksParametersData.newOrModifiedBonds.iterator() local variable of while loop</technical_language>

Target:
private void addBondToUpdateList(Bond bond) { for (Iterator<Bond> iter = hostSetupNetworksParametersData.newOrModifiedBonds.iterator(); iter.hasNext();) { Bond oldModifiedBond = iter.next(); if (oldModifiedBond.getName().equals(bond.getName())) { iter.remove(); break; } } hostSetupNetworksParametersData.newOrModifiedBonds.add(bond); }
Source:
<code>protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException { ModelNode config = Resource.Tools.readModel(context.readResource(PathAddress.EMPTY_ADDRESS)); final RestService service = new RestService(config); <START> String virtualServer = config.hasDefined(ModelKeys.VIRTUAL_SERVER) ? config.get(ModelKeys.VIRTUAL_SERVER).asString() : DEFAULT_VIRTUAL_SERVER; <END> String serverName = "default-server"; ServiceBuilder<?> builder = context.getServiceTarget().addService(EndpointUtils.getServiceName(operation, "rest"), service); EndpointUtils.addCacheContainerDependency(builder, service.getCacheContainerName(), service.getCacheManager()); EndpointUtils.addSocketBindingDependency(builder, getSocketBindingName(operation), service.getSocketBinding()); builder .addDependency(PathManagerService.SERVICE_NAME, PathManager.class, service.getPathManagerInjector()); if (service.getSecurityDomain()!=null) { EndpointUtils.addSecurityDomainDependency(builder, service.getSecurityDomain(), service.getSecurityDomainContextInjector()); } builder.addListener(verificationHandler); builder.setInitialMode(ServiceController.Mode.ACTIVE); builder.install(); }</code><technical_language>need setHostname() NettyJaxrsServer based virtual server name</technical_language>

Target:
protected void performRuntime(OperationContext context, ModelNode operation, ModelNode model, ServiceVerificationHandler verificationHandler, List<ServiceController<?>> newControllers) throws OperationFailedException { ModelNode config = Resource.Tools.readModel(context.readResource(PathAddress.EMPTY_ADDRESS)); final RestService service = new RestService(config); ServiceBuilder<?> builder = context.getServiceTarget().addService(EndpointUtils.getServiceName(operation, "rest"), service); EndpointUtils.addCacheContainerDependency(builder, service.getCacheContainerName(), service.getCacheManager()); EndpointUtils.addSocketBindingDependency(builder, getSocketBindingName(operation), service.getSocketBinding()); builder .addDependency(PathManagerService.SERVICE_NAME, PathManager.class, service.getPathManagerInjector()); if (service.getSecurityDomain()!=null) { EndpointUtils.addSecurityDomainDependency(builder, service.getSecurityDomain(), service.getSecurityDomainContextInjector()); } builder.addListener(verificationHandler); builder.setInitialMode(ServiceController.Mode.ACTIVE); builder.install(); }
Source:
<code>public void setUp() throws Exception { super.setUp(); fakeFtpServer = new FakeFtpServer(); fakeFtpServer.setServerControlPort(0 ); fakeFtpServer.addUserAccount(new UserAccount(USER, PASSWORD, USER_HOME_DIR)); fileSystem = new UnixFakeFileSystem(); fakeFtpServer.setFileSystem(fileSystem); fileSystem.add(new DirectoryEntry(USER_HOME_DIR)); fakeFtpServer.start(); <START> fileContents = <END> "abcdef 1234567890".getBytes(UTF_8); }</code><technical_language>This a static constant called "ARBITRARY_BYTES" if valuable pulled out (I inline it, personally)</technical_language>

Target:
public void setUp() throws Exception { super.setUp(); fakeFtpServer = new FakeFtpServer(); fakeFtpServer.setServerControlPort(0 ); fakeFtpServer.addUserAccount(new UserAccount(USER, PASSWORD, USER_HOME_DIR)); fileSystem = new UnixFakeFileSystem(); fakeFtpServer.setFileSystem(fileSystem); fileSystem.add(new DirectoryEntry(USER_HOME_DIR)); fakeFtpServer.start(); }
Source:
<code>public IntegrationFlow markers() { return f -> f.<FileSplitter.FileMarker>filter(m -> m.getMark().equals(FileSplitter.FileMarker.Mark.END), <START> e -> e.id("markerFilter").discardChannel("nullChannel")) END> .publishSubscribeChannel(s -> s .subscribe(sf -> sf.transform("'/tmp/out/.*\\.txt'") .handle("fileOut.handler", "trigger", e -> e.id("flusher"))) .subscribe(sf -> sf.<FileSplitter.FileMarker, File>transform(p -> new File("/tmp/out/002.txt")) .enrichHeaders(h -> h.header(FileHeaders.FILENAME, "002.txt", true)) .handleWithAdapter(a -> a.ftp(ftp1()).remoteDirectory("foo"), e -> e.id("ftp002"))) .subscribe(sf -> sf.<FileSplitter.FileMarker, File>transform(p -> new File("/tmp/out/006.txt")) .enrichHeaders(h -> h.header(FileHeaders.FILENAME, "006.txt", true)) .handleWithAdapter(a -> a.ftp(ftp2()).remoteDirectory("foo"), e -> e.id("ftp006"))) .subscribe(sf -> sf.<FileSplitter.FileMarker, File>transform(p -> new File("/tmp/out/009.txt")) .enrichHeaders(h -> h.header(FileHeaders.FILENAME, "009.txt", true)) .handleWithAdapter(a -> a.ftp(ftp3()).remoteDirectory("foo"), e -> e.id("ftp009"))) .subscribe(sf -> sf.<FileSplitter.FileMarker, String>transform(p -> p.getFilePath()) .enrichHeaders(Mail.headers() .subject("File successfully split and transferred") .from("foo@bar") .toFunction(m -> new String[] {"bar@baz"})) .enrichHeaders(h -> h.header(EMAIL_SUCCESS_SUFFIX, ".success")) .channel("toMail.input"))); }</code><technical_language><LINK_0> fixed Samples is SI-4.3.2 already</technical_language>

Target:
public IntegrationFlow markers() { return f -> f.<FileSplitter.FileMarker>filter(m -> m.getMark().equals(FileSplitter.FileMarker.Mark.END), e -> e.id("markerFilter")) .publishSubscribeChannel(s -> s .subscribe(sf -> sf.transform("'/tmp/out/.*\\.txt'", e -> e.id("toTriggerPattern")) .handle("fileOut", "trigger", e -> e.id("flusher"))) .subscribe(sf -> sf.<FileSplitter.FileMarker, File>transform(p -> new File("/tmp/out/002.txt")) .enrichHeaders(h -> h.header(FileHeaders.FILENAME, "002.txt", true)) .handleWithAdapter(a -> a.ftp(ftp1()).remoteDirectory("foo"), e -> e.id("ftp002"))) .subscribe(sf -> sf.<FileSplitter.FileMarker, File>transform(p -> new File("/tmp/out/006.txt")) .enrichHeaders(h -> h.header(FileHeaders.FILENAME, "006.txt", true)) .handleWithAdapter(a -> a.ftp(ftp2()).remoteDirectory("foo"), e -> e.id("ftp006"))) .subscribe(sf -> sf.<FileSplitter.FileMarker, File>transform(p -> new File("/tmp/out/009.txt")) .enrichHeaders(h -> h.header(FileHeaders.FILENAME, "009.txt", true)) .handleWithAdapter(a -> a.ftp(ftp3()).remoteDirectory("foo"), e -> e.id("ftp009"))) .subscribe(sf -> sf.transform(FileSplitter.FileMarker::getFilePath) .enrichHeaders(Mail.headers() .subject("File successfully split and transferred") .from("foo@bar") .toFunction(m -> new String[] {"bar@baz"})) .enrichHeaders(h -> h.header(EMAIL_SUCCESS_SUFFIX, ".success")) .channel("toMail.input"))); }
Source:
<code><START> public static TumblingProcessingTimeWindows of(Time size, Time offset, WindowStagger windowStagger) throws Exception { <END> return new TumblingProcessingTimeWindows(size.toMilliseconds(), offset.toMilliseconds(), windowStagger); }</code><technical_language>need throws here</technical_language>

Target:
public static TumblingProcessingTimeWindows of(Time size, Time offset, WindowStagger windowStagger) { return new TumblingProcessingTimeWindows(size.toMilliseconds(), offset.toMilliseconds(), windowStagger); }
Source:
<code>public void injectDependencies(EncoderRegistry encoderRegistry, InternalEntryFactory factory) { this.entryFactory = factory; this.encoder = encoderRegistry.getEncoder(encoderClazz); try { this.wrapper = wrapperClazz.newInstance(); } catch (InstantiationException | IllegalAccessException e) { <START> e.printStackTrace(); <END> } }</code><technical_language>Guess this needs cleaning</technical_language>

Target:
public void injectDependencies(EncoderRegistry encoderRegistry, InternalEntryFactory factory) { this.entryFactory = factory; this.keyEncoder = encoderRegistry.getEncoder(keyEncoderClass); this.valueEncoder = encoderRegistry.getEncoder(valueEncoderClass); this.keyWrapper = encoderRegistry.getWrapper(keyWrapperClass); this.valueWrapper = encoderRegistry.getWrapper(valueWrapperClass); }
Source:
<code>public int getPrimaryPlanetPosition() { if(primarySlot<1) { <START> return(1); <END> } return primarySlot; }</code><technical_language>parenthesis odd. mixed tabs spaces</technical_language>

Target:
public int getPrimaryPlanetPosition() { if(primarySlot<1) { return 1; } return primarySlot; }
Source:
<code>public MedicalLogEntry severedSpine(Person person, Date date){ String message = logEntriesResourceMap.getString("severedSpine.text"); MedicalLogEntry medicalLogEntry = new MedicalLogEntry(date, MessageFormat.format(message, <START> person.getGenderPronoun(person.PRONOUN_HISHER), <END> person.getGenderPronoun(Person.PRONOUN_HIMHER))); person.addLogEntry(medicalLogEntry); return medicalLogEntry; }</code><technical_language>Static fields accessed statically instance: Person.PRONOUN_HISHER</technical_language>

Target:
public static MedicalLogEntry severedSpine(Person person, Date date){ String message = logEntriesResourceMap.getString("severedSpine.text"); MedicalLogEntry medicalLogEntry = new MedicalLogEntry(date, MessageFormat.format(message, person.getGenderPronoun(person.PRONOUN_HISHER), person.getGenderPronoun(Person.PRONOUN_HIMHER))); person.addLogEntry(medicalLogEntry); return medicalLogEntry; }
Source:
<code>public Collection<Resource> save(final Iterable<Resource> allResources, final Map<?, ?> options, IProgressMonitor monitor) { final Collection<Resource> resourcesToSave = Lists.newArrayList(); try { monitor.beginTask("Save Session", IProgressMonitor.UNKNOWN); resourcesToSave.addAll(computeResourcesToSave(Sets.newLinkedHashSet(allResources), options, monitor)); if (alreadyIsInWorkspaceModificationOperation()) { wrappedSave(resourcesToSave, allResources, options, new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)); } else { IWorkspace workspace = null; try { <START> workspace = ResourcesPlugin.getWorkspace(); <END> } catch (IllegalStateException e) { wrappedSave(resourcesToSave, allResources, options, monitor); } if (workspace != null) { try { workspace.run(new IWorkspaceRunnable() { public void run(final IProgressMonitor monitor) throws CoreException { wrappedSave(resourcesToSave, allResources, options, monitor); } }, new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)); } catch (final CoreException e) { SiriusPlugin.getDefault().error("Core exception while saving session", e); } } } } finally { monitor.done(); } return resourcesToSave; }</code><technical_language>remark in ViewpointRegistry</technical_language>

Target:
public Collection<Resource> save(final Iterable<Resource> allResources, final Map<?, ?> options, IProgressMonitor monitor) { final Collection<Resource> resourcesToSave = Lists.newArrayList(); try { monitor.beginTask("Save Session", IProgressMonitor.UNKNOWN); resourcesToSave.addAll(computeResourcesToSave(Sets.newLinkedHashSet(allResources), options, monitor)); if (alreadyIsInWorkspaceModificationOperation()) { wrappedSave(resourcesToSave, allResources, options, new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)); } else { IWorkspaceRoot workspaceRoot = EcorePlugin.getWorkspaceRoot(); if (workspaceRoot != null) { try { workspaceRoot.getWorkspace().run(new IWorkspaceRunnable() { public void run(final IProgressMonitor monitor) throws CoreException { wrappedSave(resourcesToSave, allResources, options, monitor); } }, new SubProgressMonitor(monitor, IProgressMonitor.UNKNOWN)); } catch (final CoreException e) { SiriusPlugin.getDefault().error("Core exception while saving session", e); } } else { wrappedSave(resourcesToSave, allResources, options, monitor); } } } finally { monitor.done(); } return resourcesToSave; }
Source:
<code>static String getPassword(Configuration conf, String alias) { String password = null; try { <START> char[] passchars = conf.getPassword(alias); <END> if (passchars != null) { password = new String(passchars); } } catch (IOException ioe) { password = null; } return password; }</code><technical_language>Is a config parameter check opposed a null check? I is a design user explicitly state he/she wants enable SSL authentication perform checks based opposed checking for null</technical_language>

Target:
static String getPassword(Configuration conf, String alias) { String password = null; try { char[] passchars = conf.getPassword(alias); if (passchars != null) { password = new String(passchars); } } catch (IOException ioe) { password = null; } if (password == null) { LOGGER.warn("No password found in config as property: {}. If you don't want prompted please set ...", alias); } return password; }
Source:
<code>public ChargeEntity preOperation(String chargeId, AuthCardDetails authCardDetails) { <START> return chargeDao.findByExternalId(chargeId).map((ChargeEntity chargeEntity) -> { <END> String cardBrand = authCardDetails.getCardBrand(); if (!chargeEntity.getGatewayAccount().isRequires3ds() && cardBrandRequires3ds(cardBrand)) { chargeEntity.setStatus(AUTHORISATION_ABORTED); logger.error("AuthCardDetails authorisation failed pre operation. Card brand requires 3ds but Gateway account has 3ds disabled - charge_external_id={}, operation_type={}, card_brand={}", chargeEntity.getExternalId(), OperationType.AUTHORISATION.getValue(), cardBrand); chargeEventDao.persistChargeEventOf(chargeEntity, Optional.empty()); paymentRequestDao.updateChargeTransactionStatus(chargeEntity.getExternalId(), ChargeStatus.fromString(chargeEntity.getStatus())); } else { preOperation(chargeEntity, OperationType.AUTHORISATION, getLegalStates(), AUTHORISATION_READY); Optional<PaymentRequestEntity> paymentRequestEntity = paymentRequestDao.findByExternalId(chargeEntity.getExternalId()); getPaymentProviderFor(chargeEntity).generateTransactionId().ifPresent(transactionIdValue -> { chargeEntity.setGatewayTransactionId(transactionIdValue); paymentRequestEntity.ifPresent(paymentRequest -> { if (paymentRequest.hasChargeTransaction()) { paymentRequest.getChargeTransaction().setGatewayTransactionId(transactionIdValue); } }); }); } return chargeEntity; }).orElseThrow(() -> new ChargeNotFoundRuntimeException(chargeId)); }</code><technical_language>Unnecessary cast</technical_language>

Target:
public ChargeEntity preOperation(String chargeId, AuthCardDetails authCardDetails) { return chargeDao.findByExternalId(chargeId).map(chargeEntity -> { String cardBrand = authCardDetails.getCardBrand(); if (!chargeEntity.getGatewayAccount().isRequires3ds() && cardBrandRequires3ds(cardBrand)) { chargeEntity.setStatus(AUTHORISATION_ABORTED); logger.error("AuthCardDetails authorisation failed pre operation. Card brand requires 3ds but Gateway account has 3ds disabled - charge_external_id={}, operation_type={}, card_brand={}", chargeEntity.getExternalId(), OperationType.AUTHORISATION.getValue(), cardBrand); chargeEventDao.persistChargeEventOf(chargeEntity, Optional.empty()); statusUpdater.updateChargeTransactionStatus(chargeEntity.getExternalId(), ChargeStatus.fromString(chargeEntity.getStatus())); } else { preOperation(chargeEntity, OperationType.AUTHORISATION, getLegalStates(), AUTHORISATION_READY); Optional<PaymentRequestEntity> paymentRequestEntity = paymentRequestDao.findByExternalId(chargeEntity.getExternalId()); getPaymentProviderFor(chargeEntity).generateTransactionId().ifPresent(transactionIdValue -> { setGatewayTransactionId(chargeEntity, transactionIdValue, paymentRequestEntity); }); } return chargeEntity; }).orElseThrow(() -> new ChargeNotFoundRuntimeException(chargeId)); }
Source:
<code>private JEditorPane createGeneralInfoPane() { JEditorPane infoTextPane = new JEditorPane(); infoTextPane.putClientProperty( JEditorPane.HONOR_DISPLAY_PROPERTIES, true); infoTextPane.setOpaque(false); infoTextPane.setEditable(false); infoTextPane.setContentType("text/html"); infoTextPane.addHyperlinkListener(new HyperlinkListener() { public void hyperlinkUpdate(HyperlinkEvent e) { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED && e.getURL() != null && CERTIFICATE_URL.equals(e.getURL().toString())) { List<Call> calls = callConference.getCalls(); if (!calls.isEmpty()) { Call aCall = calls.get(0); Certificate[] chain = aCall.getProtocolProvider() .getOperationSet(OperationSetTLS.class) .getServerCertificates(); ViewCertificateFrame certFrame = new ViewCertificateFrame(chain, null, resources.getI18NString( <START> "service.gui.callinfo.TLS_CERTIFICATE_CONTENT")); <END> certFrame.setVisible(true); } } } }); return infoTextPane; }</code><technical_language>Line is long. CallInfoFrame implement HyperlinkListener remove a level of nesting</technical_language>

Target:
private JEditorPane createGeneralInfoPane() { JEditorPane infoTextPane = new JEditorPane(); infoTextPane.putClientProperty( JEditorPane.HONOR_DISPLAY_PROPERTIES, true); infoTextPane.setOpaque(false); infoTextPane.setEditable(false); infoTextPane.setContentType("text/html"); infoTextPane.addHyperlinkListener(this); return infoTextPane; }
Source:
<code><START> final AbstractInsnNode skipNonOpcodes(AbstractInsnNode cursor) { <END> while (cursor != null && (cursor.getType() == AbstractInsnNode.FRAME || cursor.getType() == AbstractInsnNode.LABEL || cursor.getType() == AbstractInsnNode.LINE)) { cursor = cursor.getNext(); } return cursor; }</code><technical_language>this method change state (unlike others) I prefer declare static</technical_language>

Target:
static AbstractInsnNode skipNonOpcodes(AbstractInsnNode cursor) { while (cursor != null && (cursor.getType() == AbstractInsnNode.FRAME || cursor.getType() == AbstractInsnNode.LABEL || cursor.getType() == AbstractInsnNode.LINE)) { cursor = cursor.getNext(); } return cursor; }
Source:
<code>public double variance() { if (numEntries == 1) { return 0; } <START> return mean2 / (numEntries - 1); <END> }</code><technical_language>(numEntries - 1) means this is calculating a sample variance true variance of data read in pipeline. I this is want anyway, this numEntries instead of (numEntires - 1) with</technical_language>

Target:
public double variance() { if (numEntries == 0) { return 0; } return mean2 / numEntries; }
Source:
<code>public RuleReference decorateRule(Rule referencedRule, Element ruleElement) { RuleReference ruleReference = new RuleReference(); ruleReference.setRule(referencedRule); if (ruleElement.hasAttribute(DEPRECATED.name)) { ruleReference.setDeprecated(Boolean.parseBoolean(ruleElement.getAttribute(DEPRECATED.name))); } if (ruleElement.hasAttribute(NAME.name)) { ruleReference.setName(ruleElement.getAttribute(NAME.name)); } if (ruleElement.hasAttribute(MESSAGE.name)) { ruleReference.setMessage(ruleElement.getAttribute(MESSAGE.name)); } if (ruleElement.hasAttribute(EXTERNAL_INFO_URL.name)) { ruleReference.setExternalInfoUrl(ruleElement.getAttribute(EXTERNAL_INFO_URL.name)); } for (int i = 0; i < ruleElement.getChildNodes().getLength(); i++) { Node node = ruleElement.getChildNodes().item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { <START> RulesetSchemaConstants name = EnumUtils.getEnum(RulesetSchemaConstants.class, <END> node.getNodeName().toUpperCase()); switch (name) { case DESCRIPTION: ruleReference.setDescription(parseTextNode(node)); break; case EXAMPLE: ruleReference.addExample(parseTextNode(node)); break; case PRIORITY: ruleReference.setPriority(RulePriority.valueOf(Integer.parseInt(parseTextNode(node)))); break; case PROPERTIES: setPropertyValues(ruleReference, (Element) node); break; default: throw new IllegalArgumentException("Unexpected element <" + node.getNodeName() + "> encountered as child of <rule> element for Rule " + ruleReference.getName()); } } } return ruleReference; }</code><technical_language>This enum's name declared identifier "name" attribute... means, if refactor enum values, parsing broken</technical_language>

Target:
public RuleReference decorateRule(Rule referencedRule, Element ruleElement) { RuleReference ruleReference = new RuleReference(); ruleReference.setRule(referencedRule); if (ruleElement.hasAttribute(DEPRECATED)) { ruleReference.setDeprecated(Boolean.parseBoolean(ruleElement.getAttribute(DEPRECATED))); } if (ruleElement.hasAttribute(NAME)) { ruleReference.setName(ruleElement.getAttribute(NAME)); } if (ruleElement.hasAttribute(MESSAGE)) { ruleReference.setMessage(ruleElement.getAttribute(MESSAGE)); } if (ruleElement.hasAttribute(EXTERNAL_INFO_URL)) { ruleReference.setExternalInfoUrl(ruleElement.getAttribute(EXTERNAL_INFO_URL)); } for (int i = 0; i < ruleElement.getChildNodes().getLength(); i++) { Node node = ruleElement.getChildNodes().item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { switch (node.getNodeName()) { case DESCRIPTION: ruleReference.setDescription(parseTextNode(node)); break; case EXAMPLE: ruleReference.addExample(parseTextNode(node)); break; case PRIORITY: ruleReference.setPriority(RulePriority.valueOf(Integer.parseInt(parseTextNode(node)))); break; case PROPERTIES: setPropertyValues(ruleReference, (Element) node); break; default: throw new IllegalArgumentException("Unexpected element <" + node.getNodeName() + "> encountered as child of <rule> element for Rule " + ruleReference.getName()); } } } return ruleReference; }
Source:
<code>public void bindView(View view, Context context, Cursor cursor) { ((ProviderListItem) view).bindView(cursor); <START> if (mAccountSettingList != null && mAccountSettingList.size() > cursor.getPosition()) <END> ((ProviderListItem) view).applyView(mAccountSettingList.get(cursor.getPosition())); }</code><technical_language>This check is enough, new cursor insertion instead of append, extra info skewed</technical_language>

Target:
public void bindView(View view, Context context, Cursor cursor) { ((ProviderListItem) view).bindView(cursor); if (mAccountSettingList != null) ((ProviderListItem) view).applyView(mAccountSettingList.get(cursor.getPosition())); }
Source:
<code>private Pair<CreditDiscountFactors, LegalEntitySurvivalProbabilities> reduceDiscountFactors( <START> ResolvedCds cds, CreditRatesProvider ratesProvider) { <END> Currency currency = cds.getCurrency(); CreditDiscountFactors discountFactors = ratesProvider.discountFactors(currency); ArgChecker.isTrue(discountFactors instanceof IsdaCompliantZeroRateDiscountFactors, "discount factors must be IsdaCompliantZeroRateDiscountFactors"); LegalEntitySurvivalProbabilities survivalProbabilities = ratesProvider.survivalProbabilities(cds.getLegalEntityId(), currency); ArgChecker.isTrue(survivalProbabilities.getSurvivalProbabilities() instanceof IsdaCompliantZeroRateDiscountFactors, "survival probabilities must be IsdaCompliantZeroRateDiscountFactors"); ArgChecker.isTrue(discountFactors.getDayCount().equals(survivalProbabilities.getSurvivalProbabilities().getDayCount()), "day count conventions of discounting curve and credit curve must be the same"); return Pair.of(discountFactors, survivalProbabilities); }</code><technical_language>argument a new line</technical_language>

Target:
private Pair<CreditDiscountFactors, LegalEntitySurvivalProbabilities> reduceDiscountFactors( ResolvedCds cds, CreditRatesProvider ratesProvider) { Currency currency = cds.getCurrency(); CreditDiscountFactors discountFactors = ratesProvider.discountFactors(currency); ArgChecker.isTrue(discountFactors.isIsdaCompliant(), "discount factors must be IsdaCompliantZeroRateDiscountFactors"); LegalEntitySurvivalProbabilities survivalProbabilities = ratesProvider.survivalProbabilities(cds.getLegalEntityId(), currency); ArgChecker.isTrue(survivalProbabilities.getSurvivalProbabilities().isIsdaCompliant(), "survival probabilities must be IsdaCompliantZeroRateDiscountFactors"); ArgChecker.isTrue(discountFactors.getDayCount().equals(survivalProbabilities.getSurvivalProbabilities().getDayCount()), "day count conventions of discounting curve and credit curve must be the same"); return Pair.of(discountFactors, survivalProbabilities); }
Source:
<code>public static boolean isReactOnSelection() { IPreferenceStore preferenceStore = getPreferencesStore(); if (!preferenceStore .contains(UIPreferences.REBASE_INTERACTIVE_SYNC_SELECTION)) preferenceStore.setDefault( <START> UIPreferences.REBASE_INTERACTIVE_SYNC_SELECTION, true); <END> return preferenceStore .getBoolean(UIPreferences.REBASE_INTERACTIVE_SYNC_SELECTION); }</code><technical_language>I setting defaults is in PluginPreferenceInitializer class</technical_language>

Target:
public static boolean isReactOnSelection() { return getPreferencesStore().getBoolean( UIPreferences.REBASE_INTERACTIVE_SYNC_SELECTION); }