auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Map<Long, ILogData> readAll(RuntimeLayout runtimeLayout, List<Long> globalAddresses) { log.trace("ChainReplicationProtocol-readAll: multiple read for addresses {}", globalAddresses); Long startAddress = globalAddresses.get(0); int numUnits = runtimeLayout.getLayout().getSegmentLength(startAddress); Map<Long, LogData> logResult = CFUtils.getUninterruptibly(runtimeLayout .getLogUnitClient(startAddress, numUnits - 1) .read(globalAddresses)).getAddresses(); return multiRead(runtimeLayout, logResult, startAddress, numUnits, true); }

Target:
public Map<Long, ILogData> readAll(RuntimeLayout runtimeLayout, List<Long> globalAddresses) { log.trace("ChainReplicationProtocol-readAll: multiple read for addresses {}", globalAddresses); Long startAddress = Collections.min(globalAddresses); int numUnits = runtimeLayout.getLayout().getSegmentLength(startAddress); Map<Long, LogData> logResult = CFUtils.getUninterruptibly(runtimeLayout .getLogUnitClient(startAddress, numUnits - 1) .read(globalAddresses)).getAddresses(); return multiRead(runtimeLayout, logResult, startAddress, numUnits, true); }
Source:
synchronized List<IngestModuleError> process(DataSourceIngestTask task) { List<IngestModuleError> errors = new ArrayList<>(); if (!this.ingestJobPipeline.isCancelled()) { Content dataSource = task.getDataSource(); for (PipelineModule module : modules) { try { this.currentModule = module; String displayName = NbBundle.getMessage(this.getClass(), "IngestJob.progress.dataSourceIngest.displayName", module.getDisplayName(), dataSource.getName()); this.ingestJobPipeline.updateDataSourceIngestProgressBarDisplayName(displayName); this.ingestJobPipeline.switchDataSourceIngestProgressBarToIndeterminate(); DataSourceIngestPipeline.ingestManager.setIngestTaskProgress(task, module.getDisplayName()); logger.log(Level.INFO, "{0} analysis of {1} (jobId={2}) starting", new Object[]{module.getDisplayName(), this.ingestJobPipeline.getDataSource().getName(), this.ingestJobPipeline.getId()}); module.process(dataSource, new DataSourceIngestModuleProgress(this.ingestJobPipeline)); logger.log(Level.INFO, "{0} analysis of {1} (jobId={2}) finished", new Object[]{module.getDisplayName(), this.ingestJobPipeline.getDataSource().getName(), this.ingestJobPipeline.getId()}); } catch (Throwable ex) { errors.add(new IngestModuleError(module.getDisplayName(), ex)); } if (this.ingestJobPipeline.isCancelled()) { break; } else if (this.ingestJobPipeline.currentDataSourceIngestModuleIsCancelled()) { this.ingestJobPipeline.currentDataSourceIngestModuleCancellationCompleted(currentModule.getDisplayName()); } } } this.currentModule = null; ingestManager.setIngestTaskProgressCompleted(task); return errors; }

Target:
synchronized List<IngestModuleError> process(DataSourceIngestTask task) { List<IngestModuleError> errors = new ArrayList<>(); if (!this.ingestJobPipeline.isCancelled()) { Content dataSource = task.getDataSource(); for (PipelineModule module : modules) { try { this.currentModule = module; String displayName = NbBundle.getMessage(this.getClass(), "IngestJob.progress.dataSourceIngest.displayName", module.getDisplayName(), dataSource.getName()); this.ingestJobPipeline.updateDataSourceIngestProgressBarDisplayName(displayName); this.ingestJobPipeline.switchDataSourceIngestProgressBarToIndeterminate(); DataSourceIngestPipeline.ingestManager.setIngestTaskProgress(task, module.getDisplayName()); logger.log(Level.INFO, "{0} analysis of {1} (pipeline={2}) starting", new Object[]{module.getDisplayName(), ingestJobPipeline.getDataSource().getName(), ingestJobPipeline.getId()}); module.process(dataSource, new DataSourceIngestModuleProgress(this.ingestJobPipeline)); logger.log(Level.INFO, "{0} analysis of {1} (pipeline={2}) finished", new Object[]{module.getDisplayName(), ingestJobPipeline.getDataSource().getName(), ingestJobPipeline.getId()}); } catch (Throwable ex) { errors.add(new IngestModuleError(module.getDisplayName(), ex)); } if (this.ingestJobPipeline.isCancelled()) { break; } else if (this.ingestJobPipeline.currentDataSourceIngestModuleIsCancelled()) { this.ingestJobPipeline.currentDataSourceIngestModuleCancellationCompleted(currentModule.getDisplayName()); } } } this.currentModule = null; ingestManager.setIngestTaskProgressCompleted(task); return errors; }
Source:
private Object[] prepareParameters(Method method, MultiValueMap<String, ? extends Object> rawParameters, Pageable pageable, Sort sort) { List<MethodParameter> parameters = new MethodParameters(method, PARAM_ANNOTATION).getParameters(); if (parameters.isEmpty()) { return new Object[0]; } Object[] result = new Object[parameters.size()]; Sort sortToUse = pageable == null ? sort : pageable.getSort(); for (int i = 0; i < result.length; i++) { MethodParameter param = parameters.get(i); Class<?> targetType = param.getParameterType(); if (Pageable.class.isAssignableFrom(targetType)) { result[i] = pageable; } else if (Sort.class.isAssignableFrom(targetType)) { result[i] = sortToUse; } else { final Parameter parameterAnnotation = param.getParameterAnnotation(Parameter.class); String parameterName = null; if (parameterAnnotation != null) { parameterName = parameterAnnotation.value(); } if (parameterName == null) { parameterName = param.getParameterName(); } if (StringUtils.isBlank(parameterName)) { throw new IllegalArgumentException( String.format(NAME_NOT_FOUND, ClassUtils.getQualifiedMethodName(method))); } Object value = unwrapSingleElement(rawParameters.get(parameterName)); result[i] = targetType.isInstance(value) ? value : convert(value, param); } } return result; }

Target:
private Object[] prepareParameters(Method method, MultiValueMap<String, ? extends Object> rawParameters, Pageable pageable, Sort sort) { List<MethodParameter> parameters = new MethodParameters(method, PARAM_ANNOTATION).getParameters(); if (parameters.isEmpty()) { return new Object[0]; } Object[] result = new Object[parameters.size()]; Sort sortToUse = pageable == null ? sort : pageable.getSort(); for (int i = 0; i < result.length; i++) { MethodParameter param = parameters.get(i); Class<?> targetType = param.getParameterType(); if (Pageable.class.isAssignableFrom(targetType)) { result[i] = pageable; } else if (Sort.class.isAssignableFrom(targetType)) { result[i] = sortToUse; } else { final Parameter parameterAnnotation = param.getParameterAnnotation(Parameter.class); String parameterName = getParamName(param, parameterAnnotation); if (StringUtils.isBlank(parameterName)) { throw new IllegalArgumentException( String.format(NAME_NOT_FOUND, ClassUtils.getQualifiedMethodName(method))); } Object value = unwrapSingleElement(rawParameters.get(parameterName)); result[i] = targetType.isInstance(value) ? value : convert(value, param); } } return result; }
Source:
public void cancelContinuous(UUID routineId) { if (log.isInfoEnabled()) log.info("Killing continuous query[routineId=" + routineId + ']'); boolean res; try { IgniteClusterImpl cluster = ctx.cluster().get(); IgniteCompute compute = cluster.compute(); ClusterNode srv = U.randomServerNode(ctx); res = compute.execute(new VisorContinuousQueryCancelTask(), new VisorTaskArgument<>(srv.id(), new VisorContinuousQueryCancelTaskArg(routineId), false)); } catch (Exception e) { throw new RuntimeException(e); } if (!res) throw new RuntimeException("Query not found[routineId=" + routineId + ']'); }

Target:
public void cancelContinuous(UUID routineId) { if (log.isInfoEnabled()) log.info("Killing continuous query[routineId=" + routineId + ']'); try { IgniteClusterImpl cluster = ctx.cluster().get(); IgniteCompute compute = cluster.compute(); ClusterNode srv = U.randomServerNode(ctx); boolean res = compute.execute(new VisorContinuousQueryCancelTask(), new VisorTaskArgument<>(srv.id(), new VisorContinuousQueryCancelTaskArg(routineId), false)); if (!res) throw new RuntimeException("Query not found[routineId=" + routineId + ']'); } catch (IgniteException e) { throw new RuntimeException(e); } }
Source:
private void createConnectorsSection(Composite parent) { TableWrapLayout layout = new TableWrapLayout(); layout.makeColumnsEqualWidth = true; layout.leftMargin = 0; layout.rightMargin = 0; layout.topMargin = 0; layout.bottomMargin = 0; ScrolledForm composite = toolkit.createScrolledForm(parent); composite.getBody().setLayout(layout); TableWrapData data = new TableWrapData(TableWrapData.FILL); composite.setLayoutData(data); List<AbstractRepositoryConnector> connectors = new ArrayList<AbstractRepositoryConnector>( TasksUi.getRepositoryManager().getRepositoryConnectors()); Collections.sort(connectors, new Comparator<AbstractRepositoryConnector>() { public int compare(AbstractRepositoryConnector o1, AbstractRepositoryConnector o2) { return o1.getLabel().compareToIgnoreCase(o2.getLabel()); } }); for (AbstractRepositoryConnector connector : connectors) { if (TasksUi.getRepositoryManager().getRepositories(connector.getConnectorKind()).isEmpty()) { continue; } AbstractRepositoryConnectorUi connectorUi = TasksUi.getRepositoryConnectorUi(connector.getConnectorKind()); if (connectorUi != null) { List<LegendElement> elements = connectorUi.getLegendElements(); if (elements != null && elements.size() > 0) { legendElements.addAll(elements); addLegendElements(composite.getBody(), connector, elements); } else { List<LegendElement> items = connectorUi.getLegendElements(); if (items != null && !items.isEmpty()) { addLegacyLegendItems(composite, connector, items); } } } } layout.numColumns = Math.max(composite.getBody().getChildren().length, 1); Point w = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT); data.maxWidth = (w.x / layout.numColumns) * 3; }

Target:
private void createConnectorsSection(Composite parent) { TableWrapLayout layout = new TableWrapLayout(); layout.makeColumnsEqualWidth = true; layout.leftMargin = 0; layout.rightMargin = 0; layout.topMargin = 0; layout.bottomMargin = 0; ScrolledForm composite = toolkit.createScrolledForm(parent); composite.getBody().setLayout(layout); TableWrapData data = new TableWrapData(TableWrapData.FILL); composite.setLayoutData(data); List<AbstractRepositoryConnector> connectors = new ArrayList<AbstractRepositoryConnector>( TasksUi.getRepositoryManager().getRepositoryConnectors()); Collections.sort(connectors, new Comparator<AbstractRepositoryConnector>() { public int compare(AbstractRepositoryConnector o1, AbstractRepositoryConnector o2) { return o1.getLabel().compareToIgnoreCase(o2.getLabel()); } }); for (AbstractRepositoryConnector connector : connectors) { if (TasksUi.getRepositoryManager().getRepositories(connector.getConnectorKind()).isEmpty()) { continue; } AbstractRepositoryConnectorUi connectorUi = TasksUi.getRepositoryConnectorUi(connector.getConnectorKind()); if (connectorUi != null) { List<LegendElement> elements = connectorUi.getLegendElements(); if (elements != null && elements.size() > 0) { legendElements.addAll(elements); addLegendElements(composite.getBody(), connector, elements); } } } layout.numColumns = Math.max(composite.getBody().getChildren().length, 1); Point w = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT); data.maxWidth = (w.x / layout.numColumns) * 3; }
Source:
private List<OOBPayload> processOOB(String text) { ArrayList<OOBPayload> payloads = new ArrayList<OOBPayload>(); Matcher oobMatcher = oobPattern.matcher(text); while (oobMatcher.find()) { String oobPayload = oobMatcher.group(0); Matcher mrlMatcher = mrlPattern.matcher(oobPayload); while (mrlMatcher.find()) { String mrlPayload = mrlMatcher.group(0); OOBPayload payload = parseOOB(mrlPayload); payloads.add(payload); invoke("publishOOBText", mrlPayload); ServiceInterface s = Runtime.getService(payload.getServiceName()); if (s == null) { log.warn("Service name in OOB/MRL tag unknown. {}", mrlPayload); if (payload.getParams() != null) { conversationHistory.add("<font color='#FF0000'><b> -> Missing OOB : " + payload.getParams() + "</b></font>"); } else { conversationHistory.add("<font color='#FF0000'><b> -> Missing OOB : " + payload.getServiceName() + "</b></font>"); } return null; } Object result = null; if (payload.getParams() != null) { result = s.invoke(payload.getMethodName(), payload.getParams().toArray()); conversationHistory.add("<font color='#008000'><b> -> OOB: " + payload.getParams() + "</b></font>"); } else { result = s.invoke(payload.getMethodName()); conversationHistory.add("<font color='#008000'><b> -> OOB: " + payload.getMethodName() + "</b></font>"); } log.info("OOB PROCESSING RESULT: {}", result); } } if (payloads.size() > 0) { return payloads; } else { return null; } }

Target:
private List<OOBPayload> processOOB(String text) { ArrayList<OOBPayload> payloads = new ArrayList<OOBPayload>(); Matcher oobMatcher = oobPattern.matcher(text); while (oobMatcher.find()) { String oobPayload = oobMatcher.group(0); Matcher mrlMatcher = mrlPattern.matcher(oobPayload); while (mrlMatcher.find()) { String mrlPayload = mrlMatcher.group(0); OOBPayload payload = parseOOB(mrlPayload); payloads.add(payload); invoke("publishOOBText", mrlPayload); ServiceInterface s = Runtime.getService(payload.getServiceName()); if (s == null) { log.warn("Service name in OOB/MRL tag unknown. {}", mrlPayload); return null; } Object result = null; if (payload.getParams() != null) { result = s.invoke(payload.getMethodName(), payload.getParams().toArray()); } else { result = s.invoke(payload.getMethodName()); } log.info("OOB PROCESSING RESULT: {}", result); } } if (payloads.size() > 0) { return payloads; } else { return null; } }
Source:
public final void visitMethodInvocation(MethodInvocationTree tree) { scan(tree.methodSelect()); scan(tree.arguments()); for (ExecutionState executionState : currentStates) { SymbolicValue[] arguments = new SymbolicValue[tree.arguments().size()]; for (int i = arguments.length - 1; i >= 0; i -= 1) { arguments[i] = executionState.pop(); } check.onExecutableElementInvocation(executionState, tree, Arrays.asList(arguments)); executionState.invalidateFields(SymbolicEvaluator.this); } }

Target:
public final void visitMethodInvocation(MethodInvocationTree tree) { scan(tree.methodSelect()); scan(tree.arguments()); for (ExecutionState executionState : currentStates) { SymbolicValue[] arguments = new SymbolicValue[tree.arguments().size()]; for (int i = arguments.length - 1; i >= 0; i--) { arguments[i] = executionState.pop(); } check.onExecutableElementInvocation(executionState, tree, Arrays.asList(arguments)); executionState.invalidateFields(SymbolicEvaluator.this); } }
Source:
public void checkTerminalAndBuild() { multiSplitPanel.selectSplitPanel(3); commandsBuilder( TestIntelligentCommandsConstants.CommandsGoals.COMMON_GOAL, TestIntelligentCommandsConstants.CommandsTypes.MAVEN_TYPE); projectExplorer.invokeCommandWithContextMenu(COMMON_GOAL, PROJECT_NAME, BUILD_COMM); consoles.waitExpectedTextIntoConsole(TestBuildConstants.BUILD_SUCCESS, 120); multiSplitPanel.waitTabProcessIsPresent(3, BUILD_COMM); multiSplitPanel.selectSplitPanel(1); consoles.clickOnPlusMenuButton(); consoles.clickOnTerminalItemInContextMenu(); consoles.startTerminalFromProcessesArea("dev-machine"); multiSplitPanel.waitTabProcessIsPresent(1, "Terminal-2"); terminal.waitTerminalIsNotEmpty(2); loader.waitOnClosed(); typeIntoTerminalAndCheckTerminalIsNotEmpty(); multiSplitPanel.waitTabProcessIsNotPresent(2, BUILD_COMM); }

Target:
public void checkTerminalAndBuild() { multiSplitPanel.selectSplitPanel(3); commandsBuilder( TestIntelligentCommandsConstants.CommandsGoals.COMMON_GOAL, TestIntelligentCommandsConstants.CommandsTypes.MAVEN_TYPE); projectExplorer.invokeCommandWithContextMenu(COMMON_GOAL, PROJECT_NAME, BUILD_COMM); consoles.waitExpectedTextIntoConsole(TestBuildConstants.BUILD_SUCCESS, 120); multiSplitPanel.waitTabProcessIsPresent(3, BUILD_COMM); multiSplitPanel.selectSplitPanel(1); consoles.clickOnPlusMenuButton(); consoles.clickOnTerminalItemInContextMenu(); consoles.startTerminalFromProcessesArea("dev-machine"); multiSplitPanel.waitTabProcessIsPresent(1, "Terminal-2"); terminal.waitTerminalIsNotEmpty(2); loader.waitOnClosed(); terminal.typeIntoActiveTerminal(getCommandToCheckTerminal()); terminal.typeIntoActiveTerminal(Keys.ENTER.toString()); terminal.waitTerminalIsNotEmpty(3); loader.waitOnClosed(); checkExpectedTextIsPresent(); multiSplitPanel.waitTabProcessIsNotPresent(2, BUILD_COMM); }
Source:
public static StrictPathRestriction stringToEnum(String strictPathRestrictionInString) { return StrictPathRestriction.valueOf(strictPathRestrictionInString.toUpperCase()); }

Target:
public static StrictPathRestriction stringToEnum(String strictPathRestrictionInString) { return StrictPathRestriction.valueOf(strictPathRestrictionInString.toUpperCase(Locale.ENGLISH)); }
Source:
public void setYValue(int i, double yvalue) { switch (fType) { case DELTA: double[] absoluteVals = fYAbsoluteValues; if (absoluteVals == null) { throw new IllegalStateException(); } absoluteVals[i] = yvalue; double prevValue = yvalue; if (i > 0) { prevValue = absoluteVals[i - 1]; } fYValues[i] = yvalue - prevValue; break; case ABSOLUTE: default: fYValues[i] = yvalue; break; } }

Target:
public void setYValue(int i, double yvalue) { switch (fType) { case DELTA: double[] absoluteVals = Objects.requireNonNull(fYAbsoluteValues, "Array of absolute value should not be null"); absoluteVals[i] = yvalue; double prevValue = yvalue; if (i > 0) { prevValue = absoluteVals[i - 1]; } fYValues[i] = yvalue - prevValue; break; case ABSOLUTE: default: fYValues[i] = yvalue; break; } }
Source:
public AllergyIntolerance getAllergyById(String uuid) { PatientService allergyService = Context.getService(PatientService.class); org.openmrs.Allergy openMRSAllergy = allergyService.getAllergyByUuid(uuid); return openMRSAllergy != null ? FHIRAllergyIntoleranceUtil.generateAllergyIntolerance(openMRSAllergy) : null; }

Target:
public AllergyIntolerance getAllergyById(String uuid) { PatientService patientService = Context.getPatientService(); org.openmrs.Allergy openMRSAllergy = patientService.getAllergyByUuid(uuid); return openMRSAllergy != null ? FHIRAllergyIntoleranceUtil.generateAllergyIntolerance(openMRSAllergy) : null; }
Source:
public void testComplexType() { GuavaOptionalComplexType value = new GuavaOptionalComplexType( Optional.of( new GuavaOptionalComplexType( Optional.absent(), Optional.absent(), Paths.get("/bar"))), Optional.of("baz"), Paths.get("/foo")); assertThat(service.getGuavaComplexType(value), is(value)); }

Target:
public void testComplexType() { GuavaOptionalComplexType value = new GuavaOptionalComplexType( Optional.of( new GuavaOptionalComplexType( Optional.absent(), Optional.absent(), Paths.get("bar"))), Optional.of("baz"), Paths.get("foo")); assertThat(service.getGuavaComplexType(value), is(value)); }
Source:
public static <R> R doAtomically(String key, Supplier<R> supplier) throws ConcurrentUpdateException { KeyValueStore kvStore = Framework.getService(KeyValueService.class).getKeyValueStore(DOCUMENT_LOCK); try { if (tryLock(key, kvStore)) { try { TransactionHelper.commitOrRollbackTransaction(); TransactionHelper.startTransaction(); return supplier.get(); } finally { try { TransactionHelper.commitOrRollbackTransaction(); TransactionHelper.startTransaction(); } finally { unlock(key, kvStore); } } } else { throw new ConcurrentUpdateException("Failed to acquire the lock on key " + key); } } catch (InterruptedException e) { throw new NuxeoException(e); } }

Target:
public static <R> R doAtomically(String key, Supplier<R> supplier) throws ConcurrentUpdateException { KeyValueStore kvStore = Framework.getService(KeyValueService.class).getKeyValueStore(DOCUMENT_LOCK); try { if (tryLock(key, kvStore)) { try { TransactionHelper.commitOrRollbackTransaction(); TransactionHelper.startTransaction(); return supplier.get(); } finally { try { TransactionHelper.commitOrRollbackTransaction(); TransactionHelper.startTransaction(); } finally { unlock(key, kvStore); } } } else { throw new ConcurrentUpdateException("Failed to acquire the lock on key " + key); } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new NuxeoException(e); } }
Source:
public boolean isShowSuraTranslatedName() { return prefs.getBoolean(Constants.PREF_SURA_TRANSLATED_NAME, false); }

Target:
public boolean isShowSuraTranslatedName() { return prefs.getBoolean(Constants.PREF_SURA_TRANSLATED_NAME, appContext.getResources().getBoolean(R.bool.show_sura_names_translation)); }
Source:
public ServiceBuilder<GlobalConfiguration> build(ServiceTarget target) { ServiceBuilder<GlobalConfiguration> builder = target.addService(this.getServiceName(), new ValueService<>(this)) .addDependency(Services.JBOSS_SERVICE_MODULE_LOADER, ModuleLoader.class, this.loader) ; for (ValueDependency<ThreadPoolConfiguration> poolConfigurationValueDependency : this.pools.values()) { poolConfigurationValueDependency.register(builder); } for (ValueDependency<ThreadPoolConfiguration> threadPoolConfigurationValueDependency : this.schedulers.values()) { threadPoolConfigurationValueDependency.register(builder); } for (ValueDependency<?> dependency : Arrays.asList(this.module, this.transport, this.site, this.server)) { if (dependency != null) { dependency.register(builder); } } return builder; }

Target:
public ServiceBuilder<GlobalConfiguration> build(ServiceTarget target) { ServiceBuilder<GlobalConfiguration> builder = target.addService(this.getServiceName(), new ValueService<>(this)) .addDependency(Services.JBOSS_SERVICE_MODULE_LOADER, ModuleLoader.class, this.loader) ; for (ValueDependency<ThreadPoolConfiguration> dependency : this.pools.values()) { dependency.register(builder); } for (ValueDependency<ThreadPoolConfiguration> dependency : this.schedulers.values()) { dependency.register(builder); } for (ValueDependency<?> dependency : Arrays.asList(this.module, this.transport, this.site, this.server)) { if (dependency != null) { dependency.register(builder); } } return builder; }
Source:
private ICPPEvaluation createOperatorOverloadEvaluation(ICPPFunction overload, IASTNode point, ICPPEvaluation arg) { if(overload instanceof ICPPMethod) { EvalMemberAccess opAccess = new EvalMemberAccess(arg.getType(point), ValueCategory.LVALUE, overload, arg, false, point); ICPPEvaluation[] args = new ICPPEvaluation[]{opAccess}; return new EvalFunctionCall(args, arg, point); } else { ICPPASTName name = new CPPASTName(overload.getNameCharArray()); name.setBinding(overload); IASTIdExpression idExpr = new CPPASTIdExpression(name); ICPPEvaluation op = EvalID.create(idExpr); ICPPEvaluation[] args = new ICPPEvaluation[]{op, arg}; return new EvalFunctionCall(args, null, point); } }

Target:
private ICPPEvaluation createOperatorOverloadEvaluation(ICPPFunction overload, IASTNode point, ICPPEvaluation arg) { if(overload instanceof ICPPMethod) { EvalMemberAccess opAccess = new EvalMemberAccess(arg.getType(point), ValueCategory.LVALUE, overload, arg, false, point); ICPPEvaluation[] args = new ICPPEvaluation[]{opAccess}; return new EvalFunctionCall(args, arg, point); } else { EvalBinding op = new EvalBinding(overload, overload.getType(), point); ICPPEvaluation[] args = new ICPPEvaluation[]{op, arg}; return new EvalFunctionCall(args, null, point); } }
Source:
public final void testDiscoverDevicesErrorAddingDeviceToNetwork() throws Exception { XBeeProtocol protocol = XBeeProtocol.ZIGBEE; PowerMockito.when(deviceMock.getXBeeProtocol()).thenReturn(protocol); ATCommandResponsePacket packet = createPacket(1, ATCommandStatus.OK, new XBee16BitAddress("0000"), new XBee64BitAddress("0013A20040A6A0DB"), "Ni string", new XBee16BitAddress("FFFE"), (byte)0x00 , (byte)0x49); ndAnswers.add(packet); DiscoveryListener listener = new DiscoveryListener(); listeners.add(listener); Mockito.when(networkMock.addRemoteDevice(Mockito.any(RemoteXBeeDevice.class))).thenReturn(null); long start = System.currentTimeMillis(); nd.startDiscoveryProcess(listeners); long endBlock = System.currentTimeMillis(); assertThat("The 'discoverDevices' should not block", endBlock - start < TIMEOUT, is(equalTo(true))); assertThat("The 'discoverDevices' should be running", listener.isFinished(), is(equalTo(false))); while(!listener.isFinished()) { Thread.sleep(100); } long end = System.currentTimeMillis(); String error = "Error adding device '0013A20040A6A0DB - Ni string' to the network."; assertThat("The 'discoverDevices' process should finish after " + TIMEOUT + " ms", end - start < TIMEOUT + 150 , is(equalTo(true))); assertThat("The discovered devices list should be empty", listener.getDiscoveredDevices().size(), is(equalTo(0))); assertThat("The discovery error should be " + error, listener.getErrors().get(0), is(equalTo(error))); }

Target:
public final void testDiscoverDevicesErrorAddingDeviceToNetwork() throws Exception { XBeeProtocol protocol = XBeeProtocol.ZIGBEE; PowerMockito.when(deviceMock.getXBeeProtocol()).thenReturn(protocol); ATCommandResponsePacket packet = createPacket(1, ATCommandStatus.OK, new XBee16BitAddress("0000"), new XBee64BitAddress("0013A20040A6A0DB"), "Ni string", new XBee16BitAddress("FFFE"), (byte)0x00 , (byte)0x49); ndAnswers.add(packet); DiscoveryListener listener = new DiscoveryListener(); listeners.add(listener); Mockito.when(networkMock.addRemoteDevice(Mockito.any(RemoteXBeeDevice.class))).thenReturn(null); long start = System.currentTimeMillis(); nd.startDiscoveryProcess(listeners); long endBlock = System.currentTimeMillis(); assertThat("The 'discoverDevices' should not block", endBlock - start < TIMEOUT, is(equalTo(true))); assertThat("The 'discoverDevices' should be running", listener.isFinished(), is(equalTo(false))); while(!listener.isFinished()) { Thread.sleep(50); } long end = System.currentTimeMillis(); String error = "Error adding device '0013A20040A6A0DB - Ni string' to the network."; assertThat("The 'discoverDevices' process should finish after " + TIMEOUT + " ms", end - start < TIMEOUT + 150 , is(equalTo(true))); assertThat("The discovered devices list should be empty", listener.getDiscoveredDevices().size(), is(equalTo(0))); assertThat("The discovery error should be " + error, listener.getErrors().get(0), is(equalTo(error))); }
Source:
public void addError(Throwable error) { if (error == null) { throw new NullPointerException("Error cannot be null"); } if (error instanceof AssumptionViolatedException) { AssertionError e = new AssertionError(error.getMessage()); e.initCause(error); error = e; } errors.add(error); }

Target:
public void addError(Throwable error) { if (error == null) { throw new NullPointerException("Error cannot be null"); } if (error instanceof AssumptionViolatedException) { AssertionError e = new AssertionError(error.getMessage()); e.initCause(error); errors.add(e); } else { errors.add(error); } }
Source:
private void updateBackup() { if (getCurrentStorageItem().getRole() == StorageDomainType.ISO || getCurrentStorageItem().getRole() == StorageDomainType.ImportExport || getCurrentStorageItem() != null) { getBackup().setIsAvailable(false); getBackup().setEntity(false); return; } boolean backupSupported = (Boolean) AsyncDataProvider.getInstance().getConfigValuePreConverted( ConfigValues.BackupSupported, getDataCenter().getSelectedItem().getCompatibilityVersion().toString()); getBackup().setIsAvailable(backupSupported); getBackup().setEntity(isNewStorage() ? false : getStorage().isBackup()); }

Target:
private void updateBackup() { if (getCurrentStorageItem() != null && getDataCenter().getSelectedItems() != null) { if (getCurrentStorageItem().getRole() == StorageDomainType.ISO || getCurrentStorageItem().getRole() == StorageDomainType.ImportExport) { getBackup().setIsAvailable(false); getBackup().setEntity(false); return; } else { boolean backupSupported = (Boolean) AsyncDataProvider.getInstance().getConfigValuePreConverted( ConfigValues.BackupSupported, getDataCenter().getSelectedItem().getCompatibilityVersion().toString()); getBackup().setIsAvailable(backupSupported); getBackup().setEntity(isNewStorage() ? false : getStorage().isBackup()); } } }
Source:
private void addMessage(String message) { addMessage(-2, message); }

Target:
private void addMessage(String message) { addMessage(ROW_NOT_SET, message); }
Source:
public void clickBackToWikiLink() { backToWiki.click(); }

Target:
public PostsListPage clickBackToWikiLink() { backToWiki.click(); return this; }
Source:
public List<Object[]> getTestGroups(Set<Long> taskIds){ return entityManager.createNativeQuery("select task.id, task.taskId, task.sessionId from TaskData task inner join " + "(select taskData.id, taskData.taskId, workloadData.parentId, taskData.sessionId from TaskData taskData " + "inner join WorkloadData workloadData on taskData.taskId=workloadData.taskId " + "and taskData.sessionId=workloadData.sessionId where taskData.id in (:ids)) parents " + "on task.taskId=parents.parentId and task.sessionId=parents.sessionId;").setParameter("ids", taskIds).getResultList(); }

Target:
public List<Object[]> getTestGroups(Set<Long> taskIds){ return entityManager.createNativeQuery("select task.id, task.taskId, task.sessionId from TaskData task " + "inner join " + "(select taskData.id, taskData.taskId, workloadData.parentId, taskData.sessionId from TaskData taskData " + "inner join WorkloadData workloadData on taskData.taskId=workloadData.taskId " + "and taskData.sessionId=workloadData.sessionId " + "where taskData.id in (:ids)) parents " + "on task.taskId=parents.parentId " + "and task.sessionId=parents.sessionId;") .setParameter("ids", taskIds).getResultList(); }
Source:
public void testRememberShapeAfterOrientationChange() { onView(withId(shape)) .perform(click()) .check(matches(isSelected())); onToolBarView() .performCloseToolOptions(); onView(isRoot()) .perform(click()); Bitmap expectedBitmap = PaintroidApplication.drawingSurface.getBitmapCopy(); onTopBarView() .performUndo(); activityTestRule.getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); onView(withId(shape)) .check(matches(isSelected())); onToolBarView() .performCloseToolOptions(); onView(isRoot()) .perform(click()); assertTrue(expectedBitmap.sameAs(PaintroidApplication.drawingSurface.getBitmapCopy())); }

Target:
public void testRememberShapeAfterOrientationChange() { onView(withId(shape)) .perform(click()) .check(matches(isSelected())); onToolBarView() .performCloseToolOptions(); onDrawingSurfaceView() .perform(touchAt(DrawingSurfaceLocationProvider.TOOL_POSITION)); Bitmap expectedBitmap = PaintroidApplication.drawingSurface.getBitmapCopy(); onTopBarView() .performUndo(); activityTestRule.getActivity().setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); onView(withId(shape)) .check(matches(isSelected())); onToolBarView() .performCloseToolOptions(); onDrawingSurfaceView() .perform(touchAt(DrawingSurfaceLocationProvider.TOOL_POSITION)); assertTrue(expectedBitmap.sameAs(PaintroidApplication.drawingSurface.getBitmapCopy())); }
Source:
public void testConfigureButton() throws Exception { final Button button = mock(Button.class); final Button otherButton = mock(Button.class); final Runnable runnable = mock(Runnable.class); tested.configureButton(button, "COLUMNS", true, mock(Tooltip.class), "tooltip", otherButton, runnable); verify(button, times(1)).setType(eq(ButtonType.INFO)); ArgumentCaptor<ClickHandler> clickHandlerArgumentCaptor = ArgumentCaptor.forClass(ClickHandler.class); verify(button, times(1)).addClickHandler(clickHandlerArgumentCaptor.capture()); reset(button); clickHandlerArgumentCaptor.getValue().onClick(mock(ClickEvent.class)); verify(button, times(1)).setType(eq(ButtonType.INFO)); verify(otherButton, times(1)).setType(eq(ButtonType.LINK)); verify(runnable, times(1)).run(); }

Target:
public void testConfigureButton() { final Button button = mock(Button.class); final Button otherButton = mock(Button.class); final Runnable runnable = mock(Runnable.class); tested.configureButton(button, "COLUMNS", true, mock(Tooltip.class), "tooltip", otherButton, runnable); verify(button, times(1)).setType(eq(ButtonType.INFO)); ArgumentCaptor<ClickHandler> clickHandlerArgumentCaptor = ArgumentCaptor.forClass(ClickHandler.class); verify(button, times(1)).addClickHandler(clickHandlerArgumentCaptor.capture()); reset(button); clickHandlerArgumentCaptor.getValue().onClick(mock(ClickEvent.class)); verify(button, times(1)).setType(eq(ButtonType.INFO)); verify(otherButton, times(1)).setType(eq(ButtonType.LINK)); verify(runnable, times(1)).run(); }
Source:
private String getValueForOptionalKey(JSONObject object, String key) throws JSONException { return object.has(key) ? object.getJSONObject(key).optString("value") : ""; }

Target:
private String getValueForOptionalKey(JSONObject object, String key) { return object.has(key) ? object.optJSONObject(key).optString("value") : ""; }
Source:
public ResponseEntity<?> updateTicketType(@PathVariable Long typeId, @RequestBody @Validated TicketType type) { TicketType ticketType = ticketService.updateTicketType(typeId, type); if (ticketType == null) { return createResponseEntity(HttpStatus.BAD_REQUEST, "TicketType not found!"); } else { return createResponseEntity(HttpStatus.OK, "TicketType successfully updated.", ticketType); } }

Target:
public ResponseEntity<?> updateTicketType(@PathVariable Long typeId, @RequestBody @Validated TicketType type) { TicketType ticketType = ticketService.updateTicketType(typeId, type); return createResponseEntity(HttpStatus.OK, "TicketType successfully updated.", ticketType); }
Source:
private void cacheGraph() { Timer timer = Timer.getAndStart(); buckets = new ArrayList<SortedSet<SequenceSegment>>(); for (int index = 0; index < numberBuckets; index++) { @SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops") TreeSet<SequenceSegment> newSegments = new TreeSet<SequenceSegment>(); buckets.add(index, newSegments); } for (SequenceSegment vertex : graph.getAllVertices()) { cacheVertex(vertex); } timer.stopAndLog("Graph caching"); }

Target:
private void cacheGraph() { Timer timer = Timer.getAndStart(); buckets = new ArrayList<Bucket>(); for (int index = 0; index < numberBuckets; index++) { @SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops") Bucket bucket = new Bucket(); buckets.add(index, bucket); } for (SequenceSegment vertex : graph.getAllVertices()) { cacheVertex(vertex); } timer.stopAndLog("Graph caching"); }
Source:
public void initScm(@CommandLine.Option(names = { "--clusterid" }, description = "Optional: The cluster id to use when formatting SCM", paramLabel = "id") String clusterId) throws Exception { commonInit(); boolean result = receiver.init(conf, clusterId); if (!result) { throw new IOException("SCM Init failed. Check the log for more details"); } }

Target:
public void initScm(@CommandLine.Option(names = { "--clusterid" }, description = "Optional: The cluster id to use when formatting SCM", paramLabel = "id") String clusterId) throws Exception { commonInit(); boolean result = receiver.init(conf, clusterId); if (!result) { throw new IOException("scm init failed"); } }
Source:
public void postConstruct() { super.postConstruct(); String sqlUrl = getConfig(DB_SETUP_SQL_URL); if ("".equals(sqlUrl)) sqlUrl = null; MySqlNode mysql = (MySqlNode) addChild( getManagementSupport().getManagementContext(true).getEntityManager().createEntity( BasicEntitySpec.newInstance(MySqlNode.class) .configure("creationScriptUrl", sqlUrl)) ); ControlledDynamicWebAppCluster web = (ControlledDynamicWebAppCluster) addChild( getManagementSupport().getManagementContext(true).getEntityManager().createEntity( BasicEntitySpec.newInstance(ControlledDynamicWebAppCluster.class) .configure(WebAppService.HTTP_PORT, PortRanges.fromString("8080+")) .configure(JavaWebAppService.ROOT_WAR, getConfig(WAR_PATH)) .configure(JavaEntityMethods.javaSysProp("brooklyn.example.db.url"), formatString("jdbc:%s%s?user=%s\\&password=%s", attributeWhenReady(mysql, MySqlNode.MYSQL_URL), DB_TABLE, DB_USERNAME, DB_PASSWORD)) .configure(DynamicCluster.INITIAL_SIZE, 2) .configure(WebAppService.ENABLED_PROTOCOLS, Arrays.asList(getConfig(USE_HTTPS) ? "https" : "http")) )); web.getCluster().addPolicy(AutoScalerPolicy.builder(). metric(DynamicWebAppCluster.REQUESTS_PER_SECOND_IN_WINDOW_PER_NODE). metricRange(10, 100). sizeRange(2, 5). build()); addEnricher(SensorPropagatingEnricher.newInstanceListeningTo(web, WebAppServiceConstants.ROOT_URL, DynamicWebAppCluster.REQUESTS_PER_SECOND_IN_WINDOW)); addEnricher(new SensorTransformingEnricher<Integer,Integer>(web, DynamicWebAppCluster.GROUP_SIZE, APPSERVERS_COUNT, Functions.<Integer>identity())); }

Target:
public void postConstruct() { super.postConstruct(); String sqlUrl = getConfig(DB_SETUP_SQL_URL); if ("".equals(sqlUrl)) sqlUrl = null; MySqlNode mysql = (MySqlNode) addChild( getEntityManager().createEntity( BasicEntitySpec.newInstance(MySqlNode.class) .configure("creationScriptUrl", sqlUrl)) ); ControlledDynamicWebAppCluster web = (ControlledDynamicWebAppCluster) addChild( getEntityManager().createEntity( BasicEntitySpec.newInstance(ControlledDynamicWebAppCluster.class) .configure(WebAppService.HTTP_PORT, PortRanges.fromString("8080+")) .configure(JavaWebAppService.ROOT_WAR, getConfig(WAR_PATH)) .configure(JavaEntityMethods.javaSysProp("brooklyn.example.db.url"), formatString("jdbc:%s%s?user=%s\\&password=%s", attributeWhenReady(mysql, MySqlNode.MYSQL_URL), DB_TABLE, DB_USERNAME, DB_PASSWORD)) .configure(DynamicCluster.INITIAL_SIZE, 2) .configure(WebAppService.ENABLED_PROTOCOLS, Arrays.asList(getConfig(USE_HTTPS) ? "https" : "http")) )); web.getCluster().addPolicy(AutoScalerPolicy.builder(). metric(DynamicWebAppCluster.REQUESTS_PER_SECOND_IN_WINDOW_PER_NODE). metricRange(10, 100). sizeRange(2, 5). build()); addEnricher(SensorPropagatingEnricher.newInstanceListeningTo(web, WebAppServiceConstants.ROOT_URL, DynamicWebAppCluster.REQUESTS_PER_SECOND_IN_WINDOW)); addEnricher(new SensorTransformingEnricher<Integer,Integer>(web, DynamicWebAppCluster.GROUP_SIZE, APPSERVERS_COUNT, Functions.<Integer>identity())); }
Source:
public void dispose() { if (disposables != null && !disposables.isDisposed()) { disposables.clear(); } }

Target:
public void dispose() { disposables.clear(); }
Source:
@Override public SCMNavigator newInstance(String name) { return null; }

Target:
public SCMNavigator newInstance(String name) { return null; }
Source:
private @Nullable T getValue() { if (!isValid) return null; if (resolved != null) return resolved.get(); if (supplier != null) { resolved = new AtomicReference<>(null); T temp = supplier.get(); if (temp == null) { throw new NullPointerException("Supplier should not return null value"); } resolved.set(temp); return resolved.get(); } return null; }

Target:
private @Nullable T getValue() { if (!isValid) return null; if (resolved != null) return resolved.get(); if (supplier != null) { resolved = new AtomicReference<>(null); T temp = supplier.get(); if (temp == null) { LOGGER.catching(Level.WARN, new NullPointerException("Supplier should not return null value")); return null; } resolved.set(temp); return resolved.get(); } return null; }
Source:
public List<String> getStrings() { if (null == strings) { synchronized (this) { if (null == this.strings) { strings = new ArrayList<>(); strings.add("Hello"); System.out.println(); strings.add("World"); } } } return strings; }

Target:
public List<String> getStrings() { if (strings == null) { synchronized (this) { if (strings == null) { strings = new ArrayList<>(); strings.add("Hello"); strings.add("World"); } } } return strings; }
Source:
public void testBug535308b() { Map options = getCompilerOptions(); options.put(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.ERROR); runNegativeTest( new String[] { "X.java", "public class X {\n" + " public int someTest() {\n" + " boolean unused = false;\n" + " final boolean thisIsFalse = false;\n" + " if (getSomeValue() == thisIsFalse) {\n" + " return 0;\n" + " }\n" + " return 1;\n" + " }\n" + "\n" + " private boolean getSomeValue() {\n" + " return true;\n" + " }\n" + "}" }, "----------\n" + "1. ERROR in X.java (at line 3)\n" + " boolean unused = false;\n" + " ^^^^^^\n" + "The value of the local variable unused is not used\n" + "----------\n", this.LIBS, true , options); }

Target:
public void testBug535308b() { Map options = getCompilerOptions(); options.put(JavaCore.COMPILER_PB_UNUSED_LOCAL, JavaCore.ERROR); runNegativeTest( new String[] { "X.java", "public class X {\n" + " public int someTest() {\n" + " boolean unused = false;\n" + " final boolean thisIsFalse = false;\n" + " if (getSomeValue() != thisIsFalse) {\n" + " return 0;\n" + " }\n" + " return 1;\n" + " }\n" + "\n" + " private boolean getSomeValue() {\n" + " return true;\n" + " }\n" + "}" }, "----------\n" + "1. ERROR in X.java (at line 3)\n" + " boolean unused = false;\n" + " ^^^^^^\n" + "The value of the local variable unused is not used\n" + "----------\n", this.LIBS, true , options); }
Source:
private boolean endCallback(Guid cmdId, CommandCallback callback, CommandStatus status) { try { if (status == CommandStatus.FAILED) { callback.onFailed(cmdId, getChildCommandIds(cmdId)); } else { callback.onSucceeded(cmdId, getChildCommandIds(cmdId)); } } catch (Exception ex) { if (callback.repeatEndMethodsOnFail(cmdId)) { log.error("Failed invoking callback end method '{}' for command '{}' with exception '{}', the callback" + " is marked for end method retries", getCallbackMethod(status), cmdId, ex.getMessage()); return true; } else { log.error("Failed invoking callback end method '{}' for command '{}' with exception '{}'", getCallbackMethod(status), cmdId, ex.getMessage()); } } return false; }

Target:
private boolean endCallback(Guid cmdId, CommandCallback callback, CommandStatus status) { try { if (status == CommandStatus.FAILED) { callback.onFailed(cmdId, getChildCommandIds(cmdId)); } else { callback.onSucceeded(cmdId, getChildCommandIds(cmdId)); } } catch (Exception ex) { if (callback.repeatEndMethodsOnFail(cmdId)) { log.error("Failed invoking callback end method '{}' for command '{}' with exception '{}', the callback" + " is marked for end method retries", getCallbackMethod(status), cmdId, ex.getMessage()); log.debug(ex.getStackTrace().toString()); return true; } else { log.error("Failed invoking callback end method '{}' for command '{}' with exception '{}'", getCallbackMethod(status), cmdId, ex.getMessage()); log.debug(ex.getStackTrace().toString()); } } return false; }
Source:
private void updateSaltComponent(Stack stack) throws IOException { ClusterComponent saltComponent = clusterComponentProvider.getComponent(stack.getCluster().getId(), ComponentType.SALT_STATE); byte[] stateConfigZip = hostOrchestrator.getStateConfigZip(); if (saltComponent == null) { saltComponent = new ClusterComponent(ComponentType.SALT_STATE, new Json(singletonMap(ComponentType.SALT_STATE.name(), Base64.encodeBase64String(stateConfigZip))), stack.getCluster()); } else { saltComponent.setAttributes(new Json(singletonMap(ComponentType.SALT_STATE.name(), Base64.encodeBase64String(stateConfigZip)))); } clusterComponentProvider.store(saltComponent); }

Target:
private void updateSaltComponent(Stack stack) { ClusterComponent saltComponent = clusterComponentProvider.getComponent(stack.getCluster().getId(), ComponentType.SALT_STATE); try { byte[] stateConfigZip = hostOrchestrator.getStateConfigZip(); if (saltComponent == null) { saltComponent = createSaltComponent(stack, stateConfigZip); } else { saltComponent.setAttributes(new Json(singletonMap(ComponentType.SALT_STATE.name(), Base64.encodeBase64String(stateConfigZip)))); } clusterComponentProvider.store(saltComponent); } catch (IOException e) { throw new CloudbreakServiceException(e); } }
Source:
GanttCSVExport(TaskManager taskManager, HumanResourceManager resourceManager, RoleManager roleManager, CSVOptions csvOptions) { myTaskManager = Preconditions.checkNotNull(taskManager); myTaskCustomPropertyManager = Preconditions.checkNotNull(taskManager.getCustomPropertyManager()); myHumanResourceManager = Preconditions.checkNotNull(resourceManager); myHumanResourceCustomPropertyManager = Preconditions.checkNotNull(resourceManager.getCustomPropertyManager()); myRoleManager = Preconditions.checkNotNull(roleManager); this.csvOptions = csvOptions; }

Target:
GanttCSVExport(TaskManager taskManager, HumanResourceManager resourceManager, RoleManager roleManager, CSVOptions csvOptions) { myTaskManager = Preconditions.checkNotNull(taskManager); myTaskCustomPropertyManager = Preconditions.checkNotNull(taskManager.getCustomPropertyManager()); myHumanResourceManager = Preconditions.checkNotNull(resourceManager); myHumanResourceCustomPropertyManager = Preconditions.checkNotNull(resourceManager.getCustomPropertyManager()); myRoleManager = Preconditions.checkNotNull(roleManager); myCsvOptions = Preconditions.checkNotNull(csvOptions); }
Source:
public void testIntentToLoginActivity() { ActivityScenario activityScenario = ActivityScenario.launch(SplashScreenActivity.class); if (!PrefManager.isAuthenticated()) { onView(withId(R.id.login_layout)).check(matches(isDisplayed())); } }

Target:
public void testIntentToLoginActivity() { if (!PrefManager.isAuthenticated()) { onView(withId(R.id.login_layout)).check(matches(isDisplayed())); } }
Source:
private String startRequest(Request req) { List<RequestInterceptor> interceptors = getInterceptors(false); for (RequestInterceptor requestInterceptor : interceptors) { if (requestInterceptor != null) { try { requestInterceptor.onStart(req.getRequestId(), null); } catch (RequestInterruptionException e) { String message = "Request stopped from starting by exception from the interceptor ("+requestInterceptor+"): " + e.getMessage(); log.warn(message); throw new RequestInterruptionException(message, e); } catch (Exception e) { log.warn("Request interceptor ("+requestInterceptor+") failed to execute on start ("+req.getRequestId()+"): " + e.getMessage()); } } } requests.setCurrent(req); return req.getRequestId(); }

Target:
private String startRequest(Request req) { List<RequestInterceptor> interceptors = getInterceptors(false); for (RequestInterceptor requestInterceptor : interceptors) { if (requestInterceptor != null) { try { requestInterceptor.onStart(req.getRequestId()); } catch (RequestInterruptionException e) { String message = "Request stopped from starting by exception from the interceptor ("+requestInterceptor+"): " + e.getMessage(); log.warn(message); throw new RequestInterruptionException(message, e); } catch (Exception e) { log.warn("Request interceptor ("+requestInterceptor+") failed to execute on start ("+req.getRequestId()+"): " + e.getMessage()); } } } requests.setCurrent(req); return req.getRequestId(); }
Source:
public void execute(FrontendPluginFactory factory) throws InstallationException { ProxyConfig proxyConfig = MojoUtils.getProxyConfig(session, decrypter); String nodeDownloadRoot = getNodeDownloadRoot(); String npmDownloadRoot = getNpmDownloadRoot(); if(serverId != null && !"".equals(serverId)) { Server server = MojoUtils.decryptServer(serverId, session, decrypter); factory.getNodeAndNPMInstaller(proxyConfig).install(nodeVersion, npmVersion, nodeDownloadRoot, npmDownloadRoot, server.getUsername(), server.getPassword()); } else { factory.getNodeAndNPMInstaller(proxyConfig).install(nodeVersion, npmVersion, nodeDownloadRoot, npmDownloadRoot, null, null); } }

Target:
public void execute(FrontendPluginFactory factory) throws InstallationException { ProxyConfig proxyConfig = MojoUtils.getProxyConfig(session, decrypter); String nodeDownloadRoot = getNodeDownloadRoot(); String npmDownloadRoot = getNpmDownloadRoot(); Server server = MojoUtils.decryptServer(serverId, session, decrypter); if (null != server) { factory.getNodeAndNPMInstaller(proxyConfig) .setNodeVersion(nodeVersion) .setNodeDownloadRoot(nodeDownloadRoot) .setNpmVersion(npmVersion) .setNpmDownloadRoot(npmDownloadRoot) .setUserName(server.getUsername()) .setPassword(server.getPassword()) .install(); } else { factory.getNodeAndNPMInstaller(proxyConfig) .setNodeVersion(nodeVersion) .setNodeDownloadRoot(nodeDownloadRoot) .setNpmVersion(npmVersion) .setNpmDownloadRoot(npmDownloadRoot) .install(); } }
Source:
public boolean equals(CohortMembership otherCohortMembership) { if(this == otherCohortMembership) return true; return otherCohortMembership != null && this.endDate.equals(otherCohortMembership.getEndDate()) && this.startDate.equals(otherCohortMembership.getStartDate()) && this.patientId.equals(otherCohortMembership.getPatientId()); }

Target:
public boolean equals(CohortMembership otherCohortMembership) { if(this == otherCohortMembership) return true; return otherCohortMembership != null && ((endDate != null ) ? endDate.equals(otherCohortMembership.getEndDate()) : otherCohortMembership.getEndDate() == null) && ((startDate !=null) ? startDate.equals(otherCohortMembership.getStartDate()) : otherCohortMembership.getStartDate() == null) && ((patientId != null) ? patientId.equals(otherCohortMembership.getPatientId()) : otherCohortMembership.getPatientId() == null); }