auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void forgetSuccessfullyCompletedTransaction(RecoveryManager recoveryManager, Xid xid, LocalXaTransaction localTransaction, boolean committedInOnePhase) { final GlobalTransaction gtx = localTransaction.getGlobalTransaction(); if (recoveryEnabled) { recoveryManager.removeRecoveryInformationFromCluster(localTransaction.getRemoteLocksAcquired(), xid, false, gtx, partitionHandlingManager.isTransactionPartiallyCommitted(gtx)); txTable.removeLocalTransaction(localTransaction); } else { releaseLocksForCompletedTransaction(localTransaction, committedInOnePhase); } }

Target:
private void forgetSuccessfullyCompletedTransaction(RecoveryManager recoveryManager, Xid xid, LocalXaTransaction localTransaction, boolean committedInOnePhase) { final GlobalTransaction gtx = localTransaction.getGlobalTransaction(); if (recoveryEnabled) { recoveryManager.removeRecoveryInformation(localTransaction.getRemoteLocksAcquired(), xid, false, gtx, partitionHandlingManager.isTransactionPartiallyCommitted(gtx)); txTable.removeLocalTransaction(localTransaction); } else { releaseLocksForCompletedTransaction(localTransaction, committedInOnePhase); } }
Source:
protected RecordedRequest assertSent(MockWebServer server, String method, String path, String json) throws InterruptedException { RecordedRequest request = assertSent(server, method, path); assertEquals(request.getHeader("Accept"), "application/json; version=" + ctx.getMetadata().get("apiVersion")); assertEquals(parser.parse(new String(request.getBody(), Charsets.UTF_8)), parser.parse(json)); return request; }

Target:
protected RecordedRequest assertSent(MockWebServer server, String method, String path, String json) throws InterruptedException { RecordedRequest request = assertSent(server, method, path); assertEquals(request.getHeader("Content-Type"), "application/json"); assertEquals(parser.parse(new String(request.getBody(), Charsets.UTF_8)), parser.parse(json)); return request; }
Source:
public void testDefault(String suffix) throws FormatException, IOException { outFile = tempDir.resolve("test." + suffix).toFile(); String[] args = {"test.fake", outFile.getAbsolutePath()}; try { ImageConverter.main(args); } catch (ExitException e) { outFile.deleteOnExit(); assertEquals(e.status, 0); checkImage(); } }

Target:
public void testDefault(String suffix) throws FormatException, IOException { outFile = tempDir.resolve("test" + suffix).toFile(); String[] args = {"test.fake", outFile.getAbsolutePath()}; try { ImageConverter.main(args); } catch (ExitException e) { outFile.deleteOnExit(); assertEquals(e.status, 0); checkImage(); } }
Source:
public void setUp() throws Exception { MockitoAnnotations.initMocks(this); mSession = mockitoSession() .spyStatic(DeviceConfig.class) .strictness(Strictness.WARN) .startMocking(); final Context context = InstrumentationRegistry.getContext(); setDismissPortalInValidatedNetwork(true); NetworkCapabilities nc = new NetworkCapabilities(); doReturn(nc).when(sMockConnectivityManager).getNetworkCapabilities(mNetwork); mActivity = (InstrumentedCaptivePortalLoginActivity) mActivityRule.launchActivity( new Intent(ACTION_CAPTIVE_PORTAL_SIGN_IN) .putExtra(EXTRA_CAPTIVE_PORTAL_URL, TEST_URL) .putExtra(EXTRA_NETWORK, mNetwork) .putExtra(EXTRA_CAPTIVE_PORTAL, new MockCaptivePortal()) ); assertNotNull(mActivity); }

Target:
public void setUp() throws Exception { MockitoAnnotations.initMocks(this); mSession = mockitoSession() .spyStatic(DeviceConfig.class) .strictness(Strictness.WARN) .startMocking(); final Context context = InstrumentationRegistry.getContext(); setDismissPortalInValidatedNetwork(true); final NetworkCapabilities nc = new NetworkCapabilities(); doReturn(nc).when(sMockConnectivityManager).getNetworkCapabilities(mNetwork); mActivity = (InstrumentedCaptivePortalLoginActivity) mActivityRule.launchActivity( new Intent(ACTION_CAPTIVE_PORTAL_SIGN_IN) .putExtra(EXTRA_CAPTIVE_PORTAL_URL, TEST_URL) .putExtra(EXTRA_NETWORK, mNetwork) .putExtra(EXTRA_CAPTIVE_PORTAL, new MockCaptivePortal()) ); assertNotNull(mActivity); }
Source:
private void updateMappings(final DragAndDropTarget container) { if (container instanceof DSemanticDecorator && !new DSemanticDecoratorQuery((DSemanticDecorator) container).hasDetachedTarget()) { mappingsManager.iterate(new MappingUpdateVisitor(container), container); for (final DDiagramElement child : DiagramElementsHierarchyVisitor.INSTANCE.getChildren(container)) { if (child instanceof DragAndDropTarget) { updateMappings((DragAndDropTarget) child); } } } }

Target:
private void updateMappings(final DragAndDropTarget container) { if (container instanceof DSemanticDecorator) { DSemanticDecorator dSemanticDecorator = (DSemanticDecorator) container; if (!new DSemanticDecoratorQuery(dSemanticDecorator).hasDetachedTarget()) { safeUpdateMappings(container); } } else { safeUpdateMappings(container); } }
Source:
public void onSitePluginsFetched(OnSitePluginsFetched event) { if (isFinishing()) { return; } mProgressBar.setVisibility(View.GONE); if (event.isError()) { ToastUtils.showToast(this, "An error occurred while fetching the plugins: " + event.error.message); return; } refreshPluginList(); }

Target:
public void onSitePluginsFetched(OnSitePluginsFetched event) { if (isFinishing()) { return; } mProgressBar.setVisibility(View.GONE); if (event.isError()) { AppLog.e(T.API, "An error occurred while fetching the plugins: " + event.error.message); return; } refreshPluginList(); }
Source:
public void merge(AttributeSet attributes) { for (Attribute sourceAttr: attributes.getAttributes()) { attributeMap.put(sourceAttr.getName(), sourceAttr); } }

Target:
public AttributeSet merge(AttributeSet attributes) { Map<String, Attribute> merged = new LinkedHashMap<>(); for (Attribute attr : getAttributes()) { merged.put(attr.getCoRELinkParam(), attr); } if (attributes != null) { for (Attribute attr : attributes.getAttributes()) { merged.put(attr.getCoRELinkParam(), attr); } } return new AttributeSet(merged.values()); }
Source:
private void enhanceCommitUpdates(EKBCommit commit) throws EKBException { Map<Object, OpenEngSBModel> updated = new HashMap<Object, OpenEngSBModel>(); commit.getUpdates().addAll(recursiveUpdateEnhancement(commit.getUpdates(), updated, commit)); }

Target:
private void enhanceCommitUpdates(EKBCommit commit) throws EKBException { Map<Object, SimpleModelWrapper> updated = new HashMap<Object, SimpleModelWrapper>(); List<SimpleModelWrapper> result = recursiveUpdateEnhancement( convertOpenEngSBModelList(commit.getUpdates()), updated, commit); commit.getUpdates().addAll(convertSimpleModelWrapperList(result)); }
Source:
public long getTimestamp() { if (timestampField != null) { try { Object eventTimestamp = super.getRecord().get(timestampField); if (eventTimestamp != null) { if ("unix_milliseconds".equals(timestampFormat)){ return getAsLong(eventTimestamp); }else if ("unix_seconds".equals(timestampFormat)){ return getAsLong(eventTimestamp) * 1000; }else if("iso".equals(timestampFormat)){ return isoDateTimeParser.parseDateTime(eventTimestamp.toString()).getMillis(); }else{ return new SimpleDateFormat(timestampFormat).parse(eventTimestamp.toString()).getTime(); } } } catch (ParseException e) { log.error("Error parsing timestamp!", e); } } Record header = (Record) super.getRecord().get("header"); if (header != null && header.get("time") != null) { return (Long) header.get("time"); } else if (super.getRecord().get("timestamp") != null) { return (Long) super.getRecord().get("timestamp"); } else { return System.currentTimeMillis(); } }

Target:
public long getTimestamp() throws ParseException { Record header = (Record) super.getRecord().get("header"); if (header != null && header.get("time") != null) { return (Long) header.get("time"); } else if (super.getRecord().get(timestampField) != null) { Object eventTimestamp = super.getRecord().get(timestampField); if (UNIX_MILLISECONDS.equals(timestampFormat)){ return getAsLong(eventTimestamp); }else if (UNIX_SECONDS.equals(timestampFormat) || UNIX.equals(timestampFormat)){ return getAsLong(eventTimestamp) * 1000; }else if(ISO_8601.equals(timestampFormat)) { return isoDateTimeParser.parseDateTime(eventTimestamp.toString()).getMillis(); }else { return new SimpleDateFormat(timestampFormat).parse(eventTimestamp.toString()).getTime(); } } else { return System.currentTimeMillis(); } }
Source:
private ZkCacheBaseDataAccessor(Builder builder) { _chrootPath = builder._chrootPath; _wtCachePaths = builder._wtCachePaths; _zkCachePaths = builder._zkCachePaths; RealmAwareZkClient zkClient; switch (builder._realmMode) { case MULTI_REALM: try { zkClient = new FederatedZkClient(builder._realmAwareZkConnectionConfig, builder._realmAwareZkClientConfig); break; } catch (IOException | InvalidRoutingDataException | IllegalStateException e) { } case SINGLE_REALM: switch (builder._zkClientType) { case DEDICATED: zkClient = DedicatedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(builder._zkAddress), builder._realmAwareZkClientConfig.createHelixZkClientConfig()); break; case SHARED: default: zkClient = SharedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(builder._zkAddress), builder._realmAwareZkClientConfig.createHelixZkClientConfig()); zkClient.waitUntilConnected(HelixZkClient.DEFAULT_CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS); } break; default: throw new HelixException("Invalid RealmMode given: " + builder._realmMode); } _zkClient = zkClient; _baseAccessor = new ZkBaseDataAccessor<>(_zkClient); start(); }

Target:
private ZkCacheBaseDataAccessor(Builder builder) { _chrootPath = builder._chrootPath; _wtCachePaths = builder._wtCachePaths; _zkCachePaths = builder._zkCachePaths; RealmAwareZkClient zkClient; switch (builder._realmMode) { case MULTI_REALM: try { if (builder._zkClientType == ZkBaseDataAccessor.ZkClientType.DEDICATED) { zkClient = DedicatedZkClientFactory.getInstance() .buildZkClient(builder._realmAwareZkConnectionConfig, builder._realmAwareZkClientConfig); } else if (builder._zkClientType == ZkBaseDataAccessor.ZkClientType.SHARED) { zkClient = SharedZkClientFactory.getInstance() .buildZkClient(builder._realmAwareZkConnectionConfig, builder._realmAwareZkClientConfig); } else { zkClient = new FederatedZkClient(builder._realmAwareZkConnectionConfig, builder._realmAwareZkClientConfig); } break; } catch (IOException | InvalidRoutingDataException | IllegalStateException e) { throw new HelixException("Failed to create ZkCacheBaseDataAccessor!", e); } case SINGLE_REALM: switch (builder._zkClientType) { case DEDICATED: zkClient = DedicatedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(builder._zkAddress), builder._realmAwareZkClientConfig.createHelixZkClientConfig()); break; case SHARED: default: zkClient = SharedZkClientFactory.getInstance() .buildZkClient(new HelixZkClient.ZkConnectionConfig(builder._zkAddress), builder._realmAwareZkClientConfig.createHelixZkClientConfig()); zkClient.waitUntilConnected(HelixZkClient.DEFAULT_CONNECTION_TIMEOUT, TimeUnit.MILLISECONDS); break; } default: throw new HelixException("Invalid RealmMode given: " + builder._realmMode); } _zkClient = zkClient; _baseAccessor = new ZkBaseDataAccessor<>(_zkClient); start(); }
Source:
public List<HasMetadata> buildAccompanyingKubernetesResources() throws IOException { if (!kubernetesJobManagerParameters.isInternalServiceEnabled()) { return Collections.emptyList(); } final String serviceName = KubernetesUtils.getInternalServiceName(kubernetesJobManagerParameters.getClusterId()); final Service headlessService = new ServiceBuilder() .withApiVersion(Constants.API_VERSION) .withNewMetadata() .withName(serviceName) .withLabels(kubernetesJobManagerParameters.getCommonLabels()) .endMetadata() .withNewSpec() .withClusterIP("None") .withSelector(kubernetesJobManagerParameters.getLabels()) .addNewPort() .withName(Constants.JOB_MANAGER_RPC_PORT_NAME) .withPort(kubernetesJobManagerParameters.getRPCPort()) .endPort() .addNewPort() .withName(Constants.BLOB_SERVER_PORT_NAME) .withPort(kubernetesJobManagerParameters.getBlobServerPort()) .endPort() .endSpec() .build(); final String namespace = kubernetesJobManagerParameters.getNamespace(); kubernetesJobManagerParameters.getFlinkConfiguration().setString(JobManagerOptions.ADDRESS, serviceName + "." + namespace); return Collections.singletonList(headlessService); }

Target:
public List<HasMetadata> buildAccompanyingKubernetesResources() throws IOException { if (!kubernetesJobManagerParameters.isInternalServiceEnabled()) { return Collections.emptyList(); } final String serviceName = KubernetesUtils.getInternalServiceName(kubernetesJobManagerParameters.getClusterId()); final Service headlessService = new ServiceBuilder() .withApiVersion(Constants.API_VERSION) .withNewMetadata() .withName(serviceName) .withLabels(kubernetesJobManagerParameters.getCommonLabels()) .endMetadata() .withNewSpec() .withClusterIP(Constants.HEADLESS_SERVICE_CLUSTER_IP) .withSelector(kubernetesJobManagerParameters.getLabels()) .addNewPort() .withName(Constants.JOB_MANAGER_RPC_PORT_NAME) .withPort(kubernetesJobManagerParameters.getRPCPort()) .endPort() .addNewPort() .withName(Constants.BLOB_SERVER_PORT_NAME) .withPort(kubernetesJobManagerParameters.getBlobServerPort()) .endPort() .endSpec() .build(); final String namespace = kubernetesJobManagerParameters.getNamespace(); kubernetesJobManagerParameters.getFlinkConfiguration().setString(JobManagerOptions.ADDRESS, serviceName + "." + namespace); return Collections.singletonList(headlessService); }
Source:
protected void onCreate(Bundle savedInstanceState) { setTheme(UserPreferences.getTranslucentTheme()); super.onCreate(savedInstanceState); StorageUtils.checkStorageAvailability(this); viewBinding = OnlinefeedviewActivityBinding.inflate(getLayoutInflater()); setContentView(viewBinding.getRoot()); viewBinding.transparentBackground.setOnClickListener(v -> finish()); viewBinding.card.setOnClickListener(null); viewBinding.autoDownloadCheckBox.setChecked(UserPreferences.isEnableAutodownload()); String feedUrl = null; if (getIntent().hasExtra(ARG_FEEDURL)) { feedUrl = getIntent().getStringExtra(ARG_FEEDURL); } else if (TextUtils.equals(getIntent().getAction(), Intent.ACTION_SEND) || TextUtils.equals(getIntent().getAction(), Intent.ACTION_VIEW)) { feedUrl = TextUtils.equals(getIntent().getAction(), Intent.ACTION_SEND) ? getIntent().getStringExtra(Intent.EXTRA_TEXT) : getIntent().getDataString(); } if (feedUrl == null) { Log.e(TAG, "feedUrl is null."); showNoPodcastFoundError(); } else { Log.d(TAG, "Activity was started with url " + feedUrl); setLoadingLayout(); if (feedUrl.contains("subscribeonandroid.com")) { feedUrl = feedUrl.replaceFirst("((www.)?(subscribeonandroid.com/))", ""); } if (savedInstanceState == null) { lookupUrlAndDownload(feedUrl, null, null); } else { lookupUrlAndDownload(feedUrl, savedInstanceState.getString("username"), savedInstanceState.getString("password")); } } }

Target:
protected void onCreate(Bundle savedInstanceState) { setTheme(UserPreferences.getTranslucentTheme()); super.onCreate(savedInstanceState); StorageUtils.checkStorageAvailability(this); viewBinding = OnlinefeedviewActivityBinding.inflate(getLayoutInflater()); setContentView(viewBinding.getRoot()); viewBinding.transparentBackground.setOnClickListener(v -> finish()); viewBinding.card.setOnClickListener(null); String feedUrl = null; if (getIntent().hasExtra(ARG_FEEDURL)) { feedUrl = getIntent().getStringExtra(ARG_FEEDURL); } else if (TextUtils.equals(getIntent().getAction(), Intent.ACTION_SEND) || TextUtils.equals(getIntent().getAction(), Intent.ACTION_VIEW)) { feedUrl = TextUtils.equals(getIntent().getAction(), Intent.ACTION_SEND) ? getIntent().getStringExtra(Intent.EXTRA_TEXT) : getIntent().getDataString(); } if (feedUrl == null) { Log.e(TAG, "feedUrl is null."); showNoPodcastFoundError(); } else { Log.d(TAG, "Activity was started with url " + feedUrl); setLoadingLayout(); if (feedUrl.contains("subscribeonandroid.com")) { feedUrl = feedUrl.replaceFirst("((www.)?(subscribeonandroid.com/))", ""); } if (savedInstanceState == null) { lookupUrlAndDownload(feedUrl, null, null); } else { lookupUrlAndDownload(feedUrl, savedInstanceState.getString("username"), savedInstanceState.getString("password")); } } }
Source:
@NotNull public CacheFilterEnum cacheFilterEnum() { return cacheFilterEnum; }

Target:
public CacheFilterEnum cacheFilterEnum() { return cacheFilterEnum; }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } IndexConfig that = (IndexConfig) o; if (name != null ? !name.equals(that.name) : that.name != null) { return false; } if (type != null ? !type.equals(that.type) : that.type != null) { return false; } return getAttributes().equals(that.getAttributes()); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } IndexConfig that = (IndexConfig) o; if (!Objects.equals(name, that.name)) { return false; } if (!Objects.equals(type, that.type)) { return false; } return getAttributes().equals(that.getAttributes()); }
Source:
@Override public <T> IgniteInternalFuture<Map<K, EntryProcessorResult<T>>> invokeAllAsync( Set<? extends K> keys, final EntryProcessor<K, V, T> entryProcessor, Object... args) { A.notNull(keys, "keys", entryProcessor, "entryProcessor"); if (keyCheck) validateCacheKeys(keys); checkKeysOrdered(keys, "Invoke All"); final boolean statsEnabled = ctx.statisticsEnabled(); final long start = statsEnabled ? System.nanoTime() : 0L; Map<? extends K, EntryProcessor> invokeMap = F.viewAsMap(keys, new C1<K, EntryProcessor>() { @Override public EntryProcessor apply(K k) { return entryProcessor; } }); IgniteInternalFuture fut = updateAllAsync0(null, invokeMap, args, true, false, null); if (statsEnabled) fut.listen(new InvokeAllTimeStatClosure(metrics0(), start)); return fut; }

Target:
@Override public <T> IgniteInternalFuture<Map<K, EntryProcessorResult<T>>> invokeAllAsync( Set<? extends K> keys, final EntryProcessor<K, V, T> entryProcessor, Object... args) { A.notNull(keys, "keys", entryProcessor, "entryProcessor"); if (keyCheck) validateCacheKeys(keys); warnIfUnordered(keys, BulkOperation.INVOKE); final boolean statsEnabled = ctx.statisticsEnabled(); final long start = statsEnabled ? System.nanoTime() : 0L; Map<? extends K, EntryProcessor> invokeMap = F.viewAsMap(keys, new C1<K, EntryProcessor>() { @Override public EntryProcessor apply(K k) { return entryProcessor; } }); IgniteInternalFuture fut = updateAllAsync0(null, invokeMap, args, true, false, null); if (statsEnabled) fut.listen(new InvokeAllTimeStatClosure(metrics0(), start)); return fut; }
Source:
public static int getLayers(ItemStack... items) { int layers = 0; for (ItemStack item : items) { if (item != null && item.getAmount() != 0 && (item.getAmount() < layers || layers == 0)) { layers = item.getAmount(); } } return layers; }

Target:
public static int getLayers(ItemStack... items) { int layers = 0; for (ItemStack item : items) { if (!InventoryUtil.isEmpty(item) && (item.getAmount() < layers || layers == 0)) { layers = item.getAmount(); } } return layers; }
Source:
private void doButtonPressed(int index) { switch (index) { case IDX_ADD: { List<String> existing= fFilterListField.getElements(); TypeFilterInputDialog dialog= new TypeFilterInputDialog(getShell(), existing); if (dialog.open() == Window.OK) { String res= (String) dialog.getResult(); fFilterListField.addElement(res); fFilterListField.setChecked(res, true); } break; } case IDX_ADD_PACKAGE: String[] res= choosePackage(); if (res != null) { fFilterListField.addElements(Arrays.asList(res)); for (String re : res) { fFilterListField.setChecked(re, true); } } break; case IDX_EDIT: { List<String> selected= fFilterListField.getSelectedElements(); if (selected.isEmpty()) { return; } String editedEntry= selected.get(0); List<String> existing= fFilterListField.getElements(); existing.remove(editedEntry); TypeFilterInputDialog dialog= new TypeFilterInputDialog(getShell(), existing); dialog.setInitialString(editedEntry); if (dialog.open() == Window.OK) { fFilterListField.replaceElement(editedEntry, (String) dialog.getResult()); } break; } default: break; } }

Target:
private void doButtonPressed(int index) { switch (index) { case IDX_ADD:{ List<String> existing= fFilterListField.getElements(); TypeFilterInputDialog dialog= new TypeFilterInputDialog(getShell(), existing); if (dialog.open() == Window.OK) { String res= (String) dialog.getResult(); fFilterListField.addElement(res); fFilterListField.setChecked(res, true); } } break; case IDX_ADD_PACKAGE: String[] res= choosePackage(); if (res != null) { fFilterListField.addElements(Arrays.asList(res)); for (String re : res) { fFilterListField.setChecked(re, true); } } break; case IDX_EDIT:{ List<String> selected= fFilterListField.getSelectedElements(); if (selected.isEmpty()) { return; } String editedEntry= selected.get(0); List<String> existing= fFilterListField.getElements(); existing.remove(editedEntry); TypeFilterInputDialog dialog= new TypeFilterInputDialog(getShell(), existing); dialog.setInitialString(editedEntry); if (dialog.open() == Window.OK) { fFilterListField.replaceElement(editedEntry, (String) dialog.getResult()); } } break; default: break; } }
Source:
private void testExistWithNonZero(String cmd) throws Exception { final ProcessBuilder processBuilder = new ProcessBuilder(TEST_SCRIPT_PATH, cmd); processBuilder.redirectErrorStream(true); final Process process = processBuilder.start(); final int exitValue = process.waitFor(); if (exitValue != 0) { final BufferedReader stdoutReader = new BufferedReader(new InputStreamReader(process.getInputStream())); final String stdout = stdoutReader.lines().collect(StringBuilder::new, StringBuilder::append, StringBuilder::append).toString(); log.error("Script exit with non-zero {}, output: {}", exitValue, stdout); throw new Exception("Script exist with non-zero."); } }

Target:
private void testExistWithNonZero(String cmd) throws Exception { final ProcessBuilder processBuilder = new ProcessBuilder(TEST_SCRIPT_PATH, cmd); processBuilder.redirectErrorStream(true); final Process process = processBuilder.start(); try (final BufferedReader stdoutReader = new BufferedReader(new InputStreamReader(process.getInputStream()))) { final int exitValue = process.waitFor(); if (exitValue != 0) { final String stdout = stdoutReader.lines().collect(StringBuilder::new, StringBuilder::append, StringBuilder::append).toString(); throw new Exception(String.format("Script exist with non-zero %d.\\n OUTPUT: %s", exitValue, stdout)); } } finally { process.destroyForcibly(); } }
Source:
private void processRedirectedEntity(MwRevision mwRevision) { try { RedirectedEntity document = jsonDeserializer.deserializeRedirectedEntity(mwRevision.getText()); entityDocumentProcessor.processRedirectedEntity(document); } catch (JsonParseException e1) { logger.error("Failed to parse JSON for lexeme " + mwRevision.getPrefixedTitle() + ": " + e1.getMessage()); } catch (JsonMappingException e1) { logger.error("Failed to map JSON for lexeme " + mwRevision.getPrefixedTitle() + ": " + e1.getMessage()); e1.printStackTrace(); System.out.print(mwRevision.getText()); } catch (IOException e1) { logger.error("Failed to read revision: " + e1.getMessage()); } }

Target:
private void processRedirectedEntity(MwRevision mwRevision) { try { RedirectedEntity document = jsonDeserializer.deserializeRedirectedEntity(mwRevision.getText()); entityDocumentProcessor.processRedirectedEntity(document); } catch (JsonParseException e1) { logger.error("Failed to parse JSON for redirect " + mwRevision.getPrefixedTitle() + ": " + e1.getMessage()); } catch (JsonMappingException e1) { logger.error("Failed to map JSON for redirect " + mwRevision.getPrefixedTitle() + ": " + e1.getMessage()); e1.printStackTrace(); System.out.print(mwRevision.getText()); } catch (IOException e1) { logger.error("Failed to read revision: " + e1.getMessage()); } }
Source:
public void verifyErrorIsPresented() { waitForElementByElement(errorField); Assertion.assertEquals(checkIfElementOnPage(errorField), true); }

Target:
public void verifyErrorIsPresented() { waitForElementByElement(errorField); Assertion.assertEquals(checkIfElementOnPage(errorField), true); PageObjectLogging.log("verifyErrorIsPresented", "Error message is visible", true, driver); }
Source:
private static void updateTenantsUnboundedFieldMap(GovernanceArtifactConfiguration rxtConfiguration) throws RegistryException { if (rxtConfiguration.getMediaType().matches("application/vnd.(.)+\\+xml")) { RXTIndexer.updateTenantsUnboundedFieldMap(rxtConfiguration.getContentDefinition().getParent().toString()); } }

Target:
private static void updateTenantsUnboundedFieldMap(GovernanceArtifactConfiguration rxtConfiguration) throws RegistryException { if (rxtConfiguration.getMediaType().matches("application/vnd.(.)+\\+xml")) { updateTenantsUnboundedFieldMap(rxtConfiguration.getContentDefinition().getParent().toString()); } }
Source:
public ExpressionInterceptUrlRegistry access(String attribute) { if (this.not) { attribute = "!" + attribute; } ExpressionUrlAuthorizationConfigurer.this.authorizationManagerBuilder .add(new RequestMatcherEntry<>(this.requestMatchers, new WebExpressionAuthorizationManager(attribute, getExpressionHandler(getBuilder())))); interceptUrl(this.requestMatchers, SecurityConfig.createList(attribute)); return ExpressionUrlAuthorizationConfigurer.this.REGISTRY; }

Target:
public ExpressionInterceptUrlRegistry access(String attribute) { if (this.not) { attribute = "!" + attribute; } interceptUrl(this.requestMatchers, SecurityConfig.createList(attribute)); return ExpressionUrlAuthorizationConfigurer.this.REGISTRY; }
Source:
String[] getProgramArguments() throws IOException { LOGGER.entering(); List<String> args = new LinkedList<>(Arrays.asList(super.getProgramArguments())); for (Entry<String, JsonElement> entry : defaultArgs.entrySet()) { String key = entry.getKey(); if (!args.contains(key)) { args.add(key); String val = defaultArgs.get(key).getAsString(); if (StringUtils.isNotBlank(val)) { args.add(val); } } } Set<Field> fields = new HashSet<Field>(); fields.addAll(Arrays.asList(ProcessLauncherConfiguration.class.getDeclaredFields())); fields.addAll(Arrays.asList(LauncherConfiguration.class.getDeclaredFields())); for (Field f : fields) { Parameter p = f.getAnnotation(Parameter.class); if (p == null) { continue; } if (!f.getType().equals(Boolean.class)) { for (String arg : args) { if (Arrays.asList(p.names()).contains(arg)) { args.set(args.indexOf(arg) + 1, ""); args.set(args.indexOf(arg), ""); } } args.removeAll(Arrays.asList("")); } else { args.removeAll(Arrays.asList(p.names())); } } LOGGER.exiting(args.toString()); return args.toArray(new String[args.size()]); }

Target:
String[] getProgramArguments() throws IOException { LOGGER.entering(); List<String> args = new LinkedList<>(Arrays.asList(super.getProgramArguments())); for (Entry<String, JsonElement> entry : defaultArgs.entrySet()) { String key = entry.getKey(); if (!args.contains(key)) { args.add(key); String val = defaultArgs.get(key).getAsString(); if (StringUtils.isNotBlank(val)) { args.add(val); } } } removeSeLionArgumentsAndValues(args); LOGGER.exiting(args.toString()); return args.toArray(new String[args.size()]); }
Source:
public EnvInjectJobProperty newInstance(StaplerRequest req, JSONObject formData) throws FormException { Object onObject = formData.get("on"); if (onObject != null) { EnvInjectJobProperty envInjectJobProperty = new EnvInjectJobProperty(); EnvInjectJobPropertyInfo info = req.bindParameters(EnvInjectJobPropertyInfo.class, "envInjectInfoJobProperty."); envInjectJobProperty.setInfo(info); envInjectJobProperty.setOn(true); if (onObject instanceof JSONObject) { JSONObject onJSONObject = (JSONObject) onObject; envInjectJobProperty.setKeepJenkinsSystemVariables(onJSONObject.getBoolean("keepJenkinsSystemVariables")); envInjectJobProperty.setKeepBuildVariables(onJSONObject.getBoolean("keepBuildVariables")); envInjectJobProperty.setKeepBuildVariables(onJSONObject.getBoolean("overrideBuildParameters")); setContributors(req, envInjectJobProperty, onJSONObject); return envInjectJobProperty; } } return null; }

Target:
public EnvInjectJobProperty newInstance(StaplerRequest req, JSONObject formData) throws FormException { Object onObject = formData.get("on"); if (onObject != null) { EnvInjectJobProperty envInjectJobProperty = new EnvInjectJobProperty(); EnvInjectJobPropertyInfo info = req.bindParameters(EnvInjectJobPropertyInfo.class, "envInjectInfoJobProperty."); envInjectJobProperty.setInfo(info); envInjectJobProperty.setOn(true); if (onObject instanceof JSONObject) { JSONObject onJSONObject = (JSONObject) onObject; envInjectJobProperty.setKeepJenkinsSystemVariables(onJSONObject.getBoolean("keepJenkinsSystemVariables")); envInjectJobProperty.setKeepBuildVariables(onJSONObject.getBoolean("keepBuildVariables")); envInjectJobProperty.setOverrideBuildParameters(onJSONObject.getBoolean("overrideBuildParameters")); setContributors(req, envInjectJobProperty, onJSONObject); return envInjectJobProperty; } } return null; }
Source:
public void setUp() { context = InstrumentationRegistry.getTargetContext(); SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); editor = sharedPreferences.edit(); editor.clear(); editor.putBoolean(SettingsActivity.SETTINGS_CLOUD_NOTIFICATIONS, true); editor.commit(); CloudMessaging.setIsCloudNotificationsEnabled(true); }

Target:
public void setUp() { sharedPreferences = mock(SharedPreferences.class); context = mock(Context.class); messagingService = mock(FirebaseCloudMessaging.class); when(PreferenceManager.getDefaultSharedPreferences(context)).thenReturn(sharedPreferences); when(sharedPreferences.getBoolean(SettingsActivity.SETTINGS_CLOUD_NOTIFICATIONS, false)).thenReturn(true); CloudMessaging.setIsCloudNotificationsEnabled(true); CloudMessaging.setCloudMessagingInterface(messagingService); }
Source:
List<ICommitMessageProvider> getCommitMessageProviders() throws CoreException { List<ICommitMessageProvider> providers = new ArrayList<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IConfigurationElement[] configs = registry .getConfigurationElementsFor(COMMIT_MESSAGE_PROVIDER_ID); for (IConfigurationElement config : configs) { Object provider; String contributorName = "<unknown"; try { contributorName = config.getDeclaringExtension() .getContributor().getName(); provider = config.createExecutableExtension("class"); if (provider instanceof ICommitMessageProvider) { providers.add((ICommitMessageProvider) provider); } else { Activator.logError( UIText.CommitDialog_WrongTypeOfCommitMessageProvider, null); } } catch (CoreException | InvalidRegistryObjectException e) { Activator.logError( MessageFormat.format( UIText.CommitDialog_ErrorCreatingCommitMessageProvider, contributorName), e); } } return providers; }

Target:
List<ICommitMessageProvider> getCommitMessageProviders() { List<ICommitMessageProvider> providers = new ArrayList<>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IConfigurationElement[] configs = registry .getConfigurationElementsFor(COMMIT_MESSAGE_PROVIDER_ID); for (IConfigurationElement config : configs) { Object provider; String contributorName = "<unknown"; try { contributorName = config.getDeclaringExtension() .getContributor().getName(); provider = config.createExecutableExtension("class"); if (provider instanceof ICommitMessageProvider) { providers.add((ICommitMessageProvider) provider); } else { Activator.logError( UIText.CommitDialog_WrongTypeOfCommitMessageProvider, null); } } catch (CoreException | InvalidRegistryObjectException e) { Activator.logError( MessageFormat.format( UIText.CommitDialog_ErrorCreatingCommitMessageProvider, contributorName), e); } } return providers; }
Source:
private void delete(PrintStream writer, String where, String[] args) { int result = mContentResolver.delete(APODContract.CONTENT_URI, where, args); writer.println("removed " + String.valueOf(result) + " rows."); }

Target:
private void delete(PrintStream writer, String where, String[] args) { int result = mContentResolver.delete(APODContract.CONTENT_URI, where, args); writer.println("Removed " + result + " rows."); }
Source:
public void verifyNoSlotPresent(String slotName) { if (checkIfElementOnPage("#" + slotName)) { throw new NoSuchElementException("No slot found as expected (" + slotName + ")"); } PageObjectLogging.log("AdInSlot", "Slot is added to the page", true); }

Target:
public void verifyNoSlotPresent(String slotName) { if (checkIfElementOnPage("#" + slotName)) { throw new NoSuchElementException("Slot is added to the page"); } PageObjectLogging.log("AdInSlot", "No slot found as expected", true); }
Source:
public Configuration getConfiguration(GraphContext context) { Configuration configuration = ConfigurationBuilder .begin() .addRule() .when(XmlFile.matchesXpath("/j2e:ejb-jar | /jee:ejb-jar | /ejb-jar").namespace("jee", "<LINK_0>").namespace("j2e", "<LINK_1>").as("ejb") .and(XmlFile.being("ejb").matchesXpath("/ejb-jar .and(XmlFile.being("ejb").matchesXpath("/ejb-jar .and(XmlFile.being("ejb").matchesXpath("/ejb-jar .and(XmlFile.being("ejb").matchesXpath(" .and(XmlFile.being("ejb").havingDTDPublicId("Sun Microsystems, Inc. .and(XmlFile.being("ejb").havingDTDPublicId("Sun Microsystems, Inc. .perform(Classification.of("ejb").as("EJB XML") .and(Classification.of("MDB").as("EJB - MDB")) .and(Hint.in("sessionEJB").withText("EJB - Session")) .and(Hint.in("entityEJB").withText("EJB - Entity")) .and(Hint.in("ejbRelationship").withText("EJB Relationship")) .and(Classification.of("ejb1").as("EJB 1.x")) .and(Classification.of("ejb2").as("EJB 2.x"))); return configuration; }

Target:
public Configuration getConfiguration(GraphContext context) { Configuration configuration = ConfigurationBuilder .begin() .addRule() .when(XmlFile.matchesXpath("/j2e:ejb-jar | /jee:ejb-jar | /ejb-jar").namespace("jee", "<LINK_0>").namespace("j2e", "<LINK_1>").as("ejb") .and(XmlFile.from("ejb").matchesXpath("/ejb-jar .and(XmlFile.from("ejb").matchesXpath("/ejb-jar .and(XmlFile.from("ejb").matchesXpath("/ejb-jar .and(XmlFile.from("ejb").matchesXpath(" .and(XmlFile.from("ejb").withDTDPublicId("Sun Microsystems, Inc. .and(XmlFile.from("ejb").withDTDPublicId("Sun Microsystems, Inc. .perform(Classification.of("ejb").as("EJB XML") .and(Classification.of("MDB").as("EJB - MDB")) .and(Hint.in("sessionEJB").withText("EJB - Session")) .and(Hint.in("entityEJB").withText("EJB - Entity")) .and(Hint.in("ejbRelationship").withText("EJB Relationship")) .and(Classification.of("ejb1").as("EJB 1.x")) .and(Classification.of("ejb2").as("EJB 2.x"))); return configuration; }
Source:
public void shutDown(@Nullable Runnable completeHandler) { stopped = true; p2PService.getPeerManager().removeListener(this); p2PService.removeDecryptedDirectMessageListener(this); stopPeriodicRefreshOffersTimer(); stopPeriodicRepublishOffersTimer(); stopRetryRepublishOffersTimer(); int size = openOffers != null ? openOffers.size() : 0; log.info("Remove open offers at shutDown. Number of open offers: {}", size); if (offerBookService.isBootstrapped() && size > 0) { openOffers.forEach(openOffer -> offerBookService.removeOfferAtShutDown(openOffer.getOffer().getOfferPayload())); LocalTime timeout = LocalTime.now().plus(Duration.ofSeconds(15)); while (!openOffers.getList().isEmpty()) { if (timeout.isBefore(LocalTime.now())) { log.error("Could not remove all offers within timeout (" + openOffers.size() + " offers remaining). Moving on."); break; } try { Thread.sleep(10); } catch (InterruptedException e) { } } if (completeHandler != null) UserThread.runAfter(completeHandler, 10, TimeUnit.MILLISECONDS); } else { if (completeHandler != null) completeHandler.run(); } }

Target:
public void shutDown(@Nullable Runnable completeHandler) { stopped = true; p2PService.getPeerManager().removeListener(this); p2PService.removeDecryptedDirectMessageListener(this); stopPeriodicRefreshOffersTimer(); stopPeriodicRepublishOffersTimer(); stopRetryRepublishOffersTimer(); int size = openOffers != null ? openOffers.size() : 0; log.info("Remove open offers at shutDown. Number of open offers: {}", size); if (offerBookService.isBootstrapped() && size > 0) { openOffers.forEach(openOffer -> offerBookService.removeOfferAtShutDown(openOffer.getOffer().getOfferPayload())); if (completeHandler != null) UserThread.runAfter(completeHandler, size * 200 + 500, TimeUnit.MILLISECONDS); } else { if (completeHandler != null) completeHandler.run(); } }
Source:
public static Text getWakeVarianceHigh(final int wakeStdDev, final int percentile) { return new Text("Hello, irregular", String.format("Your sleep habits are a bit irregular. Your wake time variability of %d minutes is a bit high, ", wakeStdDev) + String.format("it is **higher than** %d%% of all Sense users.", percentile) + "\n\nTry waking up at roughly the same time every morning."); }

Target:
public static Text getWakeVarianceHigh(final int wakeStdDev, final int percentile) { return new Text("Hello, irregular", String.format("The time you wake up each morning is **a little inconsistent**. It varied an average of %d minutes last week, ", wakeStdDev) + String.format("which is higher than %d%% of all Sense users. ", percentile) + "\n\nWaking up at the same time each morning is great for your internal clock, which helps you get better sleep."); }
Source:
private void loginAndVerifyWith(FTPClient ftpClient) throws IOException { ftpClient.connect("localhost", FtpService.DEFAULT_PORT); ftpClient.login("anonymous", "test@example.com"); ftpClient.changeWorkingDirectory("/"); FTPFile[] files = ftpClient.listFiles(); assertNotNull(files); assertTrue("No files found on device? It is also possible that app doesn't have permission to access storage, which may occur on broken Android emulators", files.length > 0); boolean downloadFolderExists = false; for (FTPFile f : files) { if (f.getName().equalsIgnoreCase("download")) downloadFolderExists = true; } ftpClient.logout(); ftpClient.disconnect(); assertTrue("Download folder not found on device. Either storage is not availableExact, or something is really wrong with FtpService. Check logcat.", downloadFolderExists); }

Target:
private void loginAndVerifyWith(FTPClient ftpClient) throws IOException { ftpClient.connect("localhost", FtpService.DEFAULT_PORT); ftpClient.login("anonymous", "test@example.com"); ftpClient.changeWorkingDirectory("/"); FTPFile[] files = ftpClient.listFiles(); assertNotNull(files); assertTrue("No files found on device? It is also possible that app doesn't have permission to access storage, which may occur on broken Android emulators", files.length > 0); boolean downloadFolderExists = false; for (FTPFile f : files) { if (f.getName().equalsIgnoreCase("download")) downloadFolderExists = true; } ftpClient.logout(); ftpClient.disconnect(); assertTrue("Download folder not found on device. Either storage is not available, or something is really wrong with FtpService. Check logcat.", downloadFolderExists); }
Source:
public void testInsertFirstAndAdd2() throws Exception { KieSession ksession = session.getStateful(); insertNotEvent(ksession); ksession.fireAllRules(); Assertions.assertThat(firedRules.isRuleFired(RULE1)).as(RULE1).isFalse(); insertNotEvent(ksession, "different value"); insertNotEvent(ksession, "different value"); insertNotEvent(ksession, "different value"); ksession.fireAllRules(); Assertions.assertThat(firedRules.isRuleFired(RULE1)).as(RULE1).isTrue(); }

Target:
public void testInsertFirstAndAdd2() throws Exception { KieSession ksession = session.getStateful(); insertNotEvent(ksession); ksession.fireAllRules(); Assertions.assertThat(firedRules.isRuleFired(RULE1)).as(RULE1).isFalse(); for (int i = 0; i < 3; i++) { insertNotEvent(ksession, "different value"); } ksession.fireAllRules(); Assertions.assertThat(firedRules.isRuleFired(RULE1)).as(RULE1).isTrue(); }
Source:
public boolean equals(Object obj) { if (obj == null) { return false; } Class<?> objClass = HibernateProxyHelper.getClassWithoutInitializingProxy(obj); if (getClass() != objClass) { return false; } final RelationshipMetadataValue other = (RelationshipMetadataValue) obj; if (this.isUseForPlace() != other.isUseForPlace()) { return false; } return super.equals(obj); }

Target:
public boolean equals(Object obj) { if (obj == null) { return false; } if (! (obj instanceof RelationshipMetadataValue)) { return false; } final RelationshipMetadataValue other = (RelationshipMetadataValue) obj; if (this.isUseForPlace() != other.isUseForPlace()) { return false; } return super.equals(obj); }
Source:
public UserCredential getUserCredential() throws GitException { UserCredential credentials = currRequestCredentials.get(); if (credentials == null) { return null; } LOG.info("Successfully fetched credentials for remote repository"); return credentials; }

Target:
public UserCredential getUserCredential() { return currRequestCredentials.get(); }
Source:
public Transaction begin() throws NotSupportedException, SystemException { Transaction result = ACTIVE_TRANSACTION.get(); if (result != null) { if (logger.isTraceEnabled()) { logger.trace("Found active ModeShape transaction '{0}' ", result); } return result instanceof NestableThreadLocalTransaction ? ((NestableThreadLocalTransaction) result).begin() : result; } javax.transaction.Transaction txn = txnMgr.getTransaction(); if (txn == null) { txnMgr.begin(); result = new NestableThreadLocalTransaction(txnMgr, ACTIVE_TRANSACTION).begin(); } else { result = new ListenerTransaction(txnMgr, txn); localCache.addListener(result); } ACTIVE_TRANSACTION.set(result); if (logger.isTraceEnabled()) { logger.trace("Created & stored new ModeShape synchronized transaction '{0}' ", result); } if (logger.isTraceEnabled()) { if (txn == null) txn = txnMgr.getTransaction(); assert txn != null; final String id = txn.toString(); if (!ACTIVE_TRACE_SYNCHRONIZATIONS.contains(id)) { if (result instanceof ListenerTransaction) { logger.trace("Found user transaction {0}", txn); } else { logger.trace("Begin transaction {0}", id); } try { txn.registerSynchronization(new TransactionTracer(id)); } catch (RollbackException e) { return new RollbackOnlyTransaction(); } } else { logger.trace("Tracer already registered for transaction {0}", id); } } return result; }

Target:
public Transaction begin() throws NotSupportedException, SystemException { Transaction result = ACTIVE_TRANSACTION.get(); if (result != null) { if (logger.isTraceEnabled()) { logger.trace("Found active ModeShape transaction '{0}' ", result); } return result instanceof NestableThreadLocalTransaction ? ((NestableThreadLocalTransaction) result).begin() : result; } javax.transaction.Transaction txn = txnMgr.getTransaction(); if (txn == null) { txnMgr.begin(); result = new NestableThreadLocalTransaction(txnMgr, ACTIVE_TRANSACTION).begin(); } else { result = new ListenerTransaction(txnMgr, txn); localCache.addListener(result); } ACTIVE_TRANSACTION.set(result); if (logger.isTraceEnabled()) { logger.trace("Created & stored new ModeShape synchronized transaction '{0}' ", result); if (txn == null) txn = txnMgr.getTransaction(); assert txn != null; final String id = txn.toString(); if (!ACTIVE_TRACE_SYNCHRONIZATIONS.contains(id)) { if (result instanceof ListenerTransaction) { logger.trace("Found user transaction {0}", txn); } else { logger.trace("Begin transaction {0}", id); } try { txn.registerSynchronization(new TransactionTracer(id)); } catch (RollbackException e) { return new RollbackOnlyTransaction(); } } else { logger.trace("Tracer already registered for transaction {0}", id); } } return result; }
Source:
protected @C.RoleFlags int parseRoleSchemeValue(String value){ @C.RoleFlags int result = 0; switch (value) { case "main": result |= C.ROLE_FLAGS_MAIN; break; case "alternate": result |= C.ROLE_FLAGS_ALTERNATE; break; case "supplementary": result |= C.ROLE_FLAGS_SUPPLEMENTARY; break; case "commentary": result |= C.ROLE_FLAGS_COMMENTARY; break; case "dub": result |= C.ROLE_FLAGS_DUB; break; case "emergency": result |= C.ROLE_FLAGS_EMERGENCY; break; case "caption": result |= C.ROLE_FLAGS_CAPTION; break; case "sign": result |= C.ROLE_FLAGS_SIGN; break; case "description": result |= C.ROLE_FLAGS_DESCRIPTION; break; case "enhanced-audio-intelligibility": result |= C.ROLE_FLAGS_ENHANCED_AUDIO_INTELLIGIBILITY; break; } return result; }

Target:
protected @C.RoleFlags int parseRoleSchemeValue(String value) { if (value == null) { return 0; } switch (value) { case "main": return C.ROLE_FLAGS_MAIN; case "alternate": return C.ROLE_FLAGS_ALTERNATE; case "supplementary": return C.ROLE_FLAGS_SUPPLEMENTARY; case "commentary": return C.ROLE_FLAGS_COMMENTARY; case "dub": return C.ROLE_FLAGS_DUB; case "emergency": return C.ROLE_FLAGS_EMERGENCY; case "caption": return C.ROLE_FLAGS_CAPTION; case "sign": return C.ROLE_FLAGS_SIGN; case "description": return C.ROLE_FLAGS_DESCRIPTION; case "enhanced-audio-intelligibility": return C.ROLE_FLAGS_ENHANCED_AUDIO_INTELLIGIBILITY; default: return 0; } }
Source:
public void testUnsetUserResolver() { MockEnabledModelResolver resolver1 = new MockEnabledModelResolver(); manager.add(resolver1, resolver1.getClass().getName() + "1", "", ""); MockEnabledModelResolver resolver2 = new MockEnabledModelResolver(); manager.add(resolver2, resolver2.getClass().getName() + "2", "", ""); MockEnabledModelResolver resolver3 = new MockEnabledModelResolver(); String resolver3Id = resolver3.getClass().getName() + "3"; manager.add(resolver3, resolver3Id, "", ""); manager.setUserSelectedResolver(manager.getDescriptor(resolver3Id)); manager.setUserSelectedResolver(null); assertEquals(manager.getUserSelectedResolver(), null); }

Target:
public void testUnsetUserResolver() { MockEnabledModelResolver resolver1 = new MockEnabledModelResolver(); manager.add(resolver1, resolver1.getClass().getName() + "1", "", ""); MockEnabledModelResolver resolver2 = new MockEnabledModelResolver(); manager.add(resolver2, resolver2.getClass().getName() + "2", "", ""); MockEnabledModelResolver resolver3 = new MockEnabledModelResolver(); String resolver3Id = resolver3.getClass().getName() + "3"; manager.add(resolver3, resolver3Id, "", ""); manager.setUserSelectedResolver(manager.getDescriptor(resolver3Id)); manager.setUserSelectedResolver(null); assertNull(manager.getUserSelectedResolver()); }
Source:
public Collection<CaseInstance> getCaseInstances(QueryContext queryContext) { Map<String, Object> params = new HashMap<String, Object>(); params.put("statuses", statuses); applyQueryContext(params, queryContext); applyDeploymentFilter(params); List<CaseInstance> processInstances = commandService.execute(new QueryNameCommand<List<CaseInstance>>("getCaseInstances", params)); return processInstances; }

Target:
public Collection<CaseInstance> getCaseInstances(QueryContext queryContext) { return getCaseInstances(statuses, queryContext); }
Source:
public void testHeaderAmountDoesNotMatch() { ConcurRequestExtractFile testFile = buildConcurRequestExtractFile(); testFile.setTotalApprovedAmount(new KualiDecimal(9.87)); if (concurRequestExtractFileValidationService.fileApprovedAmountsMatchHeaderApprovedAmount(testFile)) { assertTrue("Invalid: Header amount matched row sum. They should NOT have matched.", false); } else { assertTrue("Valid: Header amount did NOT match sum of row amounts from file.", true); } }

Target:
public void testHeaderAmountDoesNotMatch() { List<ConcurRequestExtractFile> testFiles = ConcurRequestExtractFileFixture.BAD_REQUEST_AMOUNT_FILE.createConcurRequestExtractFiles(); assertFalse("Expected Result: Header amount should NOT match sum of row amounts from file.", concurRequestExtractFileValidationService.requestExtractHeaderRowValidatesToFileContents(testFiles)); }
Source:
private FaqPair createPair() { FaqPair faqPair = new FaqPair(); faqPair.setQuestion("question"); faqPair.setAnswer("answer"); return faqRepository.save(faqPair); }

Target:
private FaqPair createPair() { FaqPair faqPair = new FaqPair(); faqPair.setQuestion("What do you get if you multiply six by nine?"); faqPair.setAnswer("42"); return faqRepository.save(faqPair); }
Source:
public static Source fromString(String value) { if (value.equals(STATS.value)) { return STATS; } else if (value.equals(NOTIFICATIONS.value)) { return NOTIFICATIONS; } else { return null; } }

Target:
public static Source fromString(String value) { if (STATS.value.equals(value)) { return STATS; } else if (NOTIFICATIONS.value.equals(value)) { return NOTIFICATIONS; } else { return null; } }