auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void beforeTest() throws IOException { String contextSwitchesUstPath = FileLocator.toFileURL(CtfTestTrace.CONTEXT_SWITCHES_UST.getTraceURL()).getPath(); CONTEXT_SWITCHES_UST_STUB = new TraceModelStub("ust", contextSwitchesUstPath, CONTEXT_SWITCHES_UST_UUID); String contextSwitchesKernelPath = FileLocator.toFileURL(CtfTestTrace.CONTEXT_SWITCHES_KERNEL.getTraceURL()).getPath(); CONTEXT_SWITCHES_KERNEL_STUB = new TraceModelStub("kernel", contextSwitchesKernelPath, CONTEXT_SWITCHES_KERNEL_UUID); ImmutableList.Builder<String> b = ImmutableList.builder(); b.add("DataProviderDescriptorStub[fId=org.eclipse.tracecompass.internal.analysis.timing.core.segmentstore.scatter.dataprovider:org.eclipse.linuxtools.lttng2.ust.analysis.callstack, fName=LTTng-UST CallStack - Latency vs Time, fDescription=Show latencies provided by Analysis module: LTTng-UST CallStack, fTypeId=TREE_TIME_XY]"); b.add("DataProviderDescriptorStub[fId=org.eclipse.tracecompass.internal.analysis.profiling.callstack.provider.CallStackDataProvider, fName=Flame Chart, fDescription=Show a call stack over time, fTypeId=TIME_GRAPH]"); b.add("DataProviderDescriptorStub[fId=org.eclipse.tracecompass.internal.tmf.core.histogram.HistogramDataProvider, fName=Histogram, fDescription=Show a histogram of number of events to time for a trace, fTypeId=TREE_TIME_XY]"); DATA_PROVIDER_DESCRIPTOR_TOSTINGS = b.build(); }

Target:
public static void beforeTest() throws IOException { String contextSwitchesUstPath = FileLocator.toFileURL(CtfTestTrace.CONTEXT_SWITCHES_UST.getTraceURL()).getPath(); CONTEXT_SWITCHES_UST_STUB = new TraceModelStub("ust", contextSwitchesUstPath, CONTEXT_SWITCHES_UST_UUID); String contextSwitchesKernelPath = FileLocator.toFileURL(CtfTestTrace.CONTEXT_SWITCHES_KERNEL.getTraceURL()).getPath(); CONTEXT_SWITCHES_KERNEL_STUB = new TraceModelStub("kernel", contextSwitchesKernelPath, CONTEXT_SWITCHES_KERNEL_UUID); ImmutableList.Builder<DataProviderDescriptorStub> b = ImmutableList.builder(); b.add(new DataProviderDescriptorStub("org.eclipse.tracecompass.internal.analysis.timing.core.segmentstore.scatter.dataprovider:org.eclipse.linuxtools.lttng2.ust.analysis.callstack", "LTTng-UST CallStack - Latency vs Time", "Show latencies provided by Analysis module: LTTng-UST CallStack", ProviderType.TREE_TIME_XY.name())); b.add(new DataProviderDescriptorStub("org.eclipse.tracecompass.internal.analysis.profiling.callstack.provider.CallStackDataProvider", "Flame Chart", "Show a call stack over time", ProviderType.TIME_GRAPH.name())); b.add(new DataProviderDescriptorStub("org.eclipse.tracecompass.internal.tmf.core.histogram.HistogramDataProvider", "Histogram", "Show a histogram of number of events to time for a trace", ProviderType.TREE_TIME_XY.name())); EXPECTED_DATA_PROVIDER_DESCRIPTOR = b.build(); }
Source:
private static List<ExtMap> queryDirectoryGroups( final ExtensionProxy extension, final String namespace, final ExtMap filter, boolean groupsResolving, boolean groupsResolvingRecursive ) { List<ExtMap> directoryGroups = new ArrayList<>(); for (ExtMap group : queryGroupRecords(extension, namespace, filter, groupsResolving, groupsResolvingRecursive)) { directoryGroups.add(group); } return directoryGroups; }

Target:
private static List<ExtMap> queryDirectoryGroups( final ExtensionProxy extension, final String namespace, final ExtMap filter, boolean groupsResolving, boolean groupsResolvingRecursive ) { return queryGroupRecords(extension, namespace, filter, groupsResolving, groupsResolvingRecursive) .stream() .collect(Collectors.toList()); }
Source:
public void testDescribeNoTimestamp(){ client.add("name", "Gerald"); client.add("address", "123 Main St"); client.add("title", "Person"); String[] expecteds = {"address" , "name", "title"}; Set<String> actuals = client.describe(); Assert.assertArrayEquals(expecteds, actuals.toArray(new String[actuals.size()])); }

Target:
public void testDescribeNoTimestamp(){ client.add("name", "Gerald"); client.add("address", "123 Main St"); client.add("title", "Person"); Set<String> expecteds = Sets.newHashSet(); expecteds.add("name"); expecteds.add("address"); expecteds.add("title"); Set<String> actuals = client.describe(); Assert.assertEquals(expecteds, actuals); }
Source:
public void onRequestPermissionsResult( int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { if (requestCode == PERMISSIONS_LOCATION) { if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) { enableLocation(); } } }

Target:
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) { permissionsManager.onRequestPermissionsResult(requestCode, permissions, grantResults); }
Source:
public void testClearPractitionerLinks() { assertLinkCount(2); myEmpiProviderR4.clearEmpiLinks(new StringType("practitioner")); assertNoPractitionerLinksExist(); try { myPersonDao.read(new IdDt(myPractitionerPersonId.getValueAsString()).toVersionless()); fail(); } catch (ResourceNotFoundException e) }

Target:
public void testClearPractitionerLinks() { assertLinkCount(2); Person read = myPersonDao.read(new IdDt(myPractitionerPersonId.getValueAsString()).toVersionless()); assertThat(read, is(notNullValue())); myEmpiProviderR4.clearEmpiLinks(new StringType("Practitioner")); assertNoPractitionerLinksExist(); try { myPersonDao.read(new IdDt(myPractitionerPersonId.getValueAsString()).toVersionless()); fail(); } catch (ResourceNotFoundException e) }
Source:
public Serializable execute(TaskResult... results) throws IOException { File file = new File(s3LocalRelativePath); SchedulerExamplesUtils.createDirIfNotExists(file); AmazonS3 amazonS3 = S3ConnectorUtils.getS3Client(accessKey, secretKey, scheme, host); if (s3RemoteRelativePath.endsWith(File.separator)) { downloadDir(bucketName, s3RemoteRelativePath, s3LocalRelativePath, false, amazonS3); return (Serializable) SchedulerExamplesUtils.listDirectoryContents(file, new ArrayList<>()); } else { s3LocalRelativePath = Paths.get(s3LocalRelativePath, Paths.get(s3Url).getFileName().toString()).toString(); downloadFile(bucketName, s3RemoteRelativePath, s3LocalRelativePath, false, amazonS3); return (Serializable) Arrays.asList(s3LocalRelativePath); } }

Target:
public Serializable execute(TaskResult... results) throws IOException { File file = new File(s3LocalRelativePath); SchedulerExamplesUtils.createDirIfNotExists(file); AmazonS3 amazonS3 = S3ConnectorUtils.getS3Client(accessKey, secretKey, scheme, host); if (SchedulerExamplesUtils.isDirectoryPath(s3RemoteRelativePath)) { downloadDir(bucketName, s3RemoteRelativePath, s3LocalRelativePath, false, amazonS3); return (Serializable) SchedulerExamplesUtils.listDirectoryContents(file, new ArrayList<>()); } else { s3LocalRelativePath = Paths.get(s3LocalRelativePath, Paths.get(s3Url).getFileName().toString()).toString(); downloadFile(bucketName, s3RemoteRelativePath, s3LocalRelativePath, false, amazonS3); return (Serializable) Arrays.asList(s3LocalRelativePath); } }
Source:
public void keyValue_nullOrEmptyThrows() { String[] illegalKeyValues = { null, ""}; for (String key : illegalKeyValues) { try { UserCondition.keyValue(key, "value"); fail(); } catch (IllegalArgumentException ignore) { } } try { UserCondition.keyValue("key", null); fail(); } catch (IllegalArgumentException ignore) { } }

Target:
public void keyValue_nullOrEmptyThrows() { String[] illegalKeys = { null, ""}; for (String key : illegalKeys) { try { UserCondition.keyValue(key, "value"); fail(); } catch (IllegalArgumentException ignore) { } } try { UserCondition.keyValue("key", null); fail(); } catch (IllegalArgumentException ignore) { } }
Source:
public List<ConfigMap> createConfigMaps(List<ConfigMap> configMaps, RuntimeIdentity identity) throws InfrastructureException { if (configMaps.isEmpty()) { return configMaps; } validate(identity, WorkspaceStatus.STARTING); List<ConfigMap> createdConfigMaps = new ArrayList<>(); for (ConfigMap cm : configMaps) { putLabel(cm, CHE_WORKSPACE_ID_LABEL, identity.getWorkspaceId()); createdConfigMaps.add( clientFactory.create().configMaps().inNamespace(cheNamespaceName).create(cm)); } return createdConfigMaps; }

Target:
public List<ConfigMap> createConfigMaps(List<ConfigMap> configMaps, RuntimeIdentity identity) throws InfrastructureException { if (configMaps.isEmpty()) { return Collections.emptyList(); } validate(identity, WorkspaceStatus.STARTING); List<ConfigMap> createdConfigMaps = new ArrayList<>(); for (ConfigMap cm : configMaps) { createdConfigMaps.add(createConfigMap(cm, identity)); } return createdConfigMaps; }
Source:
public WebElement execute(SelenideElement proxy, WebElementSource locator, Object[] args) { boolean selected = (Boolean) args[0]; WebElement element = locator.getWebElement(); if (!element.isDisplayed()) { throw new InvalidStateException("Cannot change invisible element"); } String tag = element.getTagName(); if (!tag.equals("options")) { if (tag.equals("input")) { String type = element.getAttribute("type"); if (!type.equals("checkbox") && !type.equals("radio")) { throw new InvalidStateException("Only use setSelected on checkbox/option/radio"); } } else { throw new InvalidStateException("Only use setSelected on checkbox/option/radio"); } } if (element.getAttribute("readonly") != null || element.getAttribute("disabled") != null) throw new InvalidStateException("Cannot change value of readonly/disabled element"); if (element.isSelected() != selected) { click.execute(proxy, locator, NO_ARGS); } return proxy; }

Target:
public WebElement execute(SelenideElement proxy, WebElementSource locator, Object[] args) { boolean selected = (Boolean) args[0]; WebElement element = locator.getWebElement(); if (!element.isDisplayed()) { throw new InvalidStateException("Cannot change invisible element"); } String tag = element.getTagName(); if (!tag.equals("option")) { if (tag.equals("input")) { String type = element.getAttribute("type"); if (!type.equals("checkbox") && !type.equals("radio")) { throw new InvalidStateException("Only use setSelected on checkbox/option/radio"); } } else { throw new InvalidStateException("Only use setSelected on checkbox/option/radio"); } } if (element.getAttribute("readonly") != null || element.getAttribute("disabled") != null) throw new InvalidStateException("Cannot change value of readonly/disabled element"); if (element.isSelected() != selected) { click.execute(proxy, locator, NO_ARGS); } return proxy; }
Source:
public Path pack(final Path folder, String namespace, String name, String tkName) throws IOException, URISyntaxException { Path zipFilePath = Paths.get(folder.toAbsolutePath().toString() + ".zip"); String workingDir = zipFilePath.getParent().toString(); File jarLocation = new File(ZippedToolkitStreamsContext.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()); File libDir = new File(jarLocation.getParent()); File topologyToolkit = new File(libDir.getParent()); PrintWriter tkManifest = new PrintWriter("manifest_tk.txt", "UTF-8"); PrintWriter mainComposite = new PrintWriter("main_composite.txt", "UTF-8"); tkManifest.println(tkName); tkManifest.println("com.ibm.streamsx.topology"); mainComposite.print(namespace + "::" + name); tkManifest.close(); mainComposite.close(); List<Path> paths = new ArrayList<Path>(); paths.add(Paths.get(topologyToolkit.getAbsolutePath())); paths.add(Paths.get(workingDir + "/manifest_tk.txt")); paths.add(Paths.get(workingDir + "/main_composite.txt")); paths.add(Paths.get(topologyToolkit.getAbsolutePath() + "/opt/python/templates/common/Makefile")); paths.add(folder); addAllToZippedArchive(paths, zipFilePath); JSONObject jso = new OrderedJSONObject(); super.deleteToolkit(new File(paths.get(1).toString()), jso); super.deleteToolkit(new File(paths.get(2).toString()), jso); return zipFilePath; }

Target:
public Path pack(final Path folder, String namespace, String name, String tkName) throws IOException, URISyntaxException { Path zipFilePath = Paths.get(folder.toAbsolutePath().toString() + ".zip"); String workingDir = zipFilePath.getParent().toString(); File jarLocation = new File(ZippedToolkitStreamsContext.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath()); File libDir = new File(jarLocation.getParent()); File topologyToolkit = new File(libDir.getParent()); PrintWriter tkManifest = new PrintWriter("manifest_tk.txt", "UTF-8"); PrintWriter mainComposite = new PrintWriter("main_composite.txt", "UTF-8"); tkManifest.println(tkName); tkManifest.println("com.ibm.streamsx.topology"); mainComposite.print(namespace + "::" + name); tkManifest.close(); mainComposite.close(); List<Path> paths = new ArrayList<Path>(); paths.add(Paths.get(topologyToolkit.getAbsolutePath())); paths.add(Paths.get(workingDir + "/manifest_tk.txt")); paths.add(Paths.get(workingDir + "/main_composite.txt")); paths.add(Paths.get(topologyToolkit.getAbsolutePath() + "/opt/python/templates/common/Makefile")); paths.add(folder); addAllToZippedArchive(paths, zipFilePath); paths.get(1).toFile().delete(); paths.get(2).toFile().delete(); return zipFilePath; }
Source:
public StageType getType() { return StageType.MOVE; }

Target:
public StageType getType() { return StageType.REPL_TXN; }
Source:
protected void initExternal() { String className = String.format("org.nuxeo.ecm.storage.%s.DBSHelperImpl", coreType); try { dbsHelper = (DBSHelper) Class.forName(className).newInstance(); dbsHelper.init(); } catch (ReflectiveOperationException e) { throw new ExceptionInInitializerError("DBSHelperImpl not found: " + className); } }

Target:
protected void initExternal() { String className = String.format("org.nuxeo.ecm.core.storage.%s.DBSHelperImpl", coreType); try { dbsHelper = (DBSHelper) Class.forName(className).newInstance(); dbsHelper.init(); } catch (ReflectiveOperationException e) { throw new NuxeoException("DBSHelperImpl not found: " + className, e); } }
Source:
void set(ChangeInfo info, String revision, Labels labels, Element reviewers) { this.changeId = info.legacy_id(); this.info = info; this.revision = revision; this.labels = labels; this.reviewers = reviewers; reviewerSuggestOracle.setChange(changeId); renderReviewers(info); }

Target:
void set(ChangeInfo info, String revision, Labels labels, Element reviewers) { this.info = info; this.revision = revision; this.labels = labels; this.reviewers = reviewers; reviewerSuggestOracle.setChange(info.legacy_id()); renderReviewers(info); }
Source:
public void testClone() { ServerTemplate src = new ServerTemplate(); src.setId("test1"); src.setName("test1"); src.setMode(KieServerMode.DEVELOPMENT); List<String> capabilities = new ArrayList<String>(); capabilities.add(Capability.RULE.toString()); src.setCapabilities(capabilities); Map<Capability, ContainerConfig> containerSpecRule = new HashMap<>(); containerSpecRule.put(Capability.RULE, new RuleConfig(1L, KieScannerStatus.STARTED)); src.addContainerSpec(new ContainerSpec("test", "test1", new ServerTemplateKey("test", "test"), new ReleaseId("test", "test", "1"), KieContainerStatus.STARTED, containerSpecRule)); Map<Capability, ContainerConfig> containerSpecProcess = new HashMap<>(); containerSpecProcess.put(Capability.PROCESS, new ProcessConfig("test1", "test1", "test1", "test1")); src.addContainerSpec(new ContainerSpec("test1", "test1", new ServerTemplateKey("test1", "test1"), new ReleaseId("test1", "test1", "2"), KieContainerStatus.STARTED, containerSpecProcess)); Map<Capability, ServerConfig> cloneServerConfig = new HashMap<Capability, ServerConfig>(); cloneServerConfig.put(Capability.RULE,new ServerConfig()); src.setConfigs(cloneServerConfig); src.addServerInstance(new ServerInstanceKey("test1", "test1", "test1", "test1")); ServerTemplate dest = src.cloneServerTemplate(); assertEquals(src, dest); assertEquals(false, src == dest); }

Target:
public void testClone() { ServerTemplate src = new ServerTemplate(); src.setId("test1"); src.setName("test1"); src.setMode(KieServerMode.DEVELOPMENT); List<String> capabilities = new ArrayList<String>(); capabilities.add(Capability.RULE.toString()); src.setCapabilities(capabilities); Map<Capability, ContainerConfig> containerSpecRule = new HashMap<>(); containerSpecRule.put(Capability.RULE, new RuleConfig(1L, KieScannerStatus.STARTED)); src.addContainerSpec(new ContainerSpec("test", "test1", new ServerTemplateKey("test", "test"), new ReleaseId("test", "test", "1"), KieContainerStatus.STARTED, containerSpecRule)); Map<Capability, ContainerConfig> containerSpecProcess = new HashMap<>(); containerSpecProcess.put(Capability.PROCESS, new ProcessConfig("test1", "test1", "test1", "test1")); src.addContainerSpec(new ContainerSpec("test1", "test1", new ServerTemplateKey("test1", "test1"), new ReleaseId("test1", "test1", "2"), KieContainerStatus.STARTED, containerSpecProcess)); Map<Capability, ServerConfig> cloneServerConfig = new HashMap<Capability, ServerConfig>(); cloneServerConfig.put(Capability.RULE,new ServerConfig()); src.setConfigs(cloneServerConfig); src.addServerInstance(new ServerInstanceKey("test1", "test1", "test1", "test1")); ServerTemplate dest = src.cloneServerTemplate(); assertEquals(src, dest); assertFalse(src == dest); }
Source:
public Expr apply(final List<Expr> args) { if (args.size() < 2 || 3 < args.size()) { throw new IAE(createErrMsg("must have 2-3 arguments")); } boolean inclusive = getInclusive(args); SubnetUtils.SubnetInfo subnetInfo = getSubnetInfo(args, inclusive); Expr arg = args.get(0); class IPv4AddressMatchExpr extends ExprMacroTable.BaseScalarUnivariateMacroFunctionExpr { private final SubnetUtils.SubnetInfo subnetInfo; private IPv4AddressMatchExpr(Expr arg, SubnetUtils.SubnetInfo subnetInfo) { super(arg); this.subnetInfo = subnetInfo; } @Nonnull @Override public ExprEval eval(final ObjectBinding bindings) { ExprEval eval = arg.eval(bindings); boolean match; switch (eval.type()) { case STRING: match = isStringMatch(eval.asString()); break; case LONG: match = !eval.isNumericNull() && isLongMatch(eval.asLong()); break; default: match = false; } return ExprEval.of(match, ExprType.LONG); } private boolean isStringMatch(String stringValue) { boolean match; String ipv4 = IPv4AddressExprUtils.extractIPv4Address(stringValue); if (ipv4 == null) { match = isLongMatch(stringValue); } else { match = subnetInfo.isInRange(ipv4); } return match; } private boolean isLongMatch(String stringValue) { boolean match; try { long longValue = Long.parseLong(stringValue); match = isLongMatch(longValue); } catch (NumberFormatException ignored) { match = false; } return match; } private boolean isLongMatch(long longValue) { return !IPv4AddressExprUtils.overflowsUnsignedInt(longValue) && subnetInfo.isInRange((int) longValue); } @Override public Expr visit(Shuttle shuttle) { Expr newArg = arg.visit(shuttle); return shuttle.visit(new IPv4AddressMatchExpr(newArg, subnetInfo)); } } return new IPv4AddressMatchExpr(arg, subnetInfo); }

Target:
public Expr apply(final List<Expr> args) { if (args.size() != 2) { throw new IAE(ExprUtils.createErrMsg(name(), "must have 2 arguments")); } SubnetUtils.SubnetInfo subnetInfo = getSubnetInfo(args); Expr arg = args.get(0); class IPv4AddressMatchExpr extends ExprMacroTable.BaseScalarUnivariateMacroFunctionExpr { private final SubnetUtils.SubnetInfo subnetInfo; private IPv4AddressMatchExpr(Expr arg, SubnetUtils.SubnetInfo subnetInfo) { super(arg); this.subnetInfo = subnetInfo; } @Nonnull @Override public ExprEval eval(final ObjectBinding bindings) { ExprEval eval = arg.eval(bindings); boolean match; switch (eval.type()) { case STRING: match = isStringMatch(eval.asString()); break; case LONG: match = !eval.isNumericNull() && isLongMatch(eval.asLong()); break; default: match = false; } return ExprEval.of(match, ExprType.LONG); } private boolean isStringMatch(String stringValue) { return IPv4AddressExprUtils.isValidAddress(stringValue) && subnetInfo.isInRange(stringValue); } private boolean isLongMatch(long longValue) { return !IPv4AddressExprUtils.overflowsUnsignedInt(longValue) && subnetInfo.isInRange((int) longValue); } @Override public Expr visit(Shuttle shuttle) { Expr newArg = arg.visit(shuttle); return shuttle.visit(new IPv4AddressMatchExpr(newArg, subnetInfo)); } } return new IPv4AddressMatchExpr(arg, subnetInfo); }
Source:
public void saveInstanceState(Bundle out) { out.putInt(CURRENTLY_EXECUTING_ID, mCurrentMeasure != null ? mCurrentMeasure.getID() : -1); out.putInt(RECOVERY_STATE, mRecoveryState); }

Target:
public void saveInstanceState(Bundle out) { out.putInt(CURRENT_MEASUERE_ID_KEY, mCurrentMeasure != null ? mCurrentMeasure.getID() : -1); out.putInt(LAST_STATUS_KEY, mLastExecutionStatus); out.putString(LAST_DISPLAY_STATUS_KEY, mLastDisplayStatus); out.putString(ARCHIVE_PATH_KEY, mAppArchivePath); out.putBoolean(CCZ_SELECTION_ENABLED_KEY, cczSelectionEnabled); }
Source:
public boolean acquire(K key, final Runnable cacheHit) { if (cache.putIfAbsent(key, true) == null) { cacheHit.run(); return false; } return true; }

Target:
public boolean acquire(K key, final Runnable cacheHit) { if (cache.putIfAbsent(key, true) != null) { cacheHit.run(); return false; } return true; }
Source:
private void saveMetadataFile(FileformatInterface gdzfile, Process process) { try { if (this.autoSave) { serviceManager.getFileService().writeMetadataFile(gdzfile, process); } } catch (Exception e) { logger.error(e.getMessage(), e); Helper.setFehlerMeldung("Error while writing metadata: " + process.getTitle(), e); } }

Target:
private void saveMetadataFile(FileformatInterface gdzfile, Process process) { try { if (this.autoSave) { serviceManager.getFileService().writeMetadataFile(gdzfile, process); } } catch (PreferencesException | WriteException | IOException | RuntimeException e) { Helper.setErrorMessage("Error while writing metadata: ", process.getTitle(), logger, e); } }
Source:
public View getView(Context context, int brickId, BaseAdapter baseAdapter) { if (animationState) { return view; } if (view == null) { alphaValue = 255; } view = View.inflate(context, R.layout.brick_ev3_motor_move, null); view = BrickViewProvider.setAlphaOnView(view, alphaValue); setCheckboxView(R.id.brick_ev3_motor_move_checkbox); editSpeed = (TextView) view.findViewById(R.id.ev3_motor_move_speed_edit_text); getFormulaWithBrickField(BrickField.LEGO_EV3_SPEED).setTextFieldId(R.id.ev3_motor_move_speed_edit_text); getFormulaWithBrickField(BrickField.LEGO_EV3_SPEED).refreshTextField(view); editSpeed.setOnClickListener(this); ArrayAdapter<CharSequence> motorAdapter = ArrayAdapter.createFromResource(context, R.array.ev3_motor_chooser, android.R.layout.simple_spinner_item); motorAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); Spinner motorSpinner = (Spinner) view.findViewById(R.id.brick_ev3_motor_move_spinner); motorSpinner.setAdapter(motorAdapter); motorSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> arg0, View arg1, int position, long arg3) { motorEnum = Motor.values()[position]; motor = motorEnum.name(); } @Override public void onNothingSelected(AdapterView<?> arg0) { } }); if (motorEnum == null) { readResolve(); } motorSpinner.setSelection(motorEnum.ordinal()); motorSpinner.setGravity(Gravity.CENTER); return view; }

Target:
public View getView(Context context, int brickId, BaseAdapter baseAdapter) { if (animationState) { return view; } if (view == null) { alphaValue = 255; } view = View.inflate(context, R.layout.brick_ev3_motor_move, null); view = BrickViewProvider.setAlphaOnView(view, alphaValue); setCheckboxView(R.id.brick_ev3_motor_move_checkbox); editSpeed = (TextView) view.findViewById(R.id.ev3_motor_move_speed_edit_text); getFormulaWithBrickField(BrickField.LEGO_EV3_SPEED).setTextFieldId(R.id.ev3_motor_move_speed_edit_text); getFormulaWithBrickField(BrickField.LEGO_EV3_SPEED).refreshTextField(view); editSpeed.setOnClickListener(this); ArrayAdapter<CharSequence> motorAdapter = ArrayAdapter.createFromResource(context, R.array.ev3_motor_chooser, android.R.layout.simple_spinner_item); motorAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); Spinner motorSpinner = (Spinner) view.findViewById(R.id.brick_ev3_motor_move_spinner); motorSpinner.setAdapter(motorAdapter); motorSpinner.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { @Override public void onItemSelected(AdapterView<?> arg0, View arg1, int position, long arg3) { motorEnum = Motor.values()[position]; motor = motorEnum.name(); } @Override public void onNothingSelected(AdapterView<?> arg0) { } }); if (motorEnum == null) { readResolve(); } motorSpinner.setSelection(motorEnum.ordinal()); return view; }
Source:
private Predicate<ChangeData> rewriteImpl(Predicate<ChangeData> in, ChangeIndex index, int limit) throws QueryParseException { if (isIndexPredicate(in, index)) { return in; } else if (in instanceof LimitPredicate) { return new LimitPredicate(limit); } else if (!isRewritePossible(in)) { return null; } int n = in.getChildCount(); BitSet isIndexed = new BitSet(n); BitSet notIndexed = new BitSet(n); BitSet rewritten = new BitSet(n); List<Predicate<ChangeData>> newChildren = Lists.newArrayListWithCapacity(n); boolean hasLimit = false; for (int i = 0; i < n; i++) { Predicate<ChangeData> c = in.getChild(i); Predicate<ChangeData> nc = rewriteImpl(c, index, limit); if (nc == c) { isIndexed.set(i); newChildren.add(c); continue; } else if (nc == null ) { notIndexed.set(i); newChildren.add(c); continue; } else if (nc instanceof LimitPredicate) { if (hasLimit) { n--; continue; } else { hasLimit = true; } } rewritten.set(i); newChildren.add(nc); } if (isIndexed.cardinality() == n) { return in; } else if (notIndexed.cardinality() == n) { return null; } else if (rewritten.cardinality() == n) { return in.copy(newChildren); } return partitionChildren(in, newChildren, isIndexed, index, limit); }

Target:
private Predicate<ChangeData> rewriteImpl(Predicate<ChangeData> in, ChangeIndex index, int limit) throws QueryParseException { if (isIndexPredicate(in, index)) { return in; } else if (in instanceof LimitPredicate) { return new LimitPredicate(limit); } else if (!isRewritePossible(in)) { return null; } int n = in.getChildCount(); BitSet isIndexed = new BitSet(n); BitSet notIndexed = new BitSet(n); BitSet rewritten = new BitSet(n); List<Predicate<ChangeData>> newChildren = Lists.newArrayListWithCapacity(n); for (int i = 0; i < n; i++) { Predicate<ChangeData> c = in.getChild(i); Predicate<ChangeData> nc = rewriteImpl(c, index, limit); if (nc == c) { isIndexed.set(i); newChildren.add(c); } else if (nc == null ) { notIndexed.set(i); newChildren.add(c); } else { rewritten.set(i); newChildren.add(nc); } } if (isIndexed.cardinality() == n) { return in; } else if (notIndexed.cardinality() == n) { return null; } else if (rewritten.cardinality() == n) { return in.copy(newChildren); } return partitionChildren(in, newChildren, isIndexed, index, limit); }
Source:
public void updateAnnotation(CoreSession session, String annotationId, Annotation annotation) throws CommentNotFoundException, CommentSecurityException { IdRef annotationRef = new IdRef(annotationId); if (!session.exists(annotationRef)) { throw new CommentNotFoundException("The annotation " + annotationId + " does not exist."); } NuxeoPrincipal principal = session.getPrincipal(); if (!principal.isAdministrator() && !annotation.getAuthor().equals(principal.getName())) { throw new CommentSecurityException("The user " + principal.getName() + " can not edit annotations of document " + annotation.getParentId()); } CoreInstance.doPrivileged(session, s -> { Framework.getService(CommentManager.class).updateComment(s, annotationId, annotation); }); }

Target:
public void updateAnnotation(CoreSession session, String annotationId, Annotation annotation) throws CommentNotFoundException, CommentSecurityException { IdRef annotationRef = new IdRef(annotationId); if (!session.exists(annotationRef)) { throw new CommentNotFoundException("The annotation " + annotationId + " does not exist."); } NuxeoPrincipal principal = session.getPrincipal(); if (!principal.isAdministrator() && !annotation.getAuthor().equals(principal.getName())) { throw new CommentSecurityException("The user " + principal.getName() + " can not edit annotations of document " + annotation.getParentId()); } Framework.getService(CommentManager.class).updateComment(session, annotationId, annotation); }
Source:
public boolean isSearchUsingTags() { return origText.contains("tag") || getSearchObjectStr() != null && getSearchObjectStr().equals(SearchObjects.VDC_USER_OBJ_NAME) && origText.contains("vm") || getCrossRefObjList().contains(SearchObjects.VDC_STORAGE_POOL_OBJ_NAME) || getCrossRefObjList().contains(SearchObjects.VDC_STORAGE_DOMAIN_OBJ_NAME); }

Target:
public boolean isSearchUsingTags() { return origText.contains("tag") || isUserSearchUsingTags() || getCrossRefObjList().contains(SearchObjects.VDC_STORAGE_POOL_OBJ_NAME) || getCrossRefObjList().contains(SearchObjects.VDC_STORAGE_DOMAIN_OBJ_NAME); }
Source:
public MQTTDataGenerator getDataGenerator(final String brokerURI, final String topic) { MQTTSubscribeClient subscribeClient = mqttSubscribeClientMap.get(brokerURI); if (subscribeClient == null) { subscribeClient = new MQTTSubscribeClient(brokerURI, "MISTClient", mqttSubscribeClientMap); mqttSubscribeClientMap.put(brokerURI, subscribeClient); } return subscribeClient.connectToTopic(topic); }

Target:
public MQTTDataGenerator getDataGenerator(final String brokerURI, final String topic) { MQTTSubscribeClient subscribeClient = mqttSubscribeClientMap.get(brokerURI); if (subscribeClient == null) { subscribeClient = new MQTTSubscribeClient(brokerURI, "MISTClient", mqttSubscribeClientMap); mqttSubscribeClientMap.putIfAbsent(brokerURI, subscribeClient); subscribeClient = mqttSubscribeClientMap.get(brokerURI); } return subscribeClient.connectToTopic(topic); }
Source:
public InvalidQuotaParametersException(String errorStr, Throwable cause) { super("InvalidQuotaParametersException: " + errorStr, cause); }

Target:
public InvalidQuotaParametersException(String errorStr, Throwable cause) { super(errorStr, cause); }
Source:
private void clearAsyncTasksWithOutVdsmId() { if (getReturnValue().getTaskPlaceHolderIdList().size() > 0) { TransactionSupport.executeInNewTransaction(new TransactionMethod<Object>() { @Override public Void runInTransaction() { for (final Guid asyncTaskId : getReturnValue().getTaskPlaceHolderIdList()) { AsyncTasks task = getAsyncTaskDao().get(asyncTaskId); if (task != null && Guid.isNullOrEmpty(task.getVdsmTaskId())) { AsyncTaskManager.removeTaskFromDbByTaskId(task.getTaskId()); } } return null; } }); } }

Target:
private void clearAsyncTasksWithOutVdsmId() { if (!getReturnValue().getTaskPlaceHolderIdList().isEmpty()) { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { for (Guid asyncTaskId : getReturnValue().getTaskPlaceHolderIdList()) { AsyncTasks task = getAsyncTaskDao().get(asyncTaskId); if (task != null && Guid.isNullOrEmpty(task.getVdsmTaskId())) { AsyncTaskManager.removeTaskFromDbByTaskId(task.getTaskId()); } } return null; } }); } }
Source:
private SearchNavigationLinks convertSearchLinksToPublicApiHost(SearchNavigationLinks originalLinks) { SearchNavigationLinks updatedLinks = new SearchNavigationLinks(); if (originalLinks.getFirstPage() != null) { updatedLinks.withFirstLink(publicApiUriGenerator.convertHostToPublicAPI(originalLinks.getFirstPage().getHref())); } if(originalLinks.getLastPage() != null) { updatedLinks.withLastLink(publicApiUriGenerator.convertHostToPublicAPI(originalLinks.getLastPage().getHref())); } if(originalLinks.getSelf() != null) { updatedLinks.withSelfLink(publicApiUriGenerator.convertHostToPublicAPI(originalLinks.getSelf().getHref())); } if(originalLinks.getNextPage() != null) { updatedLinks.withNextLink(publicApiUriGenerator.convertHostToPublicAPI(originalLinks.getNextPage().getHref())); } if(originalLinks.getPrevPage() != null) { updatedLinks.withPrevLink(publicApiUriGenerator.convertHostToPublicAPI(originalLinks.getPrevPage().getHref())); } return updatedLinks; }

Target:
private SearchNavigationLinks convertSearchLinksToPublicApiHost(SearchNavigationLinks originalLinks) { SearchNavigationLinks updatedLinks = new SearchNavigationLinks(); if (originalLinks.getFirstPage() != null) { updatedLinks.withFirstLink(createPubliApiMandateSearchLinkWithQueryFrom(originalLinks.getFirstPage().getHref())); } if(originalLinks.getLastPage() != null) { updatedLinks.withLastLink(createPubliApiMandateSearchLinkWithQueryFrom(originalLinks.getLastPage().getHref())); } if(originalLinks.getSelf() != null) { updatedLinks.withSelfLink(createPubliApiMandateSearchLinkWithQueryFrom(originalLinks.getSelf().getHref())); } if(originalLinks.getNextPage() != null) { updatedLinks.withNextLink(createPubliApiMandateSearchLinkWithQueryFrom(originalLinks.getNextPage().getHref())); } if(originalLinks.getPrevPage() != null) { updatedLinks.withPrevLink(createPubliApiMandateSearchLinkWithQueryFrom(originalLinks.getPrevPage().getHref())); } return updatedLinks; }
Source:
public boolean equals(Object object) { if (this == object) return true; if (object == null || getClass() != object.getClass()) return false; VersionID versionID = (VersionID) object; return (version == versionID.version && index == versionID.index); }

Target:
public boolean equals(Object object) { if (this == object) { return true; } if (object == null || getClass() != object.getClass()) { return false; } VersionID versionID = (VersionID) object; return (version == versionID.version && index == versionID.index); }
Source:
public void getApplicationByCandidateIdShouldReturnEmptyListWhenCandidateIdIsNotFound() { given(candidateRepository.findOne(NON_EXISTENT_CANDIDATE_ID)).willReturn(null); given(applicationsRepository.findByCandidateEntity(null, DEFAULT_PAGE_REQUEST)) .willReturn(new PageImpl<ApplicationEntity>(Collections.emptyList())); PagingResponse<CandidateApplicationDTO> result = applicationsService .getApplicationsByCandidateId(NON_EXISTENT_CANDIDATE_ID, PAGE_NUMBER_ZERO, PAGE_SIZE_TEN); assertThat(result.getTotal(), is(0L)); assertTrue(result.getRows().isEmpty()); }

Target:
public void getApplicationByCandidateIdShouldReturnEmptyListWhenCandidateIdIsNotFound() { given(candidateRepository.findOne(NON_EXISTENT_CANDIDATE_ID)).willReturn(null); given(applicationsRepository.findByCandidateEntity(null, DEFAULT_PAGE_REQUEST)) .willReturn(new PageImpl<ApplicationEntity>(Collections.emptyList())); final PagingResponse<CandidateApplicationDTO> result = applicationsService .getApplicationsByCandidateId(NON_EXISTENT_CANDIDATE_ID, PAGE_NUMBER_ZERO, PAGE_SIZE_TEN); assertThat(result.getTotal(), is(0L)); assertTrue(result.getRows().isEmpty()); }
Source:
public void accept(NotificationEvent event) { String dbName; String tableName; switch (event.getEventType()) { case MessageBuilder.ADD_PARTITION_EVENT: case MessageBuilder.ALTER_PARTITION_EVENT: case MessageBuilder.DROP_PARTITION_EVENT: case MessageBuilder.ALTER_TABLE_EVENT: case MessageBuilder.DROP_TABLE_EVENT: case MessageBuilder.INSERT_EVENT: dbName = event.getDbName(); tableName = event.getTableName(); break; default: return; } if (dbName == null || tableName == null) { LOG.info("Possibly malformed notification event, missing db or table name: {}", event); return; } LOG.debug("Handling event on table {}.{}", event.getEventType(), dbName, tableName); QueryResultsCache cache = QueryResultsCache.getInstance(); if (cache != null) { long eventTime = event.getEventTime() * 1000L; cache.notifyTableChanged(TableName.fromString(tableName, null, dbName), eventTime); } else { LOG.debug("Cache not instantiated, skipping event on {}.{}", dbName, tableName); } }

Target:
public void accept(NotificationEvent event) { String dbName; String tableName; switch (event.getEventType()) { case MessageBuilder.ADD_PARTITION_EVENT: case MessageBuilder.ALTER_PARTITION_EVENT: case MessageBuilder.DROP_PARTITION_EVENT: case MessageBuilder.ALTER_TABLE_EVENT: case MessageBuilder.DROP_TABLE_EVENT: case MessageBuilder.INSERT_EVENT: dbName = event.getDbName(); tableName = event.getTableName(); break; default: return; } if (dbName == null || tableName == null) { LOG.info("Possibly malformed notification event, missing db or table name: {}", event); return; } LOG.debug("Handling event on table {}.{}", event.getEventType(), dbName, tableName); QueryResultsCache cache = QueryResultsCache.getInstance(); if (cache != null) { long eventTime = event.getEventTime() * 1000L; cache.notifyTableChanged(TableName.fromString(tableName, dbName), eventTime); } else { LOG.debug("Cache not instantiated, skipping event on {}.{}", dbName, tableName); } }
Source:
public static Region parseRegion(String regionString) { Region region = null; if (regionString != null && !regionString.equals("")) { if (regionString.indexOf(':') != -1) { String[] fields = regionString.split("[:-]", -1); if (fields.length == 3) { region = new Region(fields[0], Integer.parseInt(fields[1]), Integer.parseInt(fields[2])); } else if (fields.length == 2) { region = new Region(fields[0], Integer.parseInt(fields[1]), Integer.MAX_VALUE); } } else { region = new Region(regionString, 0, Integer.MAX_VALUE); } } return region; }

Target:
public static Region parseRegion(String regionString) { Region region = null; if (regionString != null && !regionString.equals("")) { if (regionString.indexOf(':') != -1) { String[] fields = regionString.split("[:-]", -1); if (fields.length == 3) { region = new Region(fields[0], Integer.parseInt(fields[1]), Integer.parseInt(fields[2])); } else if (fields.length == 2) { region = new Region(fields[0], Integer.parseInt(fields[1])); } } else { region = new Region(regionString); } } return region; }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { Shell activeShell= HandlerUtil.getActiveShell(event); Object newNameValue= HandlerUtil.getVariable(event, LTK_RENAME_COMMAND_NEWNAME_PARAMETER_KEY); String newName= null; if (newNameValue instanceof String) { newName= (String) newNameValue; } else { RefactoringUIPlugin.logErrorMessage("Rename refactoring command new name parameter, expected String but got a " + newNameValue.getClass().getName()); } ISelection sel= HandlerUtil.getCurrentSelection(event); if (sel instanceof IStructuredSelection) { IResource resource= getCurrentResource((IStructuredSelection) sel); if (resource != null) { RenameResourceWizard refactoringWizard; if (newName != null) { refactoringWizard= new RenameResourceWizard(resource, newName); } else { refactoringWizard= new RenameResourceWizard(resource); } RefactoringWizardOpenOperation op= new RefactoringWizardOpenOperation(refactoringWizard); try { op.run(activeShell, RefactoringUIMessages.RenameResourceHandler_title); } catch (InterruptedException e) { } } } return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { Shell activeShell= HandlerUtil.getActiveShell(event); Object newNameValue= HandlerUtil.getVariable(event, LTK_RENAME_COMMAND_NEWNAME_PARAMETER_KEY); String newName= null; if (newNameValue instanceof String) { newName= (String) newNameValue; } else if (newNameValue != null) { RefactoringUIPlugin.logErrorMessage(RefactoringUIMessages.RenameResourceHandler_ERROR_EXPECTED_STRING + newNameValue.getClass().getName()); } ISelection sel= HandlerUtil.getCurrentSelection(event); if (sel instanceof IStructuredSelection) { IResource resource= getCurrentResource((IStructuredSelection) sel); if (resource != null) { RenameResourceWizard refactoringWizard; if (newName != null) { refactoringWizard= new RenameResourceWizard(resource, newName); } else { refactoringWizard= new RenameResourceWizard(resource); } RefactoringWizardOpenOperation op= new RefactoringWizardOpenOperation(refactoringWizard); try { op.run(activeShell, RefactoringUIMessages.RenameResourceHandler_title); } catch (InterruptedException e) { } } } return null; }
Source:
public int getFixedSize() { if (isDynamicType()) { return 32; } else { return elementType.getFixedSize() * size; } }

Target:
public int getFixedSize() { if (isDynamicType()) { return Int32Size; } else { return elementType.getFixedSize() * size; } }
Source:
public StreamTaskListener(Writer w) throws IOException { this(new WriterOutputStream(w), StandardCharsets.UTF_8); }

Target:
public StreamTaskListener(Writer w) throws IOException { this(new WriterOutputStream(w, StandardCharsets.UTF_8), StandardCharsets.UTF_8); }
Source:
public ConnectorFactory usingConnectionInfo(ConnectionInfo connectionInfo) { this.info = (ConnectionInfoImpl) connectionInfo; return this; }

Target:
public ConnectorFactory usingConnectionInfo(ConnectionInfo connectionInfo) { this.properties = connectionInfo.getProperties(); this.token = connectionInfo.getAuthenticationToken(); return this; }
Source:
public boolean areLoaded() { boolean result = true; int i = 1; List<WebElement> widgetIFrameList = getWidgetIFrameList(); if (widgetIFrameList.isEmpty()) { result = false; } for (WebElement widgetIFrame: widgetIFrameList) { if (!isWidgetVisible(widgetIFrame, getWidgetBody())) { result = false; PageObjectLogging.log(getTagName() + " #" + i, MercuryMessages.VISIBLE_MSG, result); break; } PageObjectLogging.log(getTagName() + " #" + i++, MercuryMessages.VISIBLE_MSG, result); } PageObjectLogging.log("all " + getTagName() + " widgets", MercuryMessages.VISIBLE_MSG, result); return result; }

Target:
public boolean areLoaded() { boolean result = true; int i = 1; List<WebElement> widgetIFrameList = getWidgetIFrameList(); if (widgetIFrameList.isEmpty()) { result = false; } else { for (WebElement widgetIFrame : widgetIFrameList) { if (!isWidgetVisible(widgetIFrame, getWidgetBody())) { result = false; PageObjectLogging.log(getTagName() + " #" + i, MercuryMessages.VISIBLE_MSG, result); break; } PageObjectLogging.log(getTagName() + " #" + i++, MercuryMessages.VISIBLE_MSG, result); } } PageObjectLogging.log("all " + getTagName() + " widgets", MercuryMessages.VISIBLE_MSG, result); return result; }
Source:
public LandingStrip(Context context, AttributeSet attrs) { super(context, attrs); setFillViewport(true); setWillNotDraw(false); setHorizontalScrollBarEnabled(false); this.attributes = Attributes.readAttributes(context, attrs); this.layoutInflater = LayoutInflater.from(context); this.indicatorPaint = new Paint(); this.state = new State(); this.tabsContainer = new LinearLayout(context); this.indicatorCoordinatesCalculator = IndicatorCoordinatesCalculator.newInstance(); state.updateDelegateOnPageListener(new ViewPager.SimpleOnPageChangeListener()); state.updatePosition(0); state.updatePositionOffset(0); tabsContainer.setOrientation(LinearLayout.HORIZONTAL); tabsContainer.setPadding(attributes.getTabsPaddingLeft(), 0, attributes.getTabsPaddingRight(), 0); indicatorPaint.setAntiAlias(true); indicatorPaint.setStyle(Paint.Style.FILL); indicatorPaint.setColor(getResources().getColor(attributes.getIndicatorColour())); addView(tabsContainer, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); }

Target:
public LandingStrip(Context context, AttributeSet attrs) { super(context, attrs); setFillViewport(true); setWillNotDraw(false); setHorizontalScrollBarEnabled(false); this.attributes = Attributes.readAttributes(context, attrs); this.layoutInflater = LayoutInflater.from(context); this.indicatorPaint = new Paint(); this.state = new State(); this.tabsContainer = new LinearLayout(context); this.indicatorCoordinatesCalculator = IndicatorCoordinatesCalculator.newInstance(); state.updateDelegateOnPageListener(new ViewPager.SimpleOnPageChangeListener()); state.updatePosition(0); state.updatePositionOffset(0); tabsContainer.setOrientation(LinearLayout.HORIZONTAL); tabsContainer.setPadding(attributes.getTabsPaddingLeft(), 0, attributes.getTabsPaddingRight(), 0); indicatorPaint.setAntiAlias(true); indicatorPaint.setStyle(Paint.Style.FILL); indicatorPaint.setColor(getResources().getColor(attributes.getIndicatorColor())); addView(tabsContainer, new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); }
Source:
public void testGetTicketInControlTeamMemberTicket() { User user = createUser(); createTicketForUser(user); User teammate = createUser(); createTicketForUser(teammate); Team team = createTeamWithCaptain(user); team.addMember(teammate); given(). header(getXAuthTokenHeaderForUser(user)). when(). get(TICKETS_ENDPOINT + "/teammembers"). then(). statusCode(HttpStatus.SC_OK). body("owner.username", containsInAnyOrder(user.getUsername(), teammate.getUsername())); }

Target:
public void testGetTicketInControlTeamMemberTicket() { User user = createUser(); createTicketForUser(user); User teammate = createUser(); createTicketForUser(teammate); Team team = createTeamWithCaptain(user); addMemberToTeam(team, teammate); given(). header(getXAuthTokenHeaderForUser(user)). when(). get(TICKETS_ENDPOINT + "/teammembers"). then(). statusCode(HttpStatus.SC_OK). body("owner.username", containsInAnyOrder(user.getUsername(), teammate.getUsername())); }
Source:
public final Map<String, Integer> getSeverityNumDiff() { final Map<String, Integer> severityNumDiff = new HashMap<>(severityNumRemoved); severityNumAdded.forEach((key, value) -> severityNumDiff.merge(key, value, Math::addExact)); return severityNumDiff; }

Target:
public final Map<String, BigInteger> getSeverityNumDiff() { final Map<String, BigInteger> severityNumDiff = new HashMap<>(severityNumDiffRemoved); severityNumDiffAdded.forEach( (key, value) -> severityNumDiff.merge(key, value, BigInteger::add)); return severityNumDiff; }
Source:
public void setProgressMonitor(ProgressMonitor pm) { this.pm = ((pm == null) ? NullProgressMonitor.INSTANCE : pm); }

Target:
public GC setProgressMonitor(ProgressMonitor pm) { this.pm = (pm == null) ? NullProgressMonitor.INSTANCE : pm; return this; }
Source:
public static String decrypt(String source, String keyFile, String passwd, String alias) throws Exception { try { String result = ""; if (!StringHelper.isNullOrEmpty(source.trim())) { KeyStore store = EncryptionUtils.getKeyStore(keyFile, passwd, certType); result = decrypt(source, store.getKey(alias, passwd.toCharArray())); } return result; } catch (Exception e) { log.error("Failed to decrypt " + e.getMessage()); log.debug("Failed to decrypt", e); throw e; } }

Target:
public static String decrypt(String source, String keyFile, String passwd, String alias) throws Exception { try { String result = ""; if (source.trim().length() > 0) { KeyStore store = EncryptionUtils.getKeyStore(keyFile, passwd, certType); result = decrypt(source, store.getKey(alias, passwd.toCharArray())); } return result; } catch (Exception e) { log.error("Failed to decrypt " + e.getMessage()); log.debug("Failed to decrypt", e); throw e; } }
Source:
public AbfsClientContext( ExponentialRetryPolicy exponentialRetryPolicy, AbfsPerfTracker abfsPerfTracker, AbfsCounters abfsCounters) { this.exponentialRetryPolicy = exponentialRetryPolicy; this.abfsPerfTracker = abfsPerfTracker; this.abfsCounters = abfsCounters; }

Target:
AbfsClientContext( ExponentialRetryPolicy exponentialRetryPolicy, AbfsPerfTracker abfsPerfTracker, AbfsCounters abfsCounters) { this.exponentialRetryPolicy = exponentialRetryPolicy; this.abfsPerfTracker = abfsPerfTracker; this.abfsCounters = abfsCounters; }
Source:
protected void putDocuments(String indexName, List<SearchDocument> documents) { List<Document> searchDocuments = new ArrayList<Document>(); for (SearchDocument document : documents) { searchDocuments.add(document.build()); } try { SearchManager.putDocuments(indexName, searchDocuments); } catch (Exception e) { log.info("Failed to batch put searchable documents in " + indexName + " for " + documents.toString()); } }

Target:
protected void putDocuments(String indexName, List<SearchDocument> documents) { List<Document> searchDocuments = new ArrayList<Document>(); for (SearchDocument document : documents) { searchDocuments.add(document.build()); } try { SearchManager.putDocuments(indexName, searchDocuments); } catch (Exception e) { log.severe("Failed to batch put searchable documents in " + indexName + " for " + documents.toString()); } }