auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void initCodeReviewCategory(ProjectConfig c) { LabelType type = new LabelType("Code-Review", ImmutableList.of( new LabelValue((short) 2, "Looks good to me, approved"), new LabelValue((short) 1, "Looks good to me, but someone else must approve"), new LabelValue((short) 0, "No score"), new LabelValue((short) -1, "I would prefer that you didn't submit this"), new LabelValue((short) -2, "Do not submit"))); type.setAbbreviatedName("R"); type.setCopyMinScore(true); c.getLabelSections().put(type.getName(), type); }

Target:
private void initCodeReviewCategory(ProjectConfig c) { LabelType type = new LabelType("Code-Review", ImmutableList.of( new LabelValue((short) 2, "Looks good to me, approved"), new LabelValue((short) 1, "Looks good to me, but someone else must approve"), new LabelValue((short) 0, "No score"), new LabelValue((short) -1, "I would prefer that you didn't submit this"), new LabelValue((short) -2, "Do not submit"))); type.setAbbreviatedName("CR"); type.setCopyMinScore(true); c.getLabelSections().put(type.getName(), type); }
Source:
static LiteralText of(String content) { return Sponge.getRegistry().getTextFactory().literal(content); }

Target:
static LiteralText of(String content) { return Sponge.getRegistry().createBuilder(LiteralText.Builder.class).content(content).build(); }
Source:
public ErrorReportResponse uploadErrorReport( @Context final HttpServletRequest request, final ErrorReportRequest errorReport) { if (errorReport.getBody() == null || errorReport.getTitle() == null) { throw new IllegalArgumentException("Missing error report body and/or title"); } return errorReportIngestion.apply( org.triplea.server.error.reporting.ErrorReportRequest.builder() .clientIp(IpAddressExtractor.extractClientIp(request)) .errorReport(errorReport) .build()); }

Target:
public ErrorReportResponse uploadErrorReport( @Context final HttpServletRequest request, final ErrorReportRequest errorReport) { if (errorReport.getBody() == null || errorReport.getTitle() == null) { throw new IllegalArgumentException("Missing error report body and/or title"); } return errorReportIngestion.apply(IpAddressExtractor.extractClientIp(request), errorReport); }
Source:
private void setupBitmapLayout() { int parentWidth = parentRight - parentLeft; int parentHeight = parentBottom - parentTop; float anchorX = parentLeft + (parentWidth * cuePosition); float anchorY = parentTop + (parentHeight * cueLine); int width = Math.round(parentWidth * cueSize); int height = Math.round(width * ((float) cueBitmap.getHeight() / cueBitmap.getWidth()) / (((float) parentWidth / parentHeight) / cueSar)); int x = Math.round(cueLineAnchor == Cue.ANCHOR_TYPE_END ? (anchorX - width) : cueLineAnchor == Cue.ANCHOR_TYPE_MIDDLE ? (anchorX - (width / 2)) : anchorX); int y = Math.round(cuePositionAnchor == Cue.ANCHOR_TYPE_END ? (anchorY - height) : cuePositionAnchor == Cue.ANCHOR_TYPE_MIDDLE ? (anchorY - (height / 2)) : anchorY); bitmapRect = new Rect(x, y, x + width, y + height); }

Target:
private void setupBitmapLayout() { int parentWidth = parentRight - parentLeft; int parentHeight = parentBottom - parentTop; float anchorX = parentLeft + (parentWidth * cuePosition); float anchorY = parentTop + (parentHeight * cueLine); int width = Math.round(parentWidth * cueSize); int height = cueBitmapHeight != -1 ? Math.round(parentHeight * cueBitmapHeight) : Math.round(width * ((float) cueBitmap.getHeight() / cueBitmap.getWidth())); int x = Math.round(cueLineAnchor == Cue.ANCHOR_TYPE_END ? (anchorX - width) : cueLineAnchor == Cue.ANCHOR_TYPE_MIDDLE ? (anchorX - (width / 2)) : anchorX); int y = Math.round(cuePositionAnchor == Cue.ANCHOR_TYPE_END ? (anchorY - height) : cuePositionAnchor == Cue.ANCHOR_TYPE_MIDDLE ? (anchorY - (height / 2)) : anchorY); bitmapRect = new Rect(x, y, x + width, y + height); }
Source:
private CloseableHttpResponse execute(URI requestUri) throws IOException { CloseableHttpResponse response; ProxyConfig.Proxy proxy = proxyConfig .getProxyForUrl(requestUri.toString()); if (proxy != null) { getLogger().info("Downloading via proxy {}", proxy.toString()); return executeViaProxy(proxy, requestUri); } else { getLogger().info("No proxy was configured, downloading directly"); if (StringUtils.isNotEmpty(userName) && StringUtils .isNotEmpty(password)) { getLogger().info("Using credentials ({}) from settings.xml", userName); URL aURL = requestUri.toURL(); HttpClientContext localContext = makeLocalContext(aURL); CredentialsProvider credentialsProvider = makeCredentialsProvider( aURL.getHost(), aURL.getPort(), userName, password); response = buildHttpClient(credentialsProvider) .execute(new HttpGet(requestUri), localContext); } else { response = buildHttpClient(null) .execute(new HttpGet(requestUri)); } } return response; }

Target:
private CloseableHttpResponse execute(URI requestUri) throws IOException { CloseableHttpResponse response; ProxyConfig.Proxy proxy = proxyConfig .getProxyForUrl(requestUri.toString()); if (proxy != null) { getLogger().info("Downloading via proxy {}", proxy.toString()); return executeViaProxy(proxy, requestUri); } else { getLogger().info("No proxy was configured, downloading directly"); if (StringUtils.isNotEmpty(userName) && StringUtils .isNotEmpty(password)) { getLogger().info("Using credentials ({})", userName); URL aURL = requestUri.toURL(); HttpClientContext localContext = makeLocalContext(aURL); CredentialsProvider credentialsProvider = makeCredentialsProvider( aURL.getHost(), aURL.getPort(), userName, password); response = buildHttpClient(credentialsProvider) .execute(new HttpGet(requestUri), localContext); } else { response = buildHttpClient(null) .execute(new HttpGet(requestUri)); } } return response; }
Source:
public Iterable<TmfAnalysisRequirement> getAnalysisRequirements() { List<TmfAnalysisRequirement> requirements = new ArrayList<>(); List<String> eventNames = new ArrayList<>(); eventNames.add(LttngStrings.EXIT_SYSCALL); eventNames.add(LttngStrings.IRQ_HANDLER_ENTRY); eventNames.add(LttngStrings.IRQ_HANDLER_EXIT); eventNames.add(LttngStrings.SOFTIRQ_ENTRY); eventNames.add(LttngStrings.SOFTIRQ_EXIT); eventNames.add(LttngStrings.SOFTIRQ_RAISE); eventNames.add(LttngStrings.SCHED_SWITCH); eventNames.add(LttngStrings.SCHED_PROCESS_FORK); eventNames.add(LttngStrings.SCHED_PROCESS_EXIT); eventNames.add(LttngStrings.SCHED_PROCESS_FREE); eventNames.add(LttngStrings.STATEDUMP_PROCESS_STATE); eventNames.add(LttngStrings.SCHED_WAKEUP); eventNames.add(LttngStrings.SCHED_WAKEUP_NEW); eventNames.add(LttngStrings.SYSCALL_PREFIX); requirements.add(new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_EVENT, eventNames, AnalysisRequirementValueLevel.MANDATORY)); return requirements; }

Target:
public Iterable<TmfAnalysisRequirement> getAnalysisRequirements() { List<TmfAnalysisRequirement> requirements = new LinkedList<>(); List<String> eventNames = new LinkedList<>(); eventNames.add(LttngStrings.EXIT_SYSCALL); eventNames.add(LttngStrings.IRQ_HANDLER_ENTRY); eventNames.add(LttngStrings.IRQ_HANDLER_EXIT); eventNames.add(LttngStrings.SOFTIRQ_ENTRY); eventNames.add(LttngStrings.SOFTIRQ_EXIT); eventNames.add(LttngStrings.SOFTIRQ_RAISE); eventNames.add(LttngStrings.SCHED_SWITCH); eventNames.add(LttngStrings.SCHED_PROCESS_FORK); eventNames.add(LttngStrings.SCHED_PROCESS_EXIT); eventNames.add(LttngStrings.SCHED_PROCESS_FREE); eventNames.add(LttngStrings.STATEDUMP_PROCESS_STATE); eventNames.add(LttngStrings.SCHED_WAKEUP); eventNames.add(LttngStrings.SCHED_WAKEUP_NEW); eventNames.add(LttngStrings.SYSCALL_PREFIX); TmfAnalysisRequirement domainReq = new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN); domainReq.addValue(SessionConfigStrings.CONFIG_ELEMENT_DOMAIN_TYPE_KERNEL, AnalysisRequirementValueLevel.MANDATORY); requirements.add(domainReq); requirements.add(new TmfAnalysisRequirement(SessionConfigStrings.CONFIG_ELEMENT_EVENT, eventNames, AnalysisRequirementValueLevel.MANDATORY)); return requirements; }
Source:
public DecoratedCache(AdvancedCache<K, V> delegate, Object lockOwner, Flag... flags) { super(delegate); if (flags == null) throw new IllegalArgumentException("There is no point in using a DecoratedCache if Flags are set."); if (flags.length == 0) this.flags = EnumUtil.EMPTY_BIT_SET; else { this.flags = EnumUtil.bitSetOf(flags); } this.lockOwner = lockOwner; cacheImplementation = (CacheImpl<K, V>) delegate; }

Target:
public DecoratedCache(AdvancedCache<K, V> delegate, Object lockOwner, Flag... flags) { super(delegate); if (flags.length == 0) this.flags = EnumUtil.EMPTY_BIT_SET; else { this.flags = EnumUtil.bitSetOf(flags); } this.lockOwner = lockOwner; cacheImplementation = (CacheImpl<K, V>) delegate; }
Source:
public void setOptions(@NonNull EnumSet<PhotoPickerOption> options) { mAllowMultiSelect = options.contains(PhotoPickerOption.ALLOW_MULTI_SELECT); mPhotosOnly = options.contains(PhotoPickerOption.PHOTOS_ONLY); if (hasAdapter()) { getAdapter().setAllowMultiSelect(mAllowMultiSelect); getAdapter().setShowPhotosOnly(mPhotosOnly); } }

Target:
public void setOptions(@NonNull EnumSet<PhotoPickerOption> options) { mAllowMultiSelect = options.contains(PhotoPickerOption.ALLOW_MULTI_SELECT); mPhotosOnly = options.contains(PhotoPickerOption.PHOTOS_ONLY); mDeviceOnly = options.contains(PhotoPickerOption.DEVICE_ONLY); if (hasAdapter()) { getAdapter().setAllowMultiSelect(mAllowMultiSelect); getAdapter().setShowPhotosOnly(mPhotosOnly); } }
Source:
public String getText(final Object element) { Item item = (Item) element; String label = item.getLabel(); if (label == null || label.trim().length() == 0) { label = item.getViewpoint().getName(); } return label; }

Target:
public String getText(final Object element) { Item item = (Item) element; return item.getLabel(); }
Source:
public void registerAnimationCallback(@NonNull Animatable2.AnimationCallback callback) { if (mAnimationCallbacks == null) { mAnimationCallbacks = new ArrayList<>(); } if (mAnimationCallbacks.contains(callback)) { return; } mAnimationCallbacks.add(callback); if (mAnimatorListener == null) { mAnimatorListener = new AnimatorListenerAdapter() { @Override public void onAnimationStart(@NonNull Animator animation) { ArrayList<Animatable2.AnimationCallback> tmpCallbacks = new ArrayList<>(mAnimationCallbacks); int size = tmpCallbacks.size(); for (int i = 0; i < size; i++) { tmpCallbacks.get(i).onAnimationStart(SeekableAnimatedVectorDrawable.this); } } @Override public void onAnimationEnd(@NonNull Animator animation) { ArrayList<Animatable2.AnimationCallback> tmpCallbacks = new ArrayList<>(mAnimationCallbacks); int size = tmpCallbacks.size(); for (int i = 0; i < size; i++) { tmpCallbacks.get(i).onAnimationEnd(SeekableAnimatedVectorDrawable.this); } } }; } mAnimatedVectorState.mAnimatorSet.addListener(mAnimatorListener); }

Target:
public void registerAnimationCallback(@NonNull Animatable2.AnimationCallback callback) { if (mAnimationCallbacks == null) { mAnimationCallbacks = new ArrayList<>(); } if (mAnimationCallbacks.contains(callback)) { return; } mAnimationCallbacks.add(callback); if (mAnimatorListener == null) { mAnimatorListener = new AnimatorListenerAdapter() { @Override public void onAnimationStart(@NonNull Animator animation) { ArrayList<Animatable2.AnimationCallback> tmpCallbacks = new ArrayList<>(mAnimationCallbacks); int size = tmpCallbacks.size(); for (int i = 0; i < size; i++) { tmpCallbacks.get(i).onAnimationStart(SeekableAnimatedVectorDrawable.this); } } @Override public void onAnimationEnd(@NonNull Animator animation) { ArrayList<Animatable2.AnimationCallback> tmpCallbacks = new ArrayList<>(mAnimationCallbacks); int size = tmpCallbacks.size(); for (int i = 0; i < size; i++) { tmpCallbacks.get(i).onAnimationEnd(SeekableAnimatedVectorDrawable.this); } } }; mAnimatedVectorState.mAnimatorSet.addListener(mAnimatorListener); } }
Source:
private boolean uploadIfNotExists(BlobId blobId, long inputLength, CloudBlobMetadata cloudBlobMetadata, InputStream blobInputStream) throws StorageException, URISyntaxException, IOException { BlobRequestOptions options = null; AccessCondition condition = AccessCondition.generateIfNoneMatchCondition("*"); Timer.Context storageTimer = azureMetrics.blobUploadTime.time(); try { CloudBlobContainer azureContainer = getContainer(blobId, true); String azureBlobName = getAzureBlobName(blobId); CloudBlockBlob azureBlob = azureContainer.getBlockBlobReference(azureBlobName); azureBlob.setMetadata(getMetadataMap(cloudBlobMetadata)); azureBlob.upload(blobInputStream, inputLength, condition, options, blobOpContext); logger.debug("Uploaded blob to Azure container {}.", blobId, azureContainer.getName()); return true; } catch (StorageException sex) { if (sex.getHttpStatusCode() == HttpURLConnection.HTTP_CONFLICT) { logger.debug("Skipped upload of existing blob {}.", blobId); azureMetrics.blobUploadSkippedCount.inc(); return false; } else { throw sex; } } finally { storageTimer.stop(); } }

Target:
private boolean uploadIfNotExists(BlobId blobId, long inputLength, CloudBlobMetadata cloudBlobMetadata, InputStream blobInputStream) throws StorageException, URISyntaxException, IOException { BlobRequestOptions options = null; AccessCondition condition = AccessCondition.generateIfNoneMatchCondition("*"); Timer.Context storageTimer = azureMetrics.blobUploadTime.time(); try { CloudBlobContainer azureContainer = getContainer(blobId, true); String azureBlobName = getAzureBlobName(blobId); CloudBlockBlob azureBlob = azureContainer.getBlockBlobReference(azureBlobName); azureBlob.setMetadata(getMetadataMap(cloudBlobMetadata)); azureBlob.upload(blobInputStream, inputLength, condition, options, blobOpContext); logger.debug("Uploaded blob to Azure container {}.", blobId, azureContainer.getName()); return true; } catch (StorageException sex) { if (sex.getHttpStatusCode() == HttpURLConnection.HTTP_CONFLICT) { logger.debug("Skipped upload of existing blob {}.", blobId); azureMetrics.blobUploadConflictCount.inc(); return false; } else { throw sex; } } finally { storageTimer.stop(); } }
Source:
public QueryResult<ChannelSchedule> execute(ScheduleQuery query) throws QueryExecutionException { List<Channel> channels = resolveChannels(query); if(!query.getEnd().isPresent()) { throw new UnsupportedOperationException("ScheduleResolverBackedScheduleQueryExecutor doesn't support 'count' queries. Please specify 'to' parameter in your request"); } ListenableFuture<Schedule> schedule = scheduleResolver.resolve( channels, new Interval(query.getStart(), query.getEnd().get()), query.getSource() ); if (query.isMultiChannel()) { return QueryResult.listResult(channelSchedules(schedule, query), query.getContext()); } return QueryResult.singleResult(Iterables.getOnlyElement(channelSchedules(schedule, query)), query.getContext()); }

Target:
public QueryResult<ChannelSchedule> execute(ScheduleQuery query) throws QueryExecutionException { List<Channel> channels = resolveChannels(query); if(!query.getEnd().isPresent()) { throw new UnsupportedOperationException("'count' parameter not supported in non-equivalent schedule store. Please specify 'to' parameter in your request"); } ListenableFuture<Schedule> schedule = scheduleResolver.resolve( channels, new Interval(query.getStart(), query.getEnd().get()), query.getSource() ); if (query.isMultiChannel()) { return QueryResult.listResult(channelSchedules(schedule, query), query.getContext()); } return QueryResult.singleResult(Iterables.getOnlyElement(channelSchedules(schedule, query)), query.getContext()); }
Source:
public void testEquals() throws Exception { RedisConnectionFactory connectionFactory = this.getConnectionFactoryForTest(); RedisLockRegistry registry1 = new RedisLockRegistry(connectionFactory, "rlrTests"); RedisLockRegistry registry2 = new RedisLockRegistry(connectionFactory, "rlrTests"); RedisLockRegistry registry3 = new RedisLockRegistry(connectionFactory, "rlrTests2"); Lock lock1 = registry1.obtain("foo"); Lock lock2 = registry1.obtain("foo"); assertEquals(lock1, lock2); lock1.lock(); lock2.lock(); assertEquals(lock1, lock2); lock1.unlock(); lock2.unlock(); assertEquals(lock1, lock2); lock1 = registry1.obtain("foo"); lock2 = registry2.obtain("foo"); assertNotEquals(lock1, lock2); lock1.lock(); assertFalse(lock2.tryLock()); lock1.unlock(); lock1 = registry1.obtain("foo"); lock2 = registry3.obtain("foo"); assertNotEquals(lock1, lock2); lock1.lock(); lock2.lock(); lock1.unlock(); lock2.unlock(); }

Target:
public void testEquals() throws Exception { RedisConnectionFactory connectionFactory = this.getConnectionFactoryForTest(); RedisLockRegistry registry1 = new RedisLockRegistry(connectionFactory, "rlrTests"); registry1.setUseWeakReferences(true); RedisLockRegistry registry2 = new RedisLockRegistry(connectionFactory, "rlrTests"); RedisLockRegistry registry3 = new RedisLockRegistry(connectionFactory, "rlrTests2"); Lock lock1 = registry1.obtain("foo"); Lock lock2 = registry1.obtain("foo"); assertEquals(lock1, lock2); lock1.lock(); lock2.lock(); assertEquals(lock1, lock2); lock1.unlock(); lock2.unlock(); assertEquals(lock1, lock2); lock1 = registry1.obtain("foo"); lock2 = registry2.obtain("foo"); assertNotEquals(lock1, lock2); lock1.lock(); assertFalse(lock2.tryLock()); lock1.unlock(); lock1 = registry1.obtain("foo"); lock2 = registry3.obtain("foo"); assertNotEquals(lock1, lock2); lock1.lock(); lock2.lock(); lock1.unlock(); lock2.unlock(); }
Source:
public NakadiCursor unshiftCursor(final ShiftedNakadiCursor cursor) throws InvalidCursorOperation { if (cursor.getShift() < 0) { return moveCursorBackwards(cursor.getTopic(), cursor.getTimeline(), cursor.getPartition(), parse(cursor.getOffset()), cursor.getShift()); } else { return moveCursorForward(cursor.getTopic(), cursor.getTimeline(), cursor.getPartition(), parse(cursor.getOffset()), cursor.getShift()); } }

Target:
public NakadiCursor unshiftCursor(final ShiftedNakadiCursor cursor) throws InvalidCursorOperation { if (cursor.getShift() < 0) { return moveCursorBackwards(cursor.getEventType(), cursor.getTimeline(), cursor.getPartition(), numberOfEventsBeforeCursor(cursor), cursor.getShift()); } else if (cursor.getShift() > 0) { return moveCursorForward(cursor.getEventType(), cursor.getTimeline(), cursor.getPartition(), numberOfEventsBeforeCursor(cursor), cursor.getShift()); } else { return new NakadiCursor(cursor.getTimeline(), cursor.getPartition(), cursor.getOffset()); } }
Source:
public static ChecksumType getChecksumType(Configuration conf) { String checksumName = conf.get(HConstants.CHECKSUM_TYPE_NAME); return checksumName == null ? ChecksumType.getDefaultChecksumType() : ChecksumType.nameToType(checksumName); }

Target:
public static ChecksumType getChecksumType(Configuration conf) { return ChecksumType.nameToType( conf.get(HConstants.CHECKSUM_TYPE_NAME, ChecksumType.getDefaultChecksumType().getName())); }
Source:
protected void executeCommand() { ManagedBlockStorage managedBlockStorage = cinderStorageDao.get(getParameters().getStorageDomainId()); List<String> extraParams = new ArrayList<>(); extraParams.add(getParameters().getVolumeId().toString()); extraParams.add(getParameters().getImageId().toString()); CinderlibReturnValue returnValue; try { CinderlibCommandParameters params = new CinderlibCommandParameters(JsonHelper.mapToJson( managedBlockStorage.getAllDriverOptions(), false), extraParams); returnValue = cinderlibExecutor.runCommand(CinderlibExecutor.CinderlibCommand.CREATE_VOLUME_FROM_SNAPSHOT, params); Guid clonedVolumeGuid = Guid.createGuidFromString(returnValue.getOutput()); getParameters().setDestinationImageId(clonedVolumeGuid); } catch (Exception e) { log.error("Failed executing creating volume from snapshot", e); return; } if (!returnValue.getSucceed()) { return; } createVolumeFromSnapshotInDB(); setSucceeded(true); persistCommandIfNeeded(); }

Target:
protected void executeCommand() { ManagedBlockStorage managedBlockStorage = cinderStorageDao.get(getParameters().getStorageDomainId()); List<String> extraParams = new ArrayList<>(); extraParams.add(getParameters().getVolumeId().toString()); extraParams.add(getParameters().getImageId().toString()); CinderlibReturnValue returnValue; try { CinderlibCommandParameters params = new CinderlibCommandParameters(JsonHelper.mapToJson( managedBlockStorage.getAllDriverOptions(), false), extraParams); returnValue = cinderlibExecutor.runCommand(CinderlibExecutor.CinderlibCommand.CREATE_VOLUME_FROM_SNAPSHOT, params); if (!returnValue.getSucceed()) { return; } Guid clonedVolumeGuid = Guid.createGuidFromString(returnValue.getOutput()); getParameters().setDestinationImageId(clonedVolumeGuid); } catch (Exception e) { log.error("Failed executing creating volume from snapshot", e); return; } createVolumeFromSnapshotInDB(); setSucceeded(true); persistCommandIfNeeded(); }
Source:
private ClientRuntimeError createOnErrorHandler(final Throwable throwable, final String name, final Package projectPkg){ String FileAlreadyExistsExceptionClassName = "org.uberfire.java.nio.file.FileAlreadyExistsException"; if(throwable.getClass().getCanonicalName().equals(FileAlreadyExistsExceptionClassName)){ String message = translationService.getValue(StunnerProjectClientMessages.BUSINESS_PROCESS_ALREADY_EXISTS, name, projectPkg.getPackageName()); return new ClientRuntimeError(message, throwable); }else{ return new ClientRuntimeError(throwable); } }

Target:
private ClientRuntimeError createOnErrorHandler(final Throwable throwable, final String name, final Package projectPkg){ String FileAlreadyExistsExceptionClassName = "org.uberfire.java.nio.file.FileAlreadyExistsException"; if(throwable.getClass().getCanonicalName().equals(FileAlreadyExistsExceptionClassName)){ String message = translationService.getValue(StunnerProjectClientMessages.BUSINESS_PROCESS_ALREADY_EXISTS, projectPkg.getPackageName()+"."+name); return new ClientRuntimeError(message, throwable); }else{ return new ClientRuntimeError(throwable); } }
Source:
private void addWorkPackageCriteria() { if (isWorkPackageSpecified()) { ArtifactId workPackArt = atsApi.getQueryService().getArtifact(workPackageId); if (isColorTeamMatch(workPackArt)) { if (workPackArt != null) { queryAnd(AtsAttributeTypes.WorkPackageReference, workPackArt.getIdString()); } } } }

Target:
private void addWorkPackageCriteria() { if (isWorkPackageSpecified()) { ArtifactId workPackArt = atsApi.getQueryService().getArtifactOrSentinel(workPackageId); if (isColorTeamMatch(workPackArt)) { if (workPackArt.isValid()) { queryAnd(AtsAttributeTypes.WorkPackageReference, workPackArt.getIdString()); } } } }
Source:
public void onResourceChanged(ResourceChangedEvent event) { ResourceDelta delta = event.getDelta(); Resource resource = delta.getResource(); if (resource.isProject() && resource.getLocation().segmentCount() == 1) { if (isProjectUnderGit(resource.asProject())) { if (delta.getKind() == ResourceDelta.ADDED) { if ((delta.getFlags() & (MOVED_FROM | MOVED_TO)) != 0) { String oldProjectName = delta.getFromPath().segment(0); String newProjectName = delta.getToPath().segment(0); MutableAlteredFiles alteredFiles = new MutableAlteredFiles( findProjectByName(newProjectName), changes.remove(oldProjectName)); changes.put(newProjectName, alteredFiles); view.renameRepository(oldProjectName, newProjectName); } else { changes.put(resource.getName(), new MutableAlteredFiles(resource.asProject())); view.addRepository(resource.getName()); } } else if (delta.getKind() == ResourceDelta.REMOVED) { changes.remove(resource.getName()); view.removeRepository(resource.getName()); } } } else { if (delta.getKind() == ResourceDelta.REMOVED) { String pathToItem = delta.getResource().getLocation().toString(); String projectName = extractProjectName(pathToItem); MutableAlteredFiles alteredFiles = changes.get(projectName); if (alteredFiles == null) { return; } String itemRelativePath = removeProjectName(pathToItem); if (alteredFiles.getStatusByFilePath(itemRelativePath) != Status.ADDED) { alteredFiles.addFile(itemRelativePath, Status.DELETED); } else { alteredFiles.removeFile(itemRelativePath); } view.updateRepositoryChanges(projectName, alteredFiles.getFilesQuantity()); if (projectName.equals(selectedProjectName)) { updateChangedFiles(alteredFiles); } } } }

Target:
public void onResourceChanged(ResourceChangedEvent event) { ResourceDelta delta = event.getDelta(); Resource resource = delta.getResource(); if (resource.isProject() && resource.getLocation().segmentCount() == 1) { if (isProjectUnderGit(resource.asProject())) { if (delta.getKind() == ResourceDelta.ADDED) { if ((delta.getFlags() & (MOVED_FROM | MOVED_TO)) != 0) { String oldProjectName = delta.getFromPath().segment(0); String newProjectName = delta.getToPath().segment(0); MutableAlteredFiles alteredFiles = new MutableAlteredFiles( findProjectByName(newProjectName), changes.remove(oldProjectName)); changes.put(newProjectName, alteredFiles); view.renameRepository(oldProjectName, newProjectName); } else { changes.put(resource.getName(), new MutableAlteredFiles(resource.asProject())); view.addRepository(resource.getName()); } } else if (delta.getKind() == ResourceDelta.REMOVED) { changes.remove(resource.getName()); view.removeRepository(resource.getName()); } } } else { if (delta.getKind() == ResourceDelta.REMOVED) { onItemDeleted(delta); } } }
Source:
public Collection<Class<? extends DataProvider>> getRequiredDataProviders(StepEngineSettings.StepDefinition stepDefinition) { String visualizationIdentifier = stepDefinition.getConfig(ShowAction.Config.class).getVisualizationIdentifier(); return VisualizationRegistry.INSTANCE.getRequiredDataProviders(visualizationIdentifier); }

Target:
public Collection<Class<? extends DataProvider>> getRequiredDataProviders(StepEngineSettings.StepDefinition stepDefinition) { String visualizationIdentifier = stepDefinition.getConfig(Config.class).getVisualizationIdentifier(); return VisualizationRegistry.INSTANCE.getRequiredDataProviders(visualizationIdentifier); }
Source:
private void setupPrivacyDisclosures(TextView footerText) { final String verifyPhoneButtonText = getString(R.string.fui_verify_phone_number); final String multipleProviderFlowText = getString(R.string.fui_sms_terms_of_service, verifyPhoneButtonText); FlowParameters flowParameters = getFlowParams(); PrivacyDisclosureUtils.setupTermsOfServiceAndPrivacyPolicySmsText(getContext(), flowParameters, mSmsTermsText, multipleProviderFlowText); if (!flowParameters.isSingleProviderFlow()) { PrivacyDisclosureUtils.setupTermsOfServiceFooter(getContext(), flowParameters, footerText); } }

Target:
private void setupPrivacyDisclosures(TextView footerText) { final String verifyPhoneButtonText = getString(R.string.fui_verify_phone_number); final String multipleProviderFlowText = getString(R.string.fui_sms_terms_of_service, verifyPhoneButtonText); FlowParameters flowParameters = getFlowParams(); if (flowParameters.isSingleProviderFlow()) { PrivacyDisclosureUtils.setupTermsOfServiceAndPrivacyPolicySmsText(getContext(), flowParameters, mSmsTermsText); } else { PrivacyDisclosureUtils.setupTermsOfServiceFooter(getContext(), flowParameters, footerText); mSmsTermsText.setText(multipleProviderFlowText); } }
Source:
private Set<FilterResult> filterNode(StructuralNode node) { Set<FilterResult> filterResults = new HashSet<>(); for (ScanFilter scanFilter : parentScanner.getScanFilters()) { FilterResult filterResult = scanFilter.isFiltered(node); if (!filterResult.isFiltered()) { filterResults.add(filterResult); } } return filterResults; }

Target:
private boolean filterNode(StructuralNode node) { for (ScanFilter scanFilter : parentScanner.getScanFilters()) { try { FilterResult filterResult = scanFilter.isFiltered(node); if (filterResult.isFiltered()) { if (log.isDebugEnabled()) { log.debug( "Ignoring filtered node: " + node.getName() + " Reason: " + filterResult.getReason()); } return true; } } catch (Exception ex) { log.error(ex.getMessage(), ex); } } return false; }
Source:
private ListenableFuture scheduleTaskShutdown(ThreadingTaskRunnerWorkItem taskInfo) { synchronized (tasks) { if (taskInfo.shutdownFuture != null) { return taskInfo.shutdownFuture; } ListenableFuture shutdownFuture = controlThreadExecutor.submit( new Callable<Void>() { @Override public Void call() { LOGGER.info("Stopping thread for task: %s", taskInfo.getTaskId()); taskInfo.getTask().stopGracefully(taskConfig); try { TaskStatus status = taskInfo.getResult().get( taskConfig.getGracefulShutdownTimeout().toStandardDuration().getMillis(), TimeUnit.MILLISECONDS ); if (status == null) { if (taskInfo.thread != null) { taskInfo.thread.interrupt(); } } } catch (Exception e) { LOGGER.info(e, "Encountered exception while waiting for task [%s] shutdown", taskInfo.getTaskId()); if (taskInfo.thread != null) { taskInfo.thread.interrupt(); } } return null; } } ); taskInfo.shutdownFuture = shutdownFuture; return shutdownFuture; } }

Target:
private ListenableFuture scheduleTaskShutdown(ThreadingTaskRunnerWorkItem taskInfo) { synchronized (tasks) { if (taskInfo.shutdownFuture != null) { return taskInfo.shutdownFuture; } taskInfo.shutdownFuture = controlThreadExecutor.submit( new Callable<Void>() { @Override public Void call() { LOGGER.info("Stopping thread for task: %s", taskInfo.getTaskId()); taskInfo.getTask().stopGracefully(taskConfig); try { taskInfo.getResult().get( taskConfig.getGracefulShutdownTimeout().toStandardDuration().getMillis(), TimeUnit.MILLISECONDS ); } catch (TimeoutException e) { taskInfo.getResult().cancel(true); } catch (Exception e) { LOGGER.info(e, "Encountered exception while waiting for task [%s] shutdown", taskInfo.getTaskId()); if (taskInfo.shutdownFuture != null) { taskInfo.shutdownFuture.cancel(true); } } return null; } } ); return taskInfo.shutdownFuture; } }
Source:
public String getString(String key) { String envName = key.toUpperCase().replaceAll("\\.", "_"); String envValue = System.getenv(envName); if (StringUtils.isNotBlank(envValue)) { return envValue; } return properties.getProperty(key); }

Target:
public String getString(String key) { if (useEnvVars) { String envValue = System.getenv(getEnvVarName(key)); if (envValue != null && !envValue.isEmpty()) { return envValue; } } return properties.getProperty(key); }
Source:
public List<String> getLossVariables(){ return this.lossVariables; }

Target:
public List<String> getLossVariables(){ return Collections.unmodifiableList(this.lossVariables); }
Source:
public boolean offer(E e) { throw new NotImplementedException(); }

Target:
public boolean offer(E e) { if (this.underlyingQueue.offer(new ThroughputElement<E>(e))) { internalAddElement(); return true; } return false; }
Source:
public String getFaviconPath() { File favicon = new File(filePath + "/favicon.ico"); if (favicon.exists()) { return path + "/favicon.ico"; } return null; }

Target:
public String getFaviconPath() { String faviconFile = brandingProperties.getProperty(FAVICON_KEY); if (faviconFile != null) { File favicon = new File(filePath + "/" + faviconFile); if (favicon.exists()) { return path + "/" + faviconFile; } } return null; }
Source:
public void writeTo(final Object data, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { InputStream templateStream = null; try { String xslName = "/" + type.getSimpleName() + "AsPdf.xsl"; templateStream = type.getResourceAsStream(xslName); if (templateStream != null) { StreamSource transformSource = new StreamSource(templateStream); Method factoryMethod = null; for (Method currentMethod : objectFactory.getClass().getDeclaredMethods()) { Class<?>[] parameterTypes = currentMethod.getParameterTypes(); if (parameterTypes.length == 1 && parameterTypes[0] == type) { factoryMethod = currentMethod; break; } } if (data != null && factoryMethod != null) { JAXBElement<?> element = (JAXBElement<?>) factoryMethod.invoke(objectFactory, data); Source source = new JAXBSource(jaxbContext, element); Transformer xslfoTransformer = transfact.newTransformer(transformSource); Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, entityStream); Result res = new SAXResult(fop.getDefaultHandler()); xslfoTransformer.transform(source, res); } else { log.error("No profile data is available for the selected volume"); } } else { log.error("Error while generating PDF.Null InputStream"); } } catch (Exception e) { log.error("Error while generating PDF.", e); } finally { if (templateStream != null) { templateStream.close(); } } }

Target:
public void writeTo(final Object data, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String, Object> httpHeaders, OutputStream entityStream) throws IOException, WebApplicationException { String xslName = "/" + type.getSimpleName() + "AsPdf.xsl"; try (InputStream templateStream = type.getResourceAsStream(xslName)) { if (templateStream != null) { StreamSource transformSource = new StreamSource(templateStream); Method factoryMethod = null; for (Method currentMethod : objectFactory.getClass().getDeclaredMethods()) { Class<?>[] parameterTypes = currentMethod.getParameterTypes(); if (parameterTypes.length == 1 && parameterTypes[0] == type) { factoryMethod = currentMethod; break; } } if (data != null && factoryMethod != null) { JAXBElement<?> element = (JAXBElement<?>) factoryMethod.invoke(objectFactory, data); Source source = new JAXBSource(jaxbContext, element); Transformer xslfoTransformer = transfact.newTransformer(transformSource); Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, entityStream); Result res = new SAXResult(fop.getDefaultHandler()); xslfoTransformer.transform(source, res); } else { log.error("Data not available"); } } else { log.error("Error while generating PDF. Null InputStream"); } } catch (Exception e) { log.error("Error while generating PDF. ", e); } }
Source:
public boolean supportsSingleValuedAssociationNaturalIdExpressions() { return false; }

Target:
public boolean supportsSingleValuedAssociationNaturalIdExpressions() { return supportsSingleValuedAssociationNaturalIdExpressions; }
Source:
public URL getFileUrl() throws MalformedURLException { return new URL(azureFileStorageClient.url()); }

Target:
public URL getFileUrl() { try { return new URL(azureFileStorageClient.url()); } catch (MalformedURLException e) { throw new RuntimeException(String.format("Invalid URL on %s: %s" + getClass().getSimpleName(), azureFileStorageClient.url()), e); } }
Source:
public void modify(final Object element, final String property, final Object value) { TableItem tableItem = (TableItem) element; Compiler data = (Compiler) tableItem.getData(); Command cmd = null; cmd = getModifcationCommand(property, value, data); if (null != cmd) { executeCommand(cmd); compilerViewer.refresh(data); } }

Target:
public void modify(final Object element, final String property, final Object value) { TableItem tableItem = (TableItem) element; Compiler data = (Compiler) tableItem.getData(); Command cmd = getModificationCommand(property, value, data); if (null != cmd) { executeCommand(cmd); compilerViewer.refresh(data); } }
Source:
private void collectClassesAndInterfaces(Set<String> classesAndInterfaces, ClassLoader classLoader, String className) { if (className == null || "java/lang/Object".equals(className)) { return; } InputStream is = null; try { is = classLoader.getResourceAsStream(className.replace('.', '/') + ".class"); ClassReader classReader = new ClassReader(is); classReader.accept(new ClassVisitor(useASM7 ? Opcodes.ASM7 : Opcodes.ASM6) { @Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { if (interfaces != null) { for (String interfaceName : interfaces) { classesAndInterfaces.add(interfaceName); collectClassesAndInterfaces(classesAndInterfaces, classLoader, interfaceName); } } classesAndInterfaces.add(superName); collectClassesAndInterfaces(classesAndInterfaces, classLoader, superName); } @Override public void visitInnerClass(String name, String outerName, String innerName, int access) { if (innerName != null) { classesAndInterfaces.add(innerName); } } }, 0); } catch (IOException e) { logger.debugf("Unable to open class file %s, due to exception %s", className, e); } finally { try { if (is != null) { is.close(); } } catch (IOException ignored) { } } }

Target:
private void collectClassesAndInterfaces(Set<String> classesAndInterfaces, ClassLoader classLoader, String className) { if (className == null || "java/lang/Object".equals(className)) { return; } try (InputStream is = classLoader.getResourceAsStream(className.replace('.', '/') + ".class")) { ClassReader classReader = new ClassReader(is); classReader.accept(new ClassVisitor(useASM7 ? Opcodes.ASM7 : Opcodes.ASM6) { @Override public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { if (interfaces != null) { for (String interfaceName : interfaces) { classesAndInterfaces.add(interfaceName); collectClassesAndInterfaces(classesAndInterfaces, classLoader, interfaceName); } } classesAndInterfaces.add(superName); collectClassesAndInterfaces(classesAndInterfaces, classLoader, superName); } @Override public void visitInnerClass(String name, String outerName, String innerName, int access) { if (innerName != null) { classesAndInterfaces.add(innerName); } } }, 0); } catch (IOException e) { logger.debugf("Unable to open class file %s, due to exception %s", className, e); } }
Source:
private void writeFileWithPurge(Bucket bucket, BucketFileMeta meta, RangeSet<Slice> rset, HashSet<String> filesToDelete, BucketMeta bmeta) throws IOException { LOG.debug("Writing file because of purge operation {}", meta); if (rset.containsFully(new Range<>(meta.startKey, getEndKey(bucket.bucketKey, meta)))) { LOG.info("File being deleted because of purge {}", meta); filesToDelete.add(meta.name); bmeta.files.remove(meta.startKey); return; } TreeMap<Slice, byte[]> fileData = readFile(bucket, meta); boolean rewrite = false; Iterator<Slice> iter = fileData.keySet().iterator(); while(iter.hasNext()) { Slice key = iter.next(); for (Range r : rset) { if (r.contains(key, keyComparator)) { iter.remove(); rewrite = true; } } } if (rewrite && fileData.size() > 0) { LOG.info("Rewriting file because of purge {}", meta); filesToDelete.add(meta.name); bmeta.files.remove(meta.startKey); writeFile(bucket, bmeta, fileData); } }

Target:
private void writeFileWithPurge(Bucket bucket, BucketFileMeta meta, RangeSet<Slice> rset, HashSet<String> filesToDelete, BucketMeta bmeta) throws IOException { LOG.debug("Writing file because of purge operation {}", meta); if (rset.containsFully(new Range<>(meta.startKey, getEndKey(bucket.bucketKey, meta, rset)))) { LOG.info("File being deleted because of purge {}", meta); filesToDelete.add(meta.name); bmeta.files.remove(meta.startKey); return; } TreeMap<Slice, byte[]> fileData = readDataExcludingPurge(bucket, meta, rset); if (fileData.size() > 0) { LOG.info("Rewriting file because of purge {}", meta); filesToDelete.add(meta.name); bmeta.files.remove(meta.startKey); writeFile(bucket, bmeta, fileData); } }
Source:
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { Collection<EObject> openables = getMovedOpenablesFromRequest(); try { SashWindowsMngr sashMng = createSashWindowsMngr(openables); Resource sashResourceResource = getSashResource(); if (sashResourceResource == null) { return CommandResult.newErrorCommandResult(SASH_RESOURCE_ERROR); } sashResourceResource.getContents().add(sashMng); } catch (SashEditorException e) { e.printStackTrace(); return CommandResult.newErrorCommandResult(e); } catch (ServiceException e) { e.printStackTrace(); return CommandResult.newErrorCommandResult(e); } return CommandResult.newOKCommandResult(); }

Target:
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException { Collection<EObject> openables = getMovedOpenablesFromRequest(); try { SashWindowsMngr sashMng = createSashWindowsMngr(openables); Resource sashResourceResource = getSashResource(); if (sashResourceResource == null) { return CommandResult.newErrorCommandResult(SASH_RESOURCE_ERROR); } sashResourceResource.getContents().add(sashMng); } catch (SashEditorException e) { ControlModePlugin.log.error(e); return CommandResult.newErrorCommandResult(e); } catch (ServiceException e) { ControlModePlugin.log.error(e); return CommandResult.newErrorCommandResult(e); } return CommandResult.newOKCommandResult(); }
Source:
public static void startPeergos(Args a) { try { PublicSigningKey.addProvider(PublicSigningKey.Type.Ed25519, new Ed25519.Java()); int webPort = a.getInt("port"); URL coreAddress = new URI(a.getArg("corenodeURL")).toURL(); String domain = a.getArg("domain"); InetSocketAddress userAPIAddress = new InetSocketAddress(domain, webPort); boolean useIPFS = a.getBoolean("useIPFS"); int dhtCacheEntries = 1000; int maxValueSizeToCache = 50 * 1024; ContentAddressedStorage dht = useIPFS ? new CachingStorage(new IpfsDHT(), dhtCacheEntries, maxValueSizeToCache) : RAMStorage.getSingleton(); String hostname = a.getArg("domain"); CoreNode core = HTTPCoreNode.getInstance(coreAddress); MutablePointers mutable = HttpMutablePointers.getInstance(coreAddress); String blacklistPath = "blacklist.txt"; PublicKeyBlackList blacklist = new UserBasedBlackList(Paths.get(blacklistPath), core, mutable, dht); MutablePointers pinner = new BlockingMutablePointers(new PinningMutablePointers(mutable, dht), blacklist); InetSocketAddress httpsMessengerAddress = new InetSocketAddress(hostname, userAPIAddress.getPort()); new UserService(httpsMessengerAddress, Logger.getLogger("IPFS"), dht, core, pinner, a); } catch (Exception e) { e.printStackTrace(); System.exit(-1); } }

Target:
public static void startPeergos(Args a) { try { PublicSigningKey.addProvider(PublicSigningKey.Type.Ed25519, new Ed25519.Java()); int webPort = a.getInt("port"); URL coreAddress = new URI(a.getArg("corenodeURL")).toURL(); String domain = a.getArg("domain"); InetSocketAddress userAPIAddress = new InetSocketAddress(domain, webPort); boolean useIPFS = a.getBoolean("useIPFS"); int dhtCacheEntries = 1000; int maxValueSizeToCache = 50 * 1024; ContentAddressedStorage dht = useIPFS ? new CachingStorage(new IpfsDHT(), dhtCacheEntries, maxValueSizeToCache) : RAMStorage.getSingleton(); String hostname = a.getArg("domain"); CoreNode core = HTTPCoreNode.getInstance(coreAddress); MutablePointers mutable = HttpMutablePointers.getInstance(coreAddress); String blacklistPath = "blacklist.txt"; PublicKeyBlackList blacklist = new UserBasedBlacklist(Paths.get(blacklistPath), core, mutable, dht); MutablePointers pinner = new BlockingMutablePointers(new PinningMutablePointers(mutable, dht), blacklist); InetSocketAddress httpsMessengerAddress = new InetSocketAddress(hostname, userAPIAddress.getPort()); new UserService(httpsMessengerAddress, Logger.getLogger("IPFS"), dht, core, pinner, a); } catch (Exception e) { e.printStackTrace(); System.exit(-1); } }
Source:
List<CompositeT> allBetween(CompositeT from, CompositeT to) { List<CompositeT> res = new ArrayList<>(); res.add(from); if (to != from) { includeClosed(from, to, res); } return res; }

Target:
List<CompositeT> allBetween(CompositeT from, CompositeT to) { List<CompositeT> res = new ArrayList<>(); if (to != from) { includeClosed(from, to, res); } return res; }
Source:
public String getJavaString(final ExpressionOperatorParameter parameters) { final Type castFrom = getLeft().getOutputType(parameters); final Type castTo = getRight().getOutputType(parameters); switch (getCastType(castFrom, castTo)) { case LONGTOINT: return getLeftFunctionCallString("com.google.common.primitives.Ints.checkedCast", parameters); case FLOATSTOINT: return getLeftFunctionCallWithParemeterString("com.google.common.math.DoubleMath.roundToInt", parameters, "java.math.RoundingMode.DOWN"); case NUMTOFLOAT: return getPrimitiveTypeCastString("float", parameters); case NUMTODOUBLE: return getPrimitiveTypeCastString("double", parameters); case INTTOLONG: return getPrimitiveTypeCastString("long", parameters); case FLOATSTOLONG: return getLeftFunctionCallWithParemeterString("com.google.common.math.DoubleMath.roundToLong", parameters, "java.math.RoundingMode.DOWN"); case TOSTR: return getLeftFunctionCallString("String.valueOf", parameters); case STRTOINT: return getLeftFunctionCallString("Integer.parseInt", parameters); case STRTOFLOAT: return getLeftFunctionCallString("Float.parseFloat", parameters); case STRTODOUBLE: return getLeftFunctionCallString("Double.parseDouble", parameters); case STRTOLONG: return getLeftFunctionCallString("Long.parseLong", parameters); default: throw new IllegalStateException("should not reach here."); } }

Target:
public String getJavaString(final ExpressionOperatorParameter parameters) { final Type castFrom = getLeft().getOutputType(parameters); final Type castTo = getRight().getOutputType(parameters); switch (getCastType(castFrom, castTo)) { case LONG_TO_INT: return getLeftFunctionCallString("com.google.common.primitives.Ints.checkedCast", parameters); case FLOATS_TO_INT: return getLeftFunctionCallWithParameterString("com.google.common.math.DoubleMath.roundToInt", parameters, "java.math.RoundingMode.DOWN"); case INT_OR_LONG_TO_FLOAT: return getPrimitiveTypeCastString("float", parameters); case DOUBLE_TO_FLOAT: return getLeftFunctionCallString("edu.washington.escience.myria.util.MathUtils.castDoubleToFloat", parameters); case NUM_TO_DOUBLE: return getPrimitiveTypeCastString("double", parameters); case INT_TO_LONG: return getPrimitiveTypeCastString("long", parameters); case FLOATS_TO_LONG: return getLeftFunctionCallWithParameterString("com.google.common.math.DoubleMath.roundToLong", parameters, "java.math.RoundingMode.DOWN"); case TO_STR: return getLeftFunctionCallString("String.valueOf", parameters); case STR_TO_INT: return getLeftFunctionCallString("Integer.parseInt", parameters); case STR_TO_FLOAT: return getLeftFunctionCallString("Float.parseFloat", parameters); case STR_TO_DOUBLE: return getLeftFunctionCallString("Double.parseDouble", parameters); case STR_TO_LONG: return getLeftFunctionCallString("Long.parseLong", parameters); default: throw new IllegalStateException("should not reach here."); } }
Source:
public Navigate toPage(String pageName) { String query = getQueryParams(pageName); driver.get(urlBuilder.getUrlForWiki() + "/wiki/" + pageName + query); return this; }

Target:
public Navigate toPage(String pageName) { String query = getQueryParams(pageName); driver.get(urlBuilder.getUrlForWiki() + URLsContent.WIKI_DIR + pageName + query); return this; }
Source:
private Boolean shouldIncludeUnavailableModifier(final SwiftParser.CodeBlockContext ctx) { if (ctx == null || ctx.statements() == null) { return false; } final List<SwiftParser.StatementContext> statements = ctx.statements().statement(); return statements.size() == 1 && FATAL_ERROR.equals(statements.get(0).getStart().getText()); }

Target:
private boolean shouldIncludeUnavailableModifier(final SwiftParser.CodeBlockContext ctx) { if (ctx == null || ctx.statements() == null) { return false; } final List<SwiftParser.StatementContext> statements = ctx.statements().statement(); return statements.size() == 1 && FATAL_ERROR.equals(statements.get(0).getStart().getText()); }
Source:
private void visitIfStatement(IfStatementTree ifTree) { if (!fieldNotInitializedTest(ifTree.condition())) { return; } ifConditionStack.add(ifTree.condition()); if (!insideCriticalSection() || !isNestedIfStatement()) { return; } patternDetected(ifTree); }

Target:
private void visitIfStatement(IfStatementTree ifTree) { if (insideCriticalSection()) { CheckedLocking parentIf = sameFieldAlreadyOnStack(ifConditionSymbolStack.peek()); if (parentIf.ifTree == ifTree) { return; } if (thenStmtInitializeField(ifTree.thenStatement(), parentIf.field) && !parentIf.field.isVolatile() && !isAssignedAtomically(parentIf.field)) { ImmutableList<JavaFileScannerContext.Location> flow = ImmutableList.of(new JavaFileScannerContext.Location("Double-checked locking", ifTree.ifKeyword())); reportIssue(parentIf.ifTree.ifKeyword(), "Remove this dangerous instance of double-checked locking.", flow, null); } } }
Source:
private void internalEndWithFailure() { log.error("Ending command '{}' with failure.", getClass().getName()); endWithFailure(); rollbackQuota(); if (getCommandCompensationPhase() == CommandCompensationPhase.END_COMMAND) { compensate(); } }

Target:
private void internalEndWithFailure() { log.error("Ending command '{}' with failure.", getClass().getName()); try { endWithFailure(); } finally { if (getCommandCompensationPhase() == CommandCompensationPhase.END_COMMAND) { compensate(); } } rollbackQuota(); }