auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onStepCountLimitInputChange( ChangeEvent event ) { try { Integer value = stepCountLimitInput.getValue().isEmpty() ? null : Integer.parseInt( stepCountLimitInput.getValue() ); presenter.onStepCountLimitChange( value ); } catch ( NumberFormatException e ) { } }

Target:
public void onStepCountLimitInputChange( ChangeEvent event ) { boolean isNumeric = stepCountLimitInput.getValue().matches( "\\d+" ); if (isNumeric) { presenter.onStepCountLimitChange( Integer.parseInt( stepCountLimitInput.getValue() ) ); } else { presenter.onStepCountLimitChange( 0 ); stepCountLimitInput.setValue( "0" ); } }
Source:
public void testClusterNodeMetrics() throws Exception { IgniteEx 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; }

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:
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()); }

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:
public void testExcludeNested() throws URISyntaxException { Response response = given().param("species", "mmusculus_grcm38").param("exclude", "filesAttrs").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()); } } }

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:
public static String cleanUri(String uri) { if (uri.charAt(0) == '<') { uri = uri.substring(1, uri.length() - 1).toLowerCase(); } uri = uri.replaceAll("^<LINK_0>", "fb:"); uri = uri.replaceAll("^<LINK_1>", "fbkey:"); return uri; }

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:
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); 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); } }

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:
protected void checkTxCommandResponses(Map<Address, Response> responseMap, TransactionBoundaryCommand command, TxInvocationContext<LocalTransaction> context, Collection<Address> recipients) { OutdatedTopologyException outdatedTopologyException = null; if (command.getTopologyId() != stateTransferManager.getCacheTopology().getTopologyId()) { 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; } }

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:
private <T> Collection<? extends Callable<T>> instrument(Collection<? extends Callable<T>> tasks) { List<InstrumentedCallable<T>> instrumented = new ArrayList<InstrumentedCallable<T>>(); for (Callable<T> task : tasks) { instrumented.add(new InstrumentedCallable(task)); } return instrumented; }

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:
protected void initActionContext(ActionContext actionContext) { actionContext.setParameters(HttpParameters.create(request.getParameterMap()).build()); initSession(actionContext); applyAdditionalParams(actionContext); ActionContext.bound(actionContext); }

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

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:
public void testDocumentIdAsPrimaryKey() throws Exception { indexType2TweeterDocuments(); final Table table = dataContext.getDefaultSchema().getTableByName(DEFAULT_TABLE_NAME); final Column[] pks = table.getPrimaryKeys().toArray(new Column[0]); 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()); } }

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:
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 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(); } }

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:
public ConcordanceIterator(final Iterator<VariantContext> truthIterator, final Iterator<VariantContext> evalIterator) { this.truthIterator = new PeekableIterator<VariantContext>(truthIterator); this.evalIterator = new PeekableIterator<VariantContext>(evalIterator); }

Target:
protected ConcordanceIterator(final Iterator<VariantContext> truthIterator, final Iterator<VariantContext> evalIterator) { this.truthIterator = new PeekableIterator<>(truthIterator); this.evalIterator = new PeekableIterator<>(evalIterator); }
Source:
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(); assertThat(xmlsuite.getTests().get(0).getMethodSelectors().size()).isEqualTo(1); }

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:
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: return Status.x100; } return Status.Unknown; }

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:
@Override protected void onFinishInflate() { super.onFinishInflate(); ButterKnife.inject(this); titleView.setOnFocusChangeListener(new OnFocusChangeListener() { @Override public void onFocusChange(View v, boolean hasFocus) { if (!hasFocus) { EditText editText = (EditText) v; 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); }

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:
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) { } } return blobProperties; }

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:
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(); 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(); } }); }

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:
public void stop(long timeoutMs) { LOG.info("Shutting down KafkaConsumerProxy poll thread:" + consumerPollThread.getName()); 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(); } }

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:
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 ? Boolean.TRUE : Boolean.FALSE); } } finally { updating = false; } notifyIfChanged(index); }

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:
private void addBondToUpdateList(Bond bond) { while (hostSetupNetworksParametersData.newOrModifiedBonds.iterator().hasNext()) { Bond oldModifiedBond = hostSetupNetworksParametersData.newOrModifiedBonds.iterator().next(); if (oldModifiedBond.getName().equals(bond.getName())) { hostSetupNetworksParametersData.newOrModifiedBonds.iterator().remove(); break; } } hostSetupNetworksParametersData.newOrModifiedBonds.add(bond); }

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:
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); String virtualServer = config.hasDefined(ModelKeys.VIRTUAL_SERVER) ? config.get(ModelKeys.VIRTUAL_SERVER).asString() : DEFAULT_VIRTUAL_SERVER; 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(); }

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:
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(); fileContents = "abcdef 1234567890".getBytes(UTF_8); }

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:
public IntegrationFlow markers() { return f -> f.<FileSplitter.FileMarker>filter(m -> m.getMark().equals(FileSplitter.FileMarker.Mark.END), e -> e.id("markerFilter").discardChannel("nullChannel")) .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"))); }

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:
public static TumblingProcessingTimeWindows of(Time size, Time offset, WindowStagger windowStagger) throws Exception { return new TumblingProcessingTimeWindows(size.toMilliseconds(), offset.toMilliseconds(), windowStagger); }

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

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:
public int getPrimaryPlanetPosition() { if(primarySlot<1) { return(1); } return primarySlot; }

Target:
public int getPrimaryPlanetPosition() { if(primarySlot<1) { return 1; } return primarySlot; }
Source:
public 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; }

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:
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 { workspace = ResourcesPlugin.getWorkspace(); } 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; }

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:
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; } return password; }

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:
public ChargeEntity preOperation(String chargeId, AuthCardDetails authCardDetails) { return chargeDao.findByExternalId(chargeId).map((ChargeEntity 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()); 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)); }

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:
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( "service.gui.callinfo.TLS_CERTIFICATE_CONTENT")); certFrame.setVisible(true); } } } }); return infoTextPane; }

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:
final AbstractInsnNode skipNonOpcodes(AbstractInsnNode cursor) { while (cursor != null && (cursor.getType() == AbstractInsnNode.FRAME || cursor.getType() == AbstractInsnNode.LABEL || cursor.getType() == AbstractInsnNode.LINE)) { cursor = cursor.getNext(); } return cursor; }

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:
public double variance() { if (numEntries == 1) { return 0; } return mean2 / (numEntries - 1); }

Target:
public double variance() { if (numEntries == 0) { return 0; } return mean2 / numEntries; }
Source:
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) { RulesetSchemaConstants name = EnumUtils.getEnum(RulesetSchemaConstants.class, 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; }

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:
public void bindView(View view, Context context, Cursor cursor) { ((ProviderListItem) view).bindView(cursor); if (mAccountSettingList != null && mAccountSettingList.size() > cursor.getPosition()) ((ProviderListItem) view).applyView(mAccountSettingList.get(cursor.getPosition())); }

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:
private Pair<CreditDiscountFactors, LegalEntitySurvivalProbabilities> reduceDiscountFactors( ResolvedCds cds, CreditRatesProvider ratesProvider) { 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); }

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:
public static boolean isReactOnSelection() { IPreferenceStore preferenceStore = getPreferencesStore(); if (!preferenceStore .contains(UIPreferences.REBASE_INTERACTIVE_SYNC_SELECTION)) preferenceStore.setDefault( UIPreferences.REBASE_INTERACTIVE_SYNC_SELECTION, true); return preferenceStore .getBoolean(UIPreferences.REBASE_INTERACTIVE_SYNC_SELECTION); }

Target:
public static boolean isReactOnSelection() { return getPreferencesStore().getBoolean( UIPreferences.REBASE_INTERACTIVE_SYNC_SELECTION); }
Source:
public String getDisplayName() { return "Throttle execution of node blocks within this body"; }

Target:
public String getDisplayName() { return Messages.ThrottleStep_DisplayName(); }
Source:
private boolean categorizeField(Element element) { VariableElement field = (VariableElement) element; if (field.getModifiers().contains(Modifier.STATIC)) { return true; } if (field.getAnnotation(Ignore.class) != null || field.getModifiers().contains(Modifier.TRANSIENT)) { return true; } if (field.getAnnotation(Index.class) != null) { if (!categorizeIndexField(element, field)) { return false; } } if (Utils.isRealmList(field)) { if (!hasRequiredAnnotation(field)) { final List<? extends TypeMirror> fieldTypeArguments = ((DeclaredType) field.asType()).getTypeArguments(); if (fieldTypeArguments.isEmpty() || !Utils.isRealmModel(fieldTypeArguments.get(0))) { nullableValueListFields.add(field); } } } else { if (isRequiredField(field)) { categorizeRequiredField(element, field); } else { if (!Utils.isPrimitiveType(field)) { nullableFields.add(field); } } } if (field.getAnnotation(PrimaryKey.class) != null) { if (!categorizePrimaryKeyField(field)) { return false; } } if (field.getAnnotation(LinkingObjects.class) != null) { return categorizeBacklinkField(field); } if (Utils.isMutableRealmInteger(field)) { if (!categorizeMutableRealmIntegerField(field)) { return false; } } fields.add(field); return true; }

Target:
private boolean categorizeField(Element element) { VariableElement field = (VariableElement) element; if (field.getModifiers().contains(Modifier.STATIC)) { return true; } if (field.getAnnotation(Ignore.class) != null || field.getModifiers().contains(Modifier.TRANSIENT)) { return true; } if (field.getAnnotation(Index.class) != null) { if (!categorizeIndexField(element, field)) { return false; } } if (Utils.isRealmList(field)) { if (!hasRequiredAnnotation(field)) { final List<? extends TypeMirror> fieldTypeArguments = ((DeclaredType) field.asType()).getTypeArguments(); if (fieldTypeArguments.isEmpty() || !Utils.isRealmModel(fieldTypeArguments.get(0))) { nullableValueListFields.add(field); } } } else if (isRequiredField(field)) { categorizeRequiredField(element, field); } else { if (!Utils.isPrimitiveType(field) && !Utils.isRealmResults(field)) { nullableFields.add(field); } } if (field.getAnnotation(PrimaryKey.class) != null) { if (!categorizePrimaryKeyField(field)) { return false; } } if (field.getAnnotation(LinkingObjects.class) != null) { return categorizeBacklinkField(field); } if (Utils.isMutableRealmInteger(field)) { if (!categorizeMutableRealmIntegerField(field)) { return false; } } fields.add(field); return true; }
Source:
private void delay(final RetryOnFailure rof, final int attempt) throws InterruptedException { final long delay; if (rof.randomize()) { delay = RAND.nextInt(2 << attempt) * rof.delay(); } else { delay = rof.delay() * attempt; } rof.unit().sleep(delay); }

Target:
private void delay(final RetryOnFailure rof, final int attempt) throws InterruptedException { final long delay; if (rof.randomize()) { delay = Repeater.RAND.nextInt(2 << attempt) * rof.delay(); } else { delay = rof.delay() * attempt; } rof.unit().sleep(delay); }
Source:
public void unconsentedSignInSetsCookie() throws Exception { Http.Response mockResponse = mockPlayContextWithJson(EMAIL_PASSWORD_SIGN_IN_REQUEST); when(authenticationService.signIn(any(), any(), any())).thenThrow(new ConsentRequiredException(userSession)); try { controller.signInV4(); fail("Should have thrown exeption"); } catch(ConsentRequiredException e) { verify(mockResponse).setCookie(BridgeConstants.SESSION_TOKEN_HEADER, TEST_SESSION_TOKEN, BridgeConstants.BRIDGE_SESSION_EXPIRE_IN_SECONDS, "/"); } }

Target:
public void unconsentedSignInSetsCookie() throws Exception { response = mockPlayContextWithJson(EMAIL_PASSWORD_SIGN_IN_REQUEST); when(authenticationService.signIn(any(), any(), any())).thenThrow(new ConsentRequiredException(userSession)); try { controller.signInV4(); fail("Should have thrown exeption"); } catch(ConsentRequiredException e) { } verifyCommonLoggingForSignIns(); }