auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void parseAmazonS3URI(String s3Uri) { AmazonS3URI amazonS3URI = new AmazonS3URI(s3Uri); if ((scheme = amazonS3URI.getURI().getScheme()) == null) { throw new IllegalArgumentException("You have to specify a valid scheme in the provided s3 uri. Empty value is not allowed."); } if ((host = amazonS3URI.getURI().getHost()) == null) { throw new IllegalArgumentException("You have to specify a valid host in the provided s3 uri. Empty value is not allowed."); } if ((bucketName = amazonS3URI.getBucket()) == null) { throw new IllegalArgumentException("You have to specify a valid bucket name in the provided s3 uri. Empty value is not allowed."); } if ((keyName = amazonS3URI.getKey()) == null) { throw new IllegalArgumentException("You have to specify a valid key name in the provided s3 uri. Empty value is not allowed."); } }

Target:
private void parseAmazonS3URI(String s3Uri) { AmazonS3URI amazonS3URI = new AmazonS3URI(s3Uri); if ((scheme = amazonS3URI.getURI().getScheme()) == null) { throw new IllegalArgumentException("You have to specify a valid scheme in the provided s3 uri. Empty value is not allowed."); } if ((host = amazonS3URI.getURI().getHost()) == null) { throw new IllegalArgumentException("You have to specify a valid host in the provided s3 uri. Empty value is not allowed."); } if ((bucketName = amazonS3URI.getBucket()) == null) { throw new IllegalArgumentException("You have to specify a valid bucket name in the provided s3 uri. Empty value is not allowed."); } if ((s3RemoteRelativePath = amazonS3URI.getKey()) == null) { throw new IllegalArgumentException("You have to specify a valid key name in the provided s3 uri. Empty value is not allowed."); } }
Source:
public boolean encode(InputStream data, OutputStream os) { byte[] buffer = ByteArrayPool.get().getBytes(); try { int read; while ((read = data.read(buffer)) != -1) { os.write(buffer, 0, read); } return true; } catch (IOException e) { if (Log.isLoggable(TAG, Log.ERROR)) { Log.v(TAG, "Failed to encode data onto the OutputStream", e); } return false; } finally { ByteArrayPool.get().releaseBytes(buffer); } }

Target:
public boolean encode(InputStream data, OutputStream os) { byte[] buffer = ByteArrayPool.get().getBytes(); try { int read; while ((read = data.read(buffer)) != -1) { os.write(buffer, 0, read); } return true; } catch (IOException e) { if (Log.isLoggable(TAG, Log.WARN)) { Log.w(TAG, "Failed to encode data onto the OutputStream", e); } return false; } finally { ByteArrayPool.get().releaseBytes(buffer); } }
Source:
public void refresh(){ ArrayList<Date> dateList = new ArrayList<>(); Calendar populator = (Calendar) myCal.clone(); int totalDays = populator.getActualMaximum(Calendar.DAY_OF_MONTH); populator.set(Calendar.DAY_OF_MONTH, 1); int monthStartWeekDay = populator.get(Calendar.DAY_OF_WEEK) - 1; totalDays += monthStartWeekDay; populator.add(Calendar.DAY_OF_MONTH, -monthStartWeekDay); while(dateList.size() < totalDays){ dateList.add(populator.getTime()); populator.add(Calendar.DAY_OF_MONTH, 1); } int remainingDays = (8-populator.get(Calendar.DAY_OF_WEEK))%7; for(int i = 0; i < remainingDays; i ++){ dateList.add(populator.getTime()); populator.add(Calendar.DAY_OF_MONTH, 1); } myYear.setText(String.valueOf(myCal.get(Calendar.YEAR))); myMonth.setText(myCal.getDisplayName(Calendar.MONTH, Calendar.SHORT, Locale.getDefault())); myGrid.setAdapter(new CalendarAdapter(getContext(), dateList)); }

Target:
public void refresh(){ ArrayList<Date> dateList = new ArrayList<>(); Calendar populator = (Calendar) calendar.clone(); int totalDays = getNumDaysInMonth(populator); populateListOfDates(dateList, populator, totalDays); yearSpinner.setSelection(calendar.get(Calendar.YEAR)-GregorianDateWidget.MINYEAR); monthSpinner.setSelection(calendar.get(Calendar.MONTH)); calendarGrid.setAdapter(new CalendarAdapter(getContext(), dateList)); }
Source:
protected void init(final ImmutableMap<String, Object> execEnvVars) throws DbException { Preconditions.checkNotNull(emitExpressions); Schema inputSchema = Objects.requireNonNull(getChild().getSchema()); ImmutableList.Builder<GenericEvaluator> evalBuilder = ImmutableList.builder(); final ExpressionOperatorParameter parameters = new ExpressionOperatorParameter(inputSchema, getNodeID()); for (Expression expr : emitExpressions) { GenericEvaluator evaluator; if (expr.isConstant()) { evaluator = new ConstantEvaluator(expr, parameters); } else { evaluator = new GenericEvaluator(expr, parameters); } if (evaluator.needsCompiling()) { evaluator.compile(); } Preconditions.checkArgument(!evaluator.needsState()); evalBuilder.add(evaluator); } emitEvaluators = evalBuilder.build(); outputBuffer = new TupleBatchBuffer(getSchema()); }

Target:
protected void init(final ImmutableMap<String, Object> execEnvVars) throws DbException { Preconditions.checkNotNull(emitExpressions); Schema inputSchema = Objects.requireNonNull(getChild().getSchema()); List<GenericEvaluator> evals = new ArrayList<>(); final ExpressionOperatorParameter parameters = new ExpressionOperatorParameter(inputSchema, getNodeID()); for (Expression expr : emitExpressions) { GenericEvaluator evaluator; if (expr.isConstant()) { evaluator = new ConstantEvaluator(expr, parameters); } else { evaluator = new GenericEvaluator(expr, parameters); } if (evaluator.needsCompiling()) { evaluator.compile(); } Preconditions.checkArgument(!evaluator.needsState()); evals.add(evaluator); } setEmitEvaluators(evals); outputBuffer = new TupleBatchBuffer(getSchema()); }
Source:
private ToolSection findParentSection(Collection<EObject> selection) { if(selection.size()<=1){ return null; } ToolSection toolsection = null; for (EObject tool : selection) { if (!(tool instanceof AbstractToolDescription) || !(tool.eContainer() instanceof ToolSection)) { return null; } if(toolsection==null){ toolsection = (ToolSection) tool.eContainer(); } if (toolsection!= tool.eContainer()) { return null; } } return toolsection; }

Target:
private ToolSection findParentSection(Collection<EObject> selection) { for (EObject tool : selection) { if ((tool.eContainer() instanceof ToolSection)) { return (ToolSection) tool.eContainer(); } } return null; }
Source:
public int getNumOfLanguages() { List<WebElement> languagesList = driver.findElements(languageSelector); return languagesList.size(); }

Target:
public int getNumOfLanguages() { List<WebElement> languagesList = driver.findElements(languageSelectorBy); return languagesList.size(); }
Source:
protected boolean drawArrow(TimeGraphColorScheme colors, ITimeEvent event, Rectangle rect, GC gc) { int colorIdx = fTimeGraphProvider.getStateTableIndex(event); if (colorIdx < 0 && colorIdx != ITimeGraphPresentationProvider.TRANSPARENT) { return false; } boolean visible = ((rect.height == 0) && (rect.width == 0)) ? false : true; if (visible) { if (colorIdx == ITimeGraphPresentationProvider.TRANSPARENT) { return false; } Color stateColor = null; if (colorIdx < fEventColorMap.length) { stateColor = fEventColorMap[colorIdx]; } else { stateColor = Display.getDefault().getSystemColor(SWT.COLOR_BLACK); } gc.setForeground(stateColor); gc.setBackground(stateColor); gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y + rect.height); drawArrowHead(rect.x, rect.y, rect.x + rect.width, rect.y + rect.height, gc); } fTimeGraphProvider.postDrawEvent(event, rect, gc); return visible; }

Target:
protected boolean drawArrow(TimeGraphColorScheme colors, ITimeEvent event, Rectangle rect, GC gc) { int colorIdx = fTimeGraphProvider.getStateTableIndex(event); if (colorIdx < 0) { return false; } boolean visible = ((rect.height == 0) && (rect.width == 0)) ? false : true; if (visible) { if (colorIdx == ITimeGraphPresentationProvider.TRANSPARENT) { return false; } Color stateColor = null; if (colorIdx < fEventColorMap.length) { stateColor = fEventColorMap[colorIdx]; } else { stateColor = Display.getDefault().getSystemColor(SWT.COLOR_BLACK); } gc.setForeground(stateColor); gc.setBackground(stateColor); gc.drawLine(rect.x, rect.y, rect.x + rect.width, rect.y + rect.height); drawArrowHead(rect.x, rect.y, rect.x + rect.width, rect.y + rect.height, gc); } fTimeGraphProvider.postDrawEvent(event, rect, gc); return visible; }
Source:
public EventHubDisasterRecoveryPairingImpl withNewPrimaryNamespace( Creatable<EventHubNamespace> namespaceCreatable) { this.addDependency(namespaceCreatable); if (namespaceCreatable instanceof EventHubNamespaceImpl) { EventHubNamespaceImpl namespace = ((EventHubNamespaceImpl) namespaceCreatable); this.ancestor = new Ancestors().new OneAncestor(namespace.resourceGroupName(), namespaceCreatable.name()); } return this; }

Target:
public EventHubDisasterRecoveryPairingImpl withNewPrimaryNamespace( Creatable<EventHubNamespace> namespaceCreatable) { this.addDependency(namespaceCreatable); if (namespaceCreatable instanceof EventHubNamespaceImpl) { EventHubNamespaceImpl namespace = ((EventHubNamespaceImpl) namespaceCreatable); this.ancestor = new Ancestors().new OneAncestor(namespace.resourceGroupName(), namespaceCreatable.name()); } else { logger.logExceptionAsError(new IllegalArgumentException("The namespaceCreatable is invalid.")); } return this; }
Source:
public String render(T size) { if (size == null || size.longValue() == 0) { return "NA"; } long sizeInGB = -1; switch (unit) { case BYTE: sizeInGB = (long) (size.longValue() / Math.pow(1024, 3)); break; case GIGABYTE: sizeInGB = size.longValue(); break; } return sizeInGB >= 1 ? sizeInGB + " GB" : "< 1 GB"; }

Target:
public String render(T size) { if (size == null || size.longValue() == 0) { return CONSTANTS.unAvailablePropertyLabel(); } long sizeInGB = -1; switch (unit) { case BYTE: sizeInGB = (long) (size.longValue() / Math.pow(1024, 3)); break; case GIGABYTE: sizeInGB = size.longValue(); break; } return sizeInGB >= 1 ? sizeInGB + " GB" : "< 1 GB"; }
Source:
private void createTimer(Rule rule, TimerTrigger trigger) throws SchedulerException { synchronized (rule) { } String cronExpression = trigger.getCron(); if (trigger.getTime() != null) { if (trigger.getTime().equals("noon")) { cronExpression = "0 0 12 * * ?"; } else if (trigger.getTime().equals("midnight")) { cronExpression = "0 0 0 * * ?"; } else { logger.warn("Unrecognized time expression '{}' in rule '{}'", trigger.getTime(), rule.getName()); return; } } String jobIdentity = getJobIdentityString(rule, trigger); try { JobDetail job = newJob(ExecuteRuleJob.class) .usingJobData(ExecuteRuleJob.JOB_DATA_RULEMODEL, rule.eResource().getURI().path()) .usingJobData(ExecuteRuleJob.JOB_DATA_RULENAME, rule.getName()).withIdentity(jobIdentity).build(); Trigger quartzTrigger = newTrigger().withSchedule(CronScheduleBuilder.cronSchedule(cronExpression)).build(); scheduler.scheduleJob(job, Collections.singleton(quartzTrigger), true); logger.debug("Scheduled rule '{}' with cron expression '{}'", rule.getName(), cronExpression); } catch (RuntimeException e) { throw new SchedulerException(e.getMessage()); } }

Target:
private void createTimer(Rule rule, TimerTrigger trigger) throws SchedulerException { String cronExpression = trigger.getCron(); if (trigger.getTime() != null) { if (trigger.getTime().equals("noon")) { cronExpression = "0 0 12 * * ?"; } else if (trigger.getTime().equals("midnight")) { cronExpression = "0 0 0 * * ?"; } else { logger.warn("Unrecognized time expression '{}' in rule '{}'", trigger.getTime(), rule.getName()); return; } } String jobIdentity = getJobIdentityString(rule, trigger); try { JobDetail job = newJob(ExecuteRuleJob.class) .usingJobData(ExecuteRuleJob.JOB_DATA_RULEMODEL, rule.eResource().getURI().path()) .usingJobData(ExecuteRuleJob.JOB_DATA_RULENAME, rule.getName()).withIdentity(jobIdentity).build(); Trigger quartzTrigger = newTrigger().withSchedule(CronScheduleBuilder.cronSchedule(cronExpression)).build(); scheduler.scheduleJob(job, Collections.singleton(quartzTrigger), true); logger.debug("Scheduled rule '{}' with cron expression '{}'", rule.getName(), cronExpression); } catch (RuntimeException e) { throw new SchedulerException(e.getMessage()); } }
Source:
public GrantedAuthority[] getAuthorities() { String[] roles = this.roles; if(roles == null){ return new GrantedAuthority[]{SecurityRealm.AUTHENTICATED_AUTHORITY}; } String authenticatedRole = SecurityRealm.AUTHENTICATED_AUTHORITY.getAuthority(); List<GrantedAuthority> grantedAuthorities = new ArrayList<>(); for (int i = 0; i < roles.length; i++){ if(!authenticatedRole.equals(roles[i])){ grantedAuthorities.add(new GrantedAuthorityImpl(roles[i])); } } return grantedAuthorities.toArray(new GrantedAuthority[grantedAuthorities.size()]); }

Target:
public GrantedAuthority[] getAuthorities() { String[] roles = this.roles; if(roles == null){ return new GrantedAuthority[]{SecurityRealm.AUTHENTICATED_AUTHORITY}; } String authenticatedRole = SecurityRealm.AUTHENTICATED_AUTHORITY.getAuthority(); List<GrantedAuthority> grantedAuthorities = new ArrayList<>(roles.length + 1); grantedAuthorities.add(new GrantedAuthorityImpl(authenticatedRole)); for (int i = 0; i < roles.length; i++){ if(!authenticatedRole.equals(roles[i])){ grantedAuthorities.add(new GrantedAuthorityImpl(roles[i])); } } return grantedAuthorities.toArray(new GrantedAuthority[grantedAuthorities.size()]); }
Source:
private String[] getFactoryClassNamePackageName(Resource resource) { String sourcePath = resource.getSourcePath(); String fileName = sourcePath.substring(sourcePath.lastIndexOf('/') + 1); fileName = fileName.replace(".pmml", ""); String packageName = fileName.toLowerCase(); String factoryClassName = getSanitizedClassName(fileName + "Factory"); return new String[]{factoryClassName, packageName}; }

Target:
private String[] getFactoryClassNamePackageName(Resource resource) { String sourcePath = resource.getSourcePath(); String fileName = sourcePath.substring(sourcePath.lastIndexOf('/') + 1); fileName = fileName.replace(".pmml", ""); String packageName = getSanitizedPackageName(fileName); String factoryClassName = getSanitizedClassName(fileName + "Factory"); return new String[]{factoryClassName, packageName}; }
Source:
public ElideResponse get(String path, MultivaluedMap<String, String> queryParams, User opaqueUser, String apiVersion) { return handleRequest(true, opaqueUser, dataStore::beginReadTransaction, (tx, user) -> { JsonApiDocument jsonApiDoc = new JsonApiDocument(); RequestScope requestScope = new RequestScope(path, apiVersion, jsonApiDoc, tx, user, queryParams, elideSettings); requestScope.setEntityProjection(new EntityProjectionMaker(elideSettings.getDictionary(), requestScope).parsePath(path)); BaseVisitor visitor = new GetVisitor(requestScope); Optional<MultivaluedMap<String, String>> queryParamsOptional = requestScope.getQueryParams(); String apiQuery; if (!queryParamsOptional.isPresent()) { apiQuery = path; } else { apiQuery = path + '?'; Iterator<String> it = queryParams.keySet().iterator(); while (it.hasNext()) { String key = (String) it.next(); List<String> value = queryParams.get(key); for (String v : value) { apiQuery += key + "=" + v; } if (it.hasNext()) { apiQuery += '&'; } } } if (requestScope.getElideSettings() != null) { QueryLogger ql = requestScope.getElideSettings().getQueryLogger(); if (opaqueUser == null) { ql.acceptQuery(UUID.fromString(requestScope.getRequestId()), null, requestScope.getHeaders(), requestScope.getApiVersion(), apiQuery); } else { ql.acceptQuery(UUID.fromString(requestScope.getRequestId()), opaqueUser.getPrincipal(), requestScope.getHeaders(), requestScope.getApiVersion(), apiQuery); } } return visit(path, requestScope, visitor); }); }

Target:
public ElideResponse get(String path, MultivaluedMap<String, String> queryParams, User opaqueUser, String apiVersion) { return handleRequest(true, opaqueUser, dataStore::beginReadTransaction, (tx, user) -> { JsonApiDocument jsonApiDoc = new JsonApiDocument(); RequestScope requestScope = new RequestScope(path, apiVersion, jsonApiDoc, tx, user, queryParams, elideSettings); requestScope.setEntityProjection(new EntityProjectionMaker(elideSettings.getDictionary(), requestScope).parsePath(path)); BaseVisitor visitor = new GetVisitor(requestScope); elideAcceptQuery(requestScope, opaqueUser, requestScope.getQueryParams(), path); return visit(path, requestScope, visitor); }); }
Source:
public IndexTask( @JsonProperty("id") String id, @JsonProperty("resource") TaskResource taskResource, @JsonProperty("spec") IndexIngestionSpec ingestionSchema, @JacksonInject ObjectMapper jsonMapper ) { super( makeId(id, ingestionSchema), String.format("index_%s", makeDataSource(ingestionSchema)), taskResource == null ? new TaskResource(makeId(id, ingestionSchema), 1) : taskResource, makeDataSource(ingestionSchema), makeInterval(ingestionSchema) ); this.ingestionSchema = ingestionSchema; this.jsonMapper = jsonMapper; }

Target:
public IndexTask( @JsonProperty("id") String id, @JsonProperty("resource") TaskResource taskResource, @JsonProperty("spec") IndexIngestionSpec ingestionSchema, @JacksonInject ObjectMapper jsonMapper ) { super( makeId(id, ingestionSchema), taskResource, makeDataSource(ingestionSchema), makeInterval(ingestionSchema) ); this.ingestionSchema = ingestionSchema; this.jsonMapper = jsonMapper; }
Source:
private void insertAnnotations(final File file) throws IOException { Timer timer = Timer.getAndStart(); Sequence reference = this.graph.getSources().iterator().next() .getSources().iterator().next(); annotations = ResistanceAnnotationMapper.mapAnnotations(graph, ResistanceAnnotationParser.parseAnnotations(file), reference); timer.stopAndLog("Inserting annotations"); changed = true; repaintPosition(tileController, root, wrapper.hvalueProperty() .doubleValue()); }

Target:
private void insertAnnotations(final File file) throws IOException { Timer timer = Timer.getAndStart(); Sequence reference = this.graph.getSources().iterator().next() .getSources().iterator().next(); annotations = ResistanceAnnotationMapper.mapAnnotations(graph, ResistanceAnnotationParser.parseAnnotations(file), reference); timer.stopAndLog("Inserting annotations"); forceRepaintPosition = true; repaintPosition(root, wrapper.hvalueProperty() .doubleValue()); }
Source:
public Object2IntMap<String> getLaneLimits(int totalLimit) { Object2IntMap<String> onlyLow = new Object2IntArrayMap<>(1); onlyLow.put(LOW, Ints.checkedCast(Math.round(totalLimit * ((double) maxLowPercent / 100)))); return onlyLow; }

Target:
public Object2IntMap<String> getLaneLimits(int totalLimit) { Object2IntMap<String> onlyLow = new Object2IntArrayMap<>(1); onlyLow.put(LOW, Ints.checkedCast((long) Math.ceil(totalLimit * ((double) maxLowPercent / 100)))); return onlyLow; }
Source:
private synchronized void forget( BoltServerAddress address ) { readers.remove( address ); writers.remove( address ); routers.remove( address ); connections.purge( address ); }

Target:
private synchronized void forget( BoltServerAddress address ) { readers.remove( address ); writers.remove( address ); connections.purge( address ); }
Source:
protected VDSParametersBase getRevertVDSParameters() { DeleteImageGroupVDSCommandParameters parameters = new DeleteImageGroupVDSCommandParameters(); parameters.setStoragePoolId(getEnclosingCommand().getParameters().getStoragePoolId()); parameters.setStorageDomainId(getEnclosingCommand().getParameters().getStorageDomainId()); parameters.setImageGroupId(getEnclosingCommand().getParameters().getImageGroupID()); return parameters; }

Target:
protected VDSParametersBase getRevertVDSParameters() { return null; }
Source:
private void updateCurrentPropertiesPresenter(String elementId, LayoutElementWithProperties layoutElement) { LayoutElementPropertiesPresenter presenter = presenterMap.get(elementId); if (presenter == null) { propertiesPresenter = beanManager.lookupBean(LayoutElementPropertiesPresenter.class).newInstance(); propertiesPresenter.edit(layoutElement); presenterMap.put(elementId, propertiesPresenter); } else if (presenter != propertiesPresenter) { propertiesPresenter.getLayoutElement().setSelected(false); propertiesPresenter = presenter; } }

Target:
private void updateCurrentPropertiesPresenter(String elementId, LayoutElementWithProperties layoutElement) { LayoutElementPropertiesPresenter presenter = presenterMap.get(elementId); if (presenter == null) { propertiesPresenter = layoutElementPropertiesPresenterInstance.get(); propertiesPresenter.edit(layoutElement); presenterMap.put(elementId, propertiesPresenter); } else if (presenter != propertiesPresenter) { propertiesPresenter.getLayoutElement().setSelected(false); propertiesPresenter = presenter; } }
Source:
public ExecutionResult execute(Item item) { ProcessType processType = getProcessType(item); if (getProject().getLanguage() != ECodeLanguage.JAVA || processType == null) { return ExecutionResult.NOTHING_TO_DO; } try { IComponentFilter filter = new NameComponentFilter("tFileInputDelimited"); ModifyComponentsAction.searchAndModify(item, processType, filter, Arrays.<IComponentConversion> asList(new IComponentConversion() { @Override public void transform(NodeType node) { EList metadatasList = node.getMetadata(); if(metadatasList == null || metadatasList.size() < 1) { return; } MetadataType metadataType = (MetadataType)metadatasList.get(0); boolean hasDynamic = false; for (Object columnObject : metadataType.getColumn()) { ColumnType columnType = (ColumnType) columnObject; if(columnType.getType().equals("id_Dynamic")) { hasDynamic = true; } } if(!hasDynamic) { return; } ElementParameterType limit = ComponentUtilities.getNodeProperty(node, "LIMIT"); Integer intLimitValue = Integer.parseInt(limit.getValue()); if(intLimitValue > 0) { intLimitValue--; limit.setValue(String.valueOf(intLimitValue)); } } })); return ExecutionResult.SUCCESS_NO_ALERT; } catch (Exception e) { ExceptionHandler.process(e); return ExecutionResult.FAILURE; } }

Target:
public ExecutionResult execute(Item item) { ProcessType processType = getProcessType(item); if (getProject().getLanguage() != ECodeLanguage.JAVA || processType == null) { return ExecutionResult.NOTHING_TO_DO; } try { IComponentFilter filter = new NameComponentFilter("tFileInputDelimited"); ModifyComponentsAction.searchAndModify(item, processType, filter, Arrays.<IComponentConversion> asList(new IComponentConversion() { @Override public void transform(NodeType node) { EList metadatasList = node.getMetadata(); if(metadatasList == null || metadatasList.size() < 1) { return; } MetadataType metadataType = (MetadataType)metadatasList.get(0); boolean hasDynamic = false; for (Object columnObject : metadataType.getColumn()) { ColumnType columnType = (ColumnType) columnObject; if(columnType.getType().equals("id_Dynamic")) { hasDynamic = true; } } if(!hasDynamic) { return; } ElementParameterType limit = ComponentUtilities.getNodeProperty(node, "LIMIT"); try { Integer intLimitValue = Integer.parseInt(limit.getValue()); if(intLimitValue > 0) { intLimitValue--; limit.setValue(String.valueOf(intLimitValue)); } } catch(NumberFormatException e) { String sLimit = limit.getValue(); limit.setValue(sLimit + "-1"); } } })); return ExecutionResult.SUCCESS_NO_ALERT; } catch (Exception e) { ExceptionHandler.process(e); return ExecutionResult.FAILURE; } }
Source:
AsyncQosIoExceptionHandler( ScheduledExecutorService scheduledExecutorService, ExecutorService executorService, BackoffStrategy backoffStrategy) { this.scheduledExecutorService = MoreExecutors.listeningDecorator(scheduledExecutorService); this.executorService = MoreExecutors.listeningDecorator(executorService); this.backoffStrategy = backoffStrategy; }

Target:
AsyncQosIoExceptionHandler( ScheduledExecutorService scheduledExecutorService, ExecutorService executorService, BackoffStrategy backoffStrategy) { Preconditions.checkArgument(scheduledExecutorService != executorService, "Almost certainly you want these to be different - need fixed pool vs cached."); this.scheduledExecutorService = MoreExecutors.listeningDecorator(scheduledExecutorService); this.executorService = MoreExecutors.listeningDecorator(executorService); this.backoffStrategy = backoffStrategy; }
Source:
protected void unregisterSender() { SplitFileInserterSender s; synchronized(this) { s = sender; } if(s != null) s.unregister(context, parent.getPriorityClass()); }

Target:
protected void unregisterSender() { sender.unregister(context, parent.getPriorityClass()); }
Source:
public void loadGlobalProxy() { ContentResolver res = mContext.getContentResolver(); String host = Settings.Global.getString(res, GLOBAL_HTTP_PROXY_HOST); int port = Settings.Global.getInt(res, GLOBAL_HTTP_PROXY_PORT, 0); String exclList = Settings.Global.getString(res, GLOBAL_HTTP_PROXY_EXCLUSION_LIST); String pacFileUrl = Settings.Global.getString(res, GLOBAL_HTTP_PROXY_PAC); if (!TextUtils.isEmpty(host) || !TextUtils.isEmpty(pacFileUrl)) { ProxyInfo proxyProperties; if (!TextUtils.isEmpty(pacFileUrl)) { proxyProperties = new ProxyInfo(pacFileUrl); } else { proxyProperties = new ProxyInfo(host, port, exclList); } if (!proxyProperties.isValid()) { if (DBG) Slog.d(TAG, "Invalid proxy properties, ignoring: " + proxyProperties); return; } synchronized (mProxyLock) { mGlobalProxy = proxyProperties; mPacManager.setCurrentProxyScriptUrl(mGlobalProxy); } } loadDeprecatedGlobalHttpProxy(); }

Target:
public void loadGlobalProxy() { ContentResolver res = mContext.getContentResolver(); String host = Settings.Global.getString(res, GLOBAL_HTTP_PROXY_HOST); int port = Settings.Global.getInt(res, GLOBAL_HTTP_PROXY_PORT, 0); String exclList = Settings.Global.getString(res, GLOBAL_HTTP_PROXY_EXCLUSION_LIST); String pacFileUrl = Settings.Global.getString(res, GLOBAL_HTTP_PROXY_PAC); if (!TextUtils.isEmpty(host) || !TextUtils.isEmpty(pacFileUrl)) { ProxyInfo proxyProperties; if (!TextUtils.isEmpty(pacFileUrl)) { proxyProperties = new ProxyInfo(pacFileUrl); } else { proxyProperties = new ProxyInfo(host, port, exclList); } if (!proxyProperties.isValid()) { if (DBG) Slog.d(TAG, "Invalid proxy properties, ignoring: " + proxyProperties); return; } synchronized (mProxyLock) { mGlobalProxy = proxyProperties; } if (!TextUtils.isEmpty(pacFileUrl)) { mConnectivityServiceHandler.post( () -> mPacManager.setCurrentProxyScriptUrl(proxyProperties)); } } loadDeprecatedGlobalHttpProxy(); }
Source:
public String[] getStepDescriptions() { if (isEnabled(CleanUpConstants.REMOVE_REDUNDANT_MODIFIERS)) { return new String[] {}; } return new String[0]; }

Target:
public String[] getStepDescriptions() { if (isEnabled(CleanUpConstants.REMOVE_REDUNDANT_MODIFIERS)) { return new String[] { MultiFixMessages.RedundantModifiersCleanup_description }; } return new String[0]; }
Source:
public void openFile(File file) { if (file != null && file.exists() && !file.isDirectory()) { String content = FileService.readFromFile(file.getAbsolutePath()); etc.setEditorContent(content); etc.setCurrentFile(file); etc.setModified(false); } }

Target:
public void openFile(File file) { if (file != null && file.isFile()) { String content = FileService.readFromFile(file.getAbsolutePath()); etc.setEditorContent(content); etc.setCurrentFile(file); etc.setModified(false); etc.setPreviewDisplayed(false); } }
Source:
public void handleSetDeviceLifecycleStatusByChannelResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType result, final OsgpException osgpException, final SetDeviceLifecycleStatusByChannelResponseDto responseDto) { LOGGER.info("handleSetDeviceLifecycleStatusByChannelResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); this.setDeviceLifecycleStatusByChannel(responseDto); final String gatewayDeviceIdentification = deviceMessageMetadata.getDeviceIdentification(); final SetDeviceLifecycleStatusByChannelResponseData responseData = this.managementMapper.map(responseDto, SetDeviceLifecycleStatusByChannelResponseData.class); this.webServiceResponseMessageSender.send( ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(gatewayDeviceIdentification).withResult(result) .withOsgpException(osgpException).withDataObject(responseData) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(), deviceMessageMetadata.getMessageType()); }

Target:
public void handleSetDeviceLifecycleStatusByChannelResponse(final DeviceMessageMetadata deviceMessageMetadata, final ResponseMessageResultType result, final OsgpException osgpException, final SetDeviceLifecycleStatusByChannelResponseDto responseDto) { LOGGER.info("handleSetDeviceLifecycleStatusByChannelResponse for MessageType: {}", deviceMessageMetadata.getMessageType()); this.setDeviceLifecycleStatusByChannel(responseDto); final String gatewayDeviceIdentification = deviceMessageMetadata.getDeviceIdentification(); final SetDeviceLifecycleStatusByChannelResponseData responseData = this.managementMapper.map(responseDto, SetDeviceLifecycleStatusByChannelResponseData.class); ResponseMessage responseMessage = ResponseMessage.newResponseMessageBuilder() .withCorrelationUid(deviceMessageMetadata.getCorrelationUid()) .withOrganisationIdentification(deviceMessageMetadata.getOrganisationIdentification()) .withDeviceIdentification(gatewayDeviceIdentification).withResult(result) .withOsgpException(osgpException).withDataObject(responseData) .withMessagePriority(deviceMessageMetadata.getMessagePriority()).build(); this.webServiceResponseMessageSender.send( responseMessage, deviceMessageMetadata.getMessageType()); }
Source:
protected void cleanup(Context hadoopContext) throws IOException, InterruptedException { checkState(mTableContext != null); mTableContext.close(); mTableContext = null; super.cleanup(hadoopContext); }

Target:
protected void cleanup(Context hadoopContext) throws IOException, InterruptedException { Preconditions.checkState(mTableContext != null); mTableContext.close(); mTableContext = null; super.cleanup(hadoopContext); }
Source:
public Executor getExecutor() { if (executor == null) { executor = new PublishExecutor(); } return executor; }

Target:
public Executor getExecutor() { if (executor == null) { executor = new AuthExecutor(); } return executor; }
Source:
boolean snapshotCleanupSwitch(final boolean on, final boolean synchronous) throws IOException; boolean isSnapshotCleanupEnabled() throws IOException; default List<OnlineLogRecord> getSlowLogResponses(final Set<ServerName> serverNames, final LogQueryFilter logQueryFilter) throws IOException { logQueryFilter.setServerNames(serverNames); List<LogEntry> logEntries = getLogEntries(logQueryFilter, 10); return logEntries.stream().map(logEntry -> (OnlineLogRecord) logEntry) .collect(Collectors.toList()); }

Target:
boolean snapshotCleanupSwitch(final boolean on, final boolean synchronous) throws IOException; boolean isSnapshotCleanupEnabled() throws IOException; @Deprecated default List<OnlineLogRecord> getSlowLogResponses(final Set<ServerName> serverNames, final LogQueryFilter logQueryFilter) throws IOException { String logType; if (LogQueryFilter.Type.LARGE_LOG.equals(logQueryFilter.getType())) { logType = "LARGE_LOG"; } else { logType = "SLOW_LOG"; } Map<String, Object> filterParams = new HashMap<>(); filterParams.put("regionName", logQueryFilter.getRegionName()); filterParams.put("clientAddress", logQueryFilter.getClientAddress()); filterParams.put("tableName", logQueryFilter.getTableName()); filterParams.put("userName", logQueryFilter.getUserName()); filterParams.put("filterByOperator", logQueryFilter.getFilterByOperator().toString()); List<LogEntry> logEntries = getLogEntries(serverNames, logType, ServerType.REGION_SERVER, logQueryFilter.getLimit(), filterParams); return logEntries.stream().map(logEntry -> (OnlineLogRecord) logEntry) .collect(Collectors.toList()); }
Source:
private static Collection<String> getClassLoaderUrls(ApplicationContext context) { List<String> urls = new LinkedList<String>(); for (ApplicationContext c = context; c != null; c = c.getParent()) { for (ClassLoader l = c.getClassLoader(); l != null; l = l.getParent()) { if (l instanceof URLClassLoader) { for (URL u : ((URLClassLoader)l).getURLs()) { urls.add(u.toString()); } } else { System.err.println("*** Couldn't get classloader URLs for classloader " + l + ", not an instance of URLClassLoader"); } } } return urls; }

Target:
private static Collection<String> getClassLoaderUrls(ApplicationContext context) { List<String> urls = new LinkedList<String>(); for (ApplicationContext c = context; c != null; c = c.getParent()) { for (ClassLoader l = c.getClassLoader(); l != null; l = l.getParent()) { if (l instanceof URLClassLoader) { for (URL u : ((URLClassLoader)l).getURLs()) { urls.add(u.toString()); } } else { throw new RuntimeException("Couldn't get URLs for classloader " + l + ", not an instance of URLClassLoader. (This shouldn't happen.)"); } } } return urls; }
Source:
public void end(Context ctx) throws Exception { if (objectsToUpdate != null && handlesToDelete != null) { boolean pushCommit = false; for (DSpaceObject iu : objectsToUpdate) { String hdl = iu.getHandle(); if (hdl != null && !handlesToDelete.contains(hdl)) { try { indexer.indexContent(ctx, iu, true); pushCommit = true; log.debug("Indexed " + Constants.typeText[iu.getType()] + ", id=" + String.valueOf(iu.getID()) + ", handle=" + hdl); } catch (Exception e) { log.error("Failed while indexing object: ", e); } } } for (String hdl : handlesToDelete) { try { indexer.unIndexContent(ctx, hdl, false); pushCommit = true; if (log.isDebugEnabled()) { log.debug("UN-Indexed Item, handle=" + hdl); } } catch (Exception e) { log.error("Failed while UN-indexing object: " + hdl, e); } } if(pushCommit) { indexer.commit(doCommit); } } objectsToUpdate = null; handlesToDelete = null; }

Target:
public void end(Context ctx) throws Exception { if (objectsToUpdate != null && handlesToDelete != null) { boolean pushCommit = false; for (DSpaceObject iu : objectsToUpdate) { String hdl = iu.getHandle(); if (hdl != null && !handlesToDelete.contains(hdl)) { try { indexer.indexContent(ctx, iu, true); pushCommit = true; log.debug("Indexed " + Constants.typeText[iu.getType()] + ", id=" + String.valueOf(iu.getID()) + ", handle=" + hdl); } catch (Exception e) { log.error("Failed while indexing object: ", e); } } } for (String hdl : handlesToDelete) { try { indexer.unIndexContent(ctx, hdl, false); pushCommit = true; if (log.isDebugEnabled()) { log.debug("UN-Indexed Item, handle=" + hdl); } } catch (Exception e) { log.error("Failed while UN-indexing object: " + hdl, e); } } if(pushCommit) { indexer.commit(softCommit); } } objectsToUpdate = null; handlesToDelete = null; }
Source:
private void installLdapConnectionPool(String connectionPoolId) { BundleContext bundleContext = getContext(); if (bundleContext != null) { try { Collection<ServiceReference<GenericObjectPool>> serviceReferences = bundleContext.getServiceReferences( GenericObjectPool.class, String.format("(id=%s)", connectionPoolId)); ServiceReference<GenericObjectPool> serviceReference = serviceReferences .stream() .findFirst() .orElseThrow( () -> new IllegalStateException( "No LDAPConnectionPool service found with id:" + connectionPoolId)); ldapConnectionPool = bundleContext.getService(serviceReference); } catch (InvalidSyntaxException | IllegalStateException e) { LOGGER.info("Unable to get LDAP Connection pool. LDAP log in will not be possible.", e); } } }

Target:
private void installLdapConnectionPool(String connectionPoolId) { BundleContext bundleContext = getContext(); if (bundleContext != null) { try { Collection<ServiceReference<GenericObjectPool>> serviceReferences = bundleContext.getServiceReferences( GenericObjectPool.class, String.format("(id=%s)", connectionPoolId)); ServiceReference<GenericObjectPool> serviceReference = serviceReferences .stream() .findFirst() .orElseThrow( () -> new IllegalStateException( "No LDAPConnectionPool service found with id:" + connectionPoolId)); ldapConnectionPool = bundleContext.getService(serviceReference); } catch (InvalidSyntaxException | IllegalStateException e) { LOGGER.error("Unable to get LDAP Connection pool. LDAP log in will not be possible.", e); } } }
Source:
public Object run(Object object) throws Exception { String[] args = Platform.getCommandLineArgs(); String timeoutParameter = getParameterValue(args, "-timeout"); if (timeoutParameter != null) { DumpStackTracesTimer.startStackDumpTimeoutTimer(timeoutParameter); } return Integer.valueOf(OsgiSurefireBooter.run(args)); }

Target:
public Object run(Object object) throws Exception { String[] args = Platform.getCommandLineArgs(); return Integer.valueOf(OsgiSurefireBooter.run(args)); }
Source:
public void testRTrimSetScanKey() throws Exception { String query = "SELECT inst FROM ptsdb WHERE rtrim(inst) = 'abc'"; List<Object> binds = Collections.emptyList(); Scan scan = new Scan(); compileQuery(query, binds, scan); assertTrue(Bytes.compareTo(Bytes.toBytes("abc"), scan.getStartRow()) == 0); assertTrue(Bytes.compareTo(Bytes.toBytes("abc\1"), scan.getStopRow()) == 0); assertTrue(scan.getFilter() != null); }

Target:
public void testRTrimSetScanKey() throws Exception { String query = "SELECT inst FROM ptsdb WHERE rtrim(inst) = 'abc'"; List<Object> binds = Collections.emptyList(); Scan scan = new Scan(); compileQuery(query, binds, scan); assertTrue(Bytes.compareTo(Bytes.toBytes("abc"), scan.getStartRow()) == 0); assertTrue(Bytes.compareTo(Bytes.toBytes("abd"), scan.getStopRow()) == 0); assertTrue(scan.getFilter() != null); }
Source:
protected void onMessageReceived(WorkspaceStatusEvent statusEvent) { final String workspaceId = statusEvent.getWorkspaceId(); switch (statusEvent.getEventType()) { case STARTING: onWorkspaceStarting(workspaceId); break; case RUNNING: onWorkspaceStarted(workspaceId); break; case ERROR: notificationManager.notify(locale.workspaceStartFailed(), FAIL, FLOAT_MODE); loader.setError(LoaderPresenter.Phase.STARTING_WORKSPACE_RUNTIME); final String workspaceName = workspace.getConfig().getName(); final String error = statusEvent.getError(); workspaceServiceClient.getWorkspaces(SKIP_COUNT, MAX_COUNT).then(showErrorDialog(workspaceName, error)); eventBus.fireEvent(new WorkspaceStoppedEvent(workspace)); break; case STOPPING: loader.show(LoaderPresenter.Phase.STOPPING_WORKSPACE); break; case STOPPED: loader.setSuccess(LoaderPresenter.Phase.STOPPING_WORKSPACE); try { eventBus.fireEvent(new WorkspaceStoppedEvent(workspace)); } catch (Exception e) { Log.error(WorkspaceEventsHandler.class, e.getMessage(), e); } startWorkspaceNotification.show(statusEvent.getWorkspaceId()); break; case SNAPSHOT_CREATING: loader.show(LoaderPresenter.Phase.CREATING_WORKSPACE_SNAPSHOT); break; case SNAPSHOT_CREATED: loader.setSuccess(LoaderPresenter.Phase.CREATING_WORKSPACE_SNAPSHOT); snapshotCreator.successfullyCreated(); break; case SNAPSHOT_CREATION_ERROR: loader.setError(LoaderPresenter.Phase.CREATING_WORKSPACE_SNAPSHOT); snapshotCreator.creationError("Snapshot creation error: " + statusEvent.getError()); break; } }

Target:
protected void onMessageReceived(WorkspaceStatusEvent statusEvent) { final String workspaceId = statusEvent.getWorkspaceId(); switch (statusEvent.getEventType()) { case STARTING: onWorkspaceStarting(workspaceId); break; case RUNNING: onWorkspaceStarted(workspaceId); break; case ERROR: notificationManager.notify(locale.workspaceStartFailed(), FAIL, FLOAT_MODE); loader.setError(LoaderPresenter.Phase.STARTING_WORKSPACE_RUNTIME); final String workspaceName = workspace.getConfig().getName(); final String error = statusEvent.getError(); workspaceServiceClient.getWorkspaces(SKIP_COUNT, MAX_COUNT).then(showErrorDialog(workspaceName, error)); eventBus.fireEvent(new WorkspaceStoppedEvent(workspace)); break; case STOPPING: loader.show(LoaderPresenter.Phase.STOPPING_WORKSPACE); break; case STOPPED: loader.setSuccess(LoaderPresenter.Phase.STOPPING_WORKSPACE); startWorkspaceNotification.show(statusEvent.getWorkspaceId()); eventBus.fireEvent(new WorkspaceStoppedEvent(workspace)); break; case SNAPSHOT_CREATING: loader.show(LoaderPresenter.Phase.CREATING_WORKSPACE_SNAPSHOT); break; case SNAPSHOT_CREATED: loader.setSuccess(LoaderPresenter.Phase.CREATING_WORKSPACE_SNAPSHOT); snapshotCreator.successfullyCreated(); break; case SNAPSHOT_CREATION_ERROR: loader.setError(LoaderPresenter.Phase.CREATING_WORKSPACE_SNAPSHOT); snapshotCreator.creationError("Snapshot creation error: " + statusEvent.getError()); break; } }
Source:
protected void verifyCreateConditions( boolean global ) { try { verify( runtimeManager, times( 1 ) ).deployDataSource( dataSourceDef, DeploymentOptions.create() ); } catch ( Exception e ) { } NewDataSourceEvent expectedEvent; if ( global ) { expectedEvent = new NewDataSourceEvent( dataSourceDef, SESSION_ID, IDENTITY ); } else { expectedEvent = new NewDataSourceEvent( dataSourceDef, project, SESSION_ID, IDENTITY ); } verify( newDataSourceEvent, times( 1 ) ).fire( expectedEvent ); }

Target:
protected void verifyCreateConditions( boolean global ) { try { verify( runtimeManager, times( 1 ) ).deployDataSource( dataSourceDef, DeploymentOptions.create() ); } catch ( Exception e ) { fail( e.getMessage() ); } NewDataSourceEvent expectedEvent; if ( global ) { expectedEvent = new NewDataSourceEvent( dataSourceDef, SESSION_ID, IDENTITY ); } else { expectedEvent = new NewDataSourceEvent( dataSourceDef, project, SESSION_ID, IDENTITY ); } verify( newDataSourceEvent, times( 1 ) ).fire( expectedEvent ); }
Source:
public static String getTenantDomain(HttpServletRequest request) { String requestURI = request.getRequestURI(); String domain = MultitenantConstants.SUPER_TENANT_DOMAIN_NAME; if (requestURI != null) { if (!requestURI.contains("/t/")) { HttpSession session = request.getSession(false); if (session != null && session.getAttribute(MultitenantConstants.TENANT_DOMAIN) != null) { domain = (String) session.getAttribute(MultitenantConstants.TENANT_DOMAIN); } } else { String temp = requestURI.substring(requestURI.indexOf("/t/") + 3); if (temp.indexOf('/') != -1) { temp = temp.substring(0, temp.indexOf('/')); domain = temp; } } return domain; } else{ return domain; } }

Target:
public static String getTenantDomain(HttpServletRequest request) { String requestURI = request.getRequestURI(); String domain = MultitenantConstants.SUPER_TENANT_DOMAIN_NAME; if (requestURI == null) { return domain; } if (!requestURI.contains("/t/")) { HttpSession session = request.getSession(false); if (session != null && session.getAttribute(MultitenantConstants.TENANT_DOMAIN) != null) { domain = (String) session.getAttribute(MultitenantConstants.TENANT_DOMAIN); } } else { String temp = requestURI.substring(requestURI.indexOf("/t/") + 3); if (temp.indexOf('/') != -1) { temp = temp.substring(0, temp.indexOf('/')); domain = temp; } } return domain; }
Source:
public void getRenderables (Array<Renderable> renderables, Pool<Renderable> pool) { Renderable r = pool.obtain(); r.worldTransform.idt(); r.meshPart.mesh = mesh; r.meshPart.offset = 0; r.meshPart.size = mesh.getNumIndices(); r.meshPart.primitiveType = GL20.GL_LINES; r.material = material; r.bones = null; r.userData = null; renderables.add(r); }

Target:
public void getRenderables (Array<Renderable> renderables, Pool<Renderable> pool) { renderables.add(renderable); }
Source:
private void updateAmount() { Money amount = Money.zero(); for (Map.Entry<JCheckBox, UUID> m : unitBoxes.entrySet()) { if (m.getKey().isSelected()) { amount = amount.plus(campaign.getUnit(m.getValue()).getSellValue()); } } for (Map.Entry<JSlider, Integer> m : partSliders.entrySet()) { int quantity = m.getKey().getValue(); if(quantity > 0) { amount = amount.plus(campaign.getPart(m.getValue()).getCurrentValue().multipliedBy(quantity)); } } for(int i = 0; i < assetBoxes.size(); i++) { JCheckBox box = assetBoxes.get(i); if(box.isSelected()) { amount = amount.plus(campaign.getFinances().getAllAssets().get(i).getValue()); } } int percent = 0; if (loan.getCollateralAmount().isPositive()) { percent = amount .multipliedBy(100) .dividedBy(loan.getCollateralAmount().getAmount().doubleValue()) .getAmount().intValue(); } if(percent < 100) { btnPay.setEnabled(false); } else { btnPay.setEnabled(true); } barAmount.setValue(percent); barAmount.setString(amount.toAmountString() + "/" + loan.getCollateralAmount().toAmountString()); }

Target:
private void updateAmount() { Money amount = Money.zero(); for (Map.Entry<JCheckBox, UUID> m : unitBoxes.entrySet()) { if (m.getKey().isSelected()) { amount = amount.plus(campaign.getUnit(m.getValue()).getSellValue()); } } for (Map.Entry<JSlider, Integer> m : partSliders.entrySet()) { int quantity = m.getKey().getValue(); if(quantity > 0) { amount = amount.plus(campaign.getPart(m.getValue()).getCurrentValue().multipliedBy(quantity)); } } for(int i = 0; i < assetBoxes.size(); i++) { JCheckBox box = assetBoxes.get(i); if(box.isSelected()) { amount = amount.plus(campaign.getFinances().getAllAssets().get(i).getValue()); } } int percent = 0; if (loan.getCollateralAmount().isPositive()) { percent = amount .multipliedBy(100) .dividedBy(loan.getCollateralAmount()) .getAmount().intValue(); } if(percent < 100) { btnPay.setEnabled(false); } else { btnPay.setEnabled(true); } barAmount.setValue(percent); barAmount.setString(amount.toAmountString() + "/" + loan.getCollateralAmount().toAmountString()); }
Source:
RetryAfterDecoder(DateFormat rfc822Format) { this.rfc822Format = checkNotNull(rfc822Format, "rfc822Format"); }

Target:
RetryAfterDecoder(DateFormat rfc822Format) { this.rfc822Format = Util.checkNotNull(rfc822Format, "rfc822Format"); }
Source:
private List<Artifact> calculateArtifacts(Iterable<GradleDeployDetails> deployDetails) throws Exception { List<Artifact> artifacts = newArrayList(transform(deployDetails, new Function<GradleDeployDetails, Artifact>() { public Artifact apply(GradleDeployDetails from) { PublishArtifactInfo publishArtifact = from.getPublishArtifact(); DeployDetails deployDetails = from.getDeployDetails(); String artifactPath = deployDetails.getArtifactPath(); int index = artifactPath.lastIndexOf('/'); return new ArtifactBuilder(artifactPath.substring(index + 1)) .type(getTypeString(publishArtifact.getType(), publishArtifact.getClassifier(), publishArtifact.getExtension())) .md5(deployDetails.getMd5()).sha1(deployDetails.getSha1()).build(); } })); return artifacts; }

Target:
private List<Artifact> calculateArtifacts(Iterable<GradleDeployDetails> deployDetails) { return newArrayList(StreamSupport.stream(deployDetails.spliterator(), false).map(from -> { PublishArtifactInfo publishArtifact = from.getPublishArtifact(); DeployDetails deployDetails1 = from.getDeployDetails(); String artifactPath = deployDetails1.getArtifactPath(); int index = artifactPath.lastIndexOf('/'); return new ArtifactBuilder(artifactPath.substring(index + 1)) .type(getTypeString(publishArtifact.getType(), publishArtifact.getClassifier(), publishArtifact.getExtension())) .md5(deployDetails1.getMd5()).sha1(deployDetails1.getSha1()).build(); }).collect(Collectors.toList())); }
Source:
public void setIOConfiguration(IOLine ioLine, IOMode ioMode) throws InvalidOperatingModeException, XBeeException { if (!connectionInterface.isOpen()) throw new XBeeException(XBeeException.CONNECTION_NOT_OPEN); if (ioLine == null) throw new NullPointerException("IO line cannot be null."); if (ioMode == null) throw new NullPointerException("IO mode cannot be null."); String atCommand = ioLine.getATCommand(); ATCommandResponse response = sendATCommand(new ATCommand(atCommand, new byte[]{(byte)ioMode.getID()})); if (response == null || response.getResponseStatus() != ATCommandStatus.OK) throw new XBeeException(XBeeException.INVALID_OPERATION); }

Target:
public void setIOConfiguration(IOLine ioLine, IOMode ioMode) throws InvalidOperatingModeException, XBeeException { if (!connectionInterface.isOpen()) throw new XBeeException(XBeeException.CONNECTION_NOT_OPEN); if (ioLine == null) throw new NullPointerException("IO line cannot be null."); if (ioMode == null) throw new NullPointerException("IO mode cannot be null."); String atCommand = ioLine.getConfigurationATCommand(); ATCommandResponse response = sendATCommand(new ATCommand(atCommand, new byte[]{(byte)ioMode.getID()})); if (response == null || response.getResponseStatus() != ATCommandStatus.OK) throw new XBeeException(XBeeException.INVALID_OPERATION); }
Source:
public boolean test(Pipeline pipeline) { if (!environment.containsArgument("disabled")) { return true; } boolean disabled = environment.getArgument("disabled"); return (Boolean) pipeline.getOrDefault("disabled", false) == disabled; }

Target:
public boolean test(Pipeline pipeline) { if (!environment.containsArgument("disabled")) { return true; } boolean desired = environment.getArgument("disabled"); Boolean disabled = (Boolean) pipeline.get("disabled"); if (disabled == null) { return desired; } return disabled == desired; }