auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void VisualEditorEditing_005_switchToSourceMode() { String articleName2 = PageContent.ARTICLE_NAME_PREFIX + base.getTimeStamp(); VisualEditorPageObject ve = base.openVEOnArticle(wikiURL, articleName2); ve.verifyVEToolBarPresent(); ve.verifyEditorSurfacePresent(); ve = ve.typeInSourceEditor(text); VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton(); VisualEditorReviewChangesDialog reviewDialog = saveDialog.clickReviewYourChanges(); reviewDialog.verifyAddedDiffs(firstSourceEditText); ve = reviewDialog.closeDialog(); ve.verifyVEToolBarPresent(); ve.verifyEditorSurfacePresent(); ve = ve.typeInSourceEditor(text); saveDialog = ve.clickPublishButton(); reviewDialog = saveDialog.clickReviewYourChanges(); reviewDialog.verifyAddedDiffs(secondSourceEditText); saveDialog = reviewDialog.clickReturnToSaveFormButton(); ArticlePageObject article = saveDialog.savePage(); article.verifyVEPublishComplete(); }

Target:
public void VisualEditorEditing_005_switchToSourceMode() { String articleName2 = PageContent.ARTICLE_NAME_PREFIX + base.getTimeStamp(); VisualEditorPageObject ve = base.openVEOnArticle(wikiURL, articleName2); ve.verifyVEToolBarPresent(); ve.verifyEditorSurfacePresent(); ve = ve.typeInSourceEditor(text); VisualEditorSaveChangesDialog saveDialog = ve.clickPublishButton(); VisualEditorReviewChangesDialog reviewDialog = saveDialog.clickReviewYourChanges(); reviewDialog.verifyAddedDiffs(firstSourceEditText); ve = reviewDialog.closeDialog(); ve.verifyVEToolBarPresent(); ve.verifyEditorSurfacePresent(); ve = ve.typeInSourceEditor(text); saveDialog = ve.clickPublishButton(); reviewDialog = saveDialog.clickReviewYourChanges(); reviewDialog.verifyAddedDiffs(secondSourceEditText); saveDialog = reviewDialog.clickReturnToSaveFormButton(); ArticlePageObject article = saveDialog.savePage(); article.verifyVEPublishComplete(); article.verifyContent(text); }
Source:
public void drop() throws IOException { closeTree(); fileSystem.deleteFile( storeFile ); }

Target:
public void drop() throws IOException { closeTree(); fileSystem.deleteFileOrThrow( storeFile ); }
Source:
protected String generateHelpMessage() { StringBuilder sb = new StringBuilder(); sb.append( "Fake News Categories (example: !fakenews canada):" ); sb.append( "\n" ); sb.append( " { canada }" ); sb.append( " { usa }" ); sb.append( " { belgium }" ); sb.append( " { france }" ); sb.append( " { russia }" ); sb.append( " { serbia }" ); sb.append( " { venezuela }" ); sb.append( " { newzealand }" ); sb.append( " { india }" ); return sb.toString(); }

Target:
protected String generateHelpMessage() { StringBuilder sb = new StringBuilder(); sb.append( "Fake News Categories (example: !fakenews canada):" ); sb.append( "\n" ); for ( String category : fakeNewsFeedsByCategory.keySet() ) { sb.append( " { " + category + " }" ); } return sb.toString(); }
Source:
protected void validateAssertion(final SamlAssertionWrapper assertion) throws WSSecurityException { if (assertion.getSaml1() != null) { assertion.validateSignatureAgainstProfile(); } else if (assertion.getSaml2() != null) { final Issuer issuer = assertion.getSaml2().getIssuer(); validateIssuer(issuer); try { for (final Saml2ExchangeAuthFrameworkValidator validator : getSaml2SpecValidators()) { validator.validateAssertion(assertion); } } catch (final WSSecurityException e) { LOG.error("Saml Validation error: " + e.getMessage(), e); throw new WSSecurityException(ErrorCode.FAILED_CHECK, "invalidSAMLsecurity"); } } }

Target:
protected void validateAssertion(final SamlAssertionWrapper assertion) throws WSSecurityException { if (assertion.getSaml1() != null) { assertion.validateSignatureAgainstProfile(); } else if (assertion.getSaml2() != null) { final Issuer issuer = assertion.getSaml2().getIssuer(); validateIssuer(issuer); try { for (final Saml2ExchangeAuthFrameworkValidator validator : getSaml2SpecValidators()) { validator.validateAssertion(assertion); } } catch (final WSSecurityException e) { LOG.error("Saml Validation error: {}", e.getLocalizedMessage(), e); throw new WSSecurityException(ErrorCode.FAILED_CHECK, "invalidSAMLsecurity"); } } }
Source:
protected PsiFile createFile(String name, @NotNull String templateName, @NotNull PsiDirectory dir) { FileTemplate template = FileTemplateManager.getInstance(dir.getProject()).getInternalTemplate(templateName); Properties properties = new Properties(); Collection<String> packages = GoUtil.getAllPackagesInDirectory(dir); String packageName = packages.isEmpty() ? GoPsiImplUtil.makePackageNameValid(ContainerUtil.getLastItem(StringUtil.split(dir.getName(), "-"))) : ArrayUtil.toStringArray(packages)[0]; if (name.endsWith(GoConstants.TEST_SUFFIX_WITH_EXTENSION) || name.endsWith(GoConstants.TEST_SUFFIX)) { packageName += GoConstants.TEST_SUFFIX; } properties.setProperty(PACKAGE, packageName); try { PsiElement element = FileTemplateUtil.createFromTemplate(template, name, properties, dir); if (element instanceof PsiFile) return (PsiFile)element; } catch (Exception e) { LOG.warn(e); return null; } return super.createFile(name, templateName, dir); }

Target:
protected PsiFile createFile(String name, @NotNull String templateName, @NotNull PsiDirectory dir) { FileTemplate template = FileTemplateManager.getInstance(dir.getProject()).getInternalTemplate(templateName); Properties properties = new Properties(); Collection<String> packages = GoUtil.getAllPackagesInDirectory(dir); String packageName = packages.isEmpty() ? GoPsiImplUtil.getLocalPackageName(dir.getName()) : ContainerUtil.getFirstItem(packages); if (name.endsWith(GoConstants.TEST_SUFFIX) || name.endsWith(GoConstants.TEST_SUFFIX_WITH_EXTENSION)) { packageName += GoConstants.TEST_SUFFIX; } properties.setProperty(PACKAGE, packageName); try { PsiElement element = FileTemplateUtil.createFromTemplate(template, name, properties, dir); if (element instanceof PsiFile) return (PsiFile)element; } catch (Exception e) { LOG.warn(e); return null; } return super.createFile(name, templateName, dir); }
Source:
private boolean consumeOne(final byte[] body) { try { maybePrepareToCommitConsumerOffsets(); final FutureReporter.Context consumptionContext = reporter.reportConsumption(); final AsyncFuture<Void> future = schema.consume(body); threadLocalSequenceNumber++; final Long sequenceNumber = new Long(threadLocalSequenceNumber); if (enablePeriodicCommit) { outstandingConsumptionRequests.add(sequenceNumber); } future.onFinished(() -> { if (enablePeriodicCommit) { outstandingConsumptionRequests.remove(sequenceNumber); if (outstandingConsumptionRequests.size() == 0) { coordinator.commitConsumerOffsets(); } } }); future.onDone(consumptionContext); reporter.reportMessageSize(body.length); consumed.increment(); return false; } catch (final ConsumerSchemaValidationException e) { reporter.reportConsumerSchemaError(); return false; } catch (final Exception e) { errors.incrementAndGet(); log.error("{}: Failed to consume", name, e); reporter.reportMessageError(); return true; } }

Target:
private boolean consumeOne(final byte[] body) { try { maybePrepareToCommitConsumerOffsets(); final FutureReporter.Context consumptionContext = reporter.reportConsumption(); final AsyncFuture<Void> future = schema.consume(body); if (enablePeriodicCommit) { final Long sequenceNumber = ++threadLocalSequenceNumber; outstandingConsumptionRequests.put(sequenceNumber, true); future.onFinished(() -> { outstandingConsumptionRequests.remove(sequenceNumber); if (outstandingConsumptionRequests.size() == 0) { coordinator.commitConsumerOffsets(); } }); } future.onDone(consumptionContext); reporter.reportMessageSize(body.length); consumed.increment(); return false; } catch (final ConsumerSchemaValidationException e) { reporter.reportConsumerSchemaError(); return false; } catch (final Exception e) { errors.incrementAndGet(); log.error("{}: Failed to consume", name, e); reporter.reportMessageError(); return true; } }
Source:
public InfluxdbEmitter(InfluxdbEmitterConfig influxdbEmitterConfig) { this.influxdbEmitterConfig = influxdbEmitterConfig; this.influxdbClient = HttpClientBuilder.create().build(); this.eventsQueue = new LinkedBlockingQueue<>(influxdbEmitterConfig.getMaxQueueSize()); this.dimensionWhiteList = ImmutableSet.of( "dataSource", "type", "numMetrics", "numDimensions", "threshold", "dimension", "taskType", "taskStatus", "tier" ); log.info("constructing influxdb emitter"); }

Target:
public InfluxdbEmitter(InfluxdbEmitterConfig influxdbEmitterConfig) { this.influxdbEmitterConfig = influxdbEmitterConfig; this.influxdbClient = HttpClientBuilder.create().build(); this.eventsQueue = new LinkedBlockingQueue<>(influxdbEmitterConfig.getMaxQueueSize()); this.dimensionWhiteList = influxdbEmitterConfig.getDimensionWhitelist(); log.info("constructed influxdb emitter"); }
Source:
public void build_createANewRadiologyOrderSearchCriteriaInstanceWithFromEffectiveStartDateIfFromEffectiveStartDateIsSet() throws Exception { DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Date fromEffectiveStartDate = format.parse("2016-05-01"); radiologyOrderSearchCriteria = new RadiologyOrderSearchCriteria.Builder().withFromEffectiveStartDate(fromEffectiveStartDate) .build(); assertTrue(radiologyOrderSearchCriteria.getFromEffectiveStartDate() .equals(fromEffectiveStartDate)); assertNull(radiologyOrderSearchCriteria.getPatient()); assertFalse(radiologyOrderSearchCriteria.getIncludeVoided()); assertNull(radiologyOrderSearchCriteria.getUrgency()); assertNull(radiologyOrderSearchCriteria.getToEffectiveStartDate()); }

Target:
public void build_createANewRadiologyOrderSearchCriteriaInstanceWithFromEffectiveStartDateIfFromEffectiveStartDateIsSet() throws Exception { DateFormat format = new SimpleDateFormat("yyyy-MM-dd"); Date fromEffectiveStartDate = format.parse("2016-05-01"); radiologyOrderSearchCriteria = new RadiologyOrderSearchCriteria.Builder().withFromEffectiveStartDate(fromEffectiveStartDate) .build(); assertThat(radiologyOrderSearchCriteria.getFromEffectiveStartDate(), is(fromEffectiveStartDate)); assertNull(radiologyOrderSearchCriteria.getPatient()); assertFalse(radiologyOrderSearchCriteria.getIncludeVoided()); assertNull(radiologyOrderSearchCriteria.getUrgency()); assertNull(radiologyOrderSearchCriteria.getToEffectiveStartDate()); }
Source:
public static void setupBeforeClass() { Map<String, String> config = new HashMap<>(); rangerAuthorizer = new RangerAuthorizer(null, null, false, null); }

Target:
public static void setupBeforeClass() { rangerAuthorizer = new RangerAuthorizer(null, null, false, new Configuration()); }
Source:
private void clientInvalidated(ClientDescriptor clientDescriptor, int invalidationId) { InvalidationHolder invalidationHolder = clientsWaitingForInvalidation.get(invalidationId); if (stores.get(invalidationHolder.cacheId).getStoreConfiguration().getConsistency() == Consistency.STRONG) { invalidationHolder.clientsHavingToInvalidate.remove(clientDescriptor); if (invalidationHolder.clientsHavingToInvalidate.isEmpty()) { clientsWaitingForInvalidation.remove(invalidationId); try { clientCommunicator.sendNoResponse(invalidationHolder.clientDescriptorWaitingForInvalidation, EhcacheEntityResponse.invalidationDone(invalidationHolder.cacheId, invalidationHolder.key)); LOGGER.debug("SERVER: notifying originating client that all other clients invalidated key in cache from (ID {})", invalidationHolder.key, invalidationHolder.cacheId, clientDescriptor, invalidationId); } catch (MessageCodecException mce) { LOGGER.error("Codec error", mce); } } } }

Target:
private void clientInvalidated(ClientDescriptor clientDescriptor, int invalidationId) { InvalidationHolder invalidationHolder = clientsWaitingForInvalidation.get(invalidationId); if (stores.get(invalidationHolder.cacheId).getStoreConfiguration().getConsistency() == Consistency.STRONG) { invalidationHolder.clientsHavingToInvalidate.remove(clientDescriptor); if (invalidationHolder.clientsHavingToInvalidate.isEmpty()) { if (clientsWaitingForInvalidation.remove(invalidationId) != null) { try { clientCommunicator.sendNoResponse(invalidationHolder.clientDescriptorWaitingForInvalidation, EhcacheEntityResponse.invalidationDone(invalidationHolder.cacheId, invalidationHolder.key)); LOGGER.debug("SERVER: notifying originating client that all other clients invalidated key in cache from (ID {})", invalidationHolder.key, invalidationHolder.cacheId, clientDescriptor, invalidationId); } catch (MessageCodecException mce) { LOGGER.error("Codec error", mce); } } } } }
Source:
private HostScore calculateHostScore(HostState host, double clusterMaxMeanActive, double clusterMaxDiskUsed) { double score = 0; double meanActive = host.getMeanActiveTasks(); double usedDiskPercent = getUsedDiskPercent(host); long diskFreeBytes = host.getMax().getDisk() - host.getUsed().getDisk(); if (clusterMaxMeanActive <= 0) { meanActive = 1; clusterMaxMeanActive = 1; } if (clusterMaxDiskUsed <= 0) { usedDiskPercent = 1; clusterMaxDiskUsed = 1; } int activeTaskWeight = config.getActiveTaskWeight(); int diskUsedWeight = config.getDiskUsedWeight(); score += activeTaskWeight * Math.pow(meanActive / clusterMaxMeanActive, 2.5); score += diskUsedWeight * Math.pow(usedDiskPercent / clusterMaxDiskUsed, 2.5); score = Math.max(score, (activeTaskWeight + diskUsedWeight) * usedDiskPercent); return new HostScore(meanActive, usedDiskPercent, diskFreeBytes, score); }

Target:
private HostScore calculateHostScore(HostState host, double clusterMaxMeanActive, double clusterMaxDiskUsed) { double score = 0; double meanActive = host.getMeanActiveTasks(); double usedDiskPercent = getUsedDiskPercent(host); if (clusterMaxMeanActive <= 0) { meanActive = 1; clusterMaxMeanActive = 1; } if (clusterMaxDiskUsed <= 0) { usedDiskPercent = 1; clusterMaxDiskUsed = 1; } int activeTaskWeight = config.getActiveTaskWeight(); int diskUsedWeight = config.getDiskUsedWeight(); score += activeTaskWeight * Math.pow(meanActive / clusterMaxMeanActive, 2.5); score += diskUsedWeight * Math.pow(usedDiskPercent / clusterMaxDiskUsed, 2.5); score = Math.max(score, (activeTaskWeight + diskUsedWeight) * usedDiskPercent); return new HostScore(meanActive, usedDiskPercent, score); }
Source:
public void customize() { List<String> commands = Lists.newLinkedList(); String gitRepoUrl = getEntity().getConfig(NodeJsWebAppService.APP_GIT_REPOSITORY_URL); String archiveUrl = getEntity().getConfig(NodeJsWebAppService.APP_ARCHIVE_URL); String appName = getEntity().getConfig(NodeJsWebAppService.APP_NAME); if (Strings.isNonBlank(gitRepoUrl) && Strings.isNonBlank(archiveUrl)) { throw new IllegalStateException("Only one of Git or archive URL must be set"); } else if (Strings.isNonBlank(gitRepoUrl)) { commands.add(String.format("git clone %s %s", gitRepoUrl, appName)); } else if (Strings.isNonBlank(archiveUrl)) { ArchiveUtils.deploy(archiveUrl, getMachine(), getRunDir()); } else { throw new IllegalStateException("At least one of Git or archive URL must be set"); } newScript(CUSTOMIZING) .body.append(commands) .execute(); }

Target:
public void customize() { List<String> commands = Lists.newLinkedList(); String gitRepoUrl = getEntity().getConfig(NodeJsWebAppService.APP_GIT_REPOSITORY_URL); String archiveUrl = getEntity().getConfig(NodeJsWebAppService.APP_ARCHIVE_URL); String appName = getEntity().getConfig(NodeJsWebAppService.APP_NAME); if (Strings.isNonBlank(gitRepoUrl) && Strings.isNonBlank(archiveUrl)) { throw new IllegalStateException("Only one of Git or archive URL must be set for " + getEntity()); } else if (Strings.isNonBlank(gitRepoUrl)) { commands.add(String.format("git clone %s %s", gitRepoUrl, appName)); } else if (Strings.isNonBlank(archiveUrl)) { ArchiveUtils.deploy(archiveUrl, getMachine(), getRunDir()); } else { throw new IllegalStateException("At least one of Git or archive URL must be set for " + getEntity()); } newScript(CUSTOMIZING) .body.append(commands) .execute(); }
Source:
public AccessToken(String token, OffsetDateTime expiresAt) { this.token = token; this.expiresAt = expiresAt; }

Target:
public AccessToken(String token, OffsetDateTime expiresAt) { this.token = token; this.expiresAt = expiresAt.minusMinutes(2); }
Source:
private void onActivePhoneSwitch() { for (HashMap.Entry<NetworkRequest, Integer> entry : mNetworkRequests.entrySet()) { NetworkRequest networkRequest = entry.getKey(); boolean applied = entry.getValue() != -1; boolean shouldApply = mPhoneSwitcher.shouldApplyNetworkRequest( networkRequest, mPhone.getPhoneId()); int action = getAction(applied, shouldApply); if (action == ACTION_NO_OP) continue; String logStr = "onActivePhoneSwitch: " + ((action == ACTION_REQUEST) ? "Requesting" : "Releasing") + " network request " + networkRequest; mLocalLog.log(logStr); int transportType = getTransportTypeFromNetworkRequest(networkRequest); if (action == ACTION_REQUEST) { requestNetworkInternal(networkRequest, DcTracker.REQUEST_TYPE_NORMAL, getTransportTypeFromNetworkRequest(networkRequest)); } else if (action == ACTION_RELEASE) { int transport = getTransportTypeFromNetworkRequest(networkRequest); releaseNetworkInternal(networkRequest, DcTracker.RELEASE_TYPE_DETACH, transport); } mNetworkRequests.put(networkRequest, shouldApply ? transportType : -1); } }

Target:
private void onActivePhoneSwitch() { for (HashMap.Entry<NetworkRequest, Integer> entry : mNetworkRequests.entrySet()) { NetworkRequest networkRequest = entry.getKey(); boolean applied = entry.getValue() != TransportType.INVALID; boolean shouldApply = mPhoneSwitcher.shouldApplyNetworkRequest( networkRequest, mPhone.getPhoneId()); int action = getAction(applied, shouldApply); if (action == ACTION_NO_OP) continue; String logStr = "onActivePhoneSwitch: " + ((action == ACTION_REQUEST) ? "Requesting" : "Releasing") + " network request " + networkRequest; mLocalLog.log(logStr); int transportType = getTransportTypeFromNetworkRequest(networkRequest); if (action == ACTION_REQUEST) { requestNetworkInternal(networkRequest, DcTracker.REQUEST_TYPE_NORMAL, getTransportTypeFromNetworkRequest(networkRequest), null); } else if (action == ACTION_RELEASE) { int transport = getTransportTypeFromNetworkRequest(networkRequest); releaseNetworkInternal(networkRequest, DcTracker.RELEASE_TYPE_DETACH, transport); } mNetworkRequests.put(networkRequest, shouldApply ? transportType : TransportType.INVALID); } }
Source:
public void publish(JSONObject transcript) { String uglyJSON = transcript.toJSONString(); String prettyJSOn = new GsonBuilder().setPrettyPrinting().create(). toJson(new JsonParser().parse(uglyJSON)); new LocalTxtTranscriptHandler().publish(prettyJSOn); }

Target:
public void publish(JSONObject transcript) { new LocalTxtTranscriptHandler().publish(transcript.toString()); }
Source:
public void onSupportActionModeStarted(ActionMode mode) { boolean wasCabOpen = isCabOpen(); currentActionMode = new CompatActionMode(mode, wasCabOpen); if (currentActionMode.shouldInjectCustomMenu(PageActivity.this)) { currentActionMode.injectCustomMenu(PageActivity.this); } prepareActionMode(); super.onSupportActionModeStarted(mode); }

Target:
public void onSupportActionModeStarted(ActionMode mode) { if (!isCabOpen()) { conditionallyInjectCustomCabMenu(mode); } freezeToolbar(); super.onSupportActionModeStarted(mode); }
Source:
public static InstallationChecker getInstance() throws ProvisionException { if (INSTANCE == null) { INSTANCE = new InstallationChecker(); } return INSTANCE; }

Target:
public synchronized static InstallationChecker getInstance() throws ProvisionException { if (INSTANCE == null) { INSTANCE = new InstallationChecker(); } return INSTANCE; }
Source:
public void run() { LogManager.logDebug("Start run", this); IWorkbench wb = PlatformUI.getWorkbench(); ISelection incoming = viewer.getViewer().getSelection(); IStructuredSelection selection = (IStructuredSelection)incoming; Object o = selection.getFirstElement(); if(o instanceof TreeNode) { TreeNode t = (TreeNode)o; if(t.isClickable()) { IFileStore fs = (IFileStore)t.getData(); if (fs != null) { IEditorInput input= createEditorInput(fs); String editorId= getEditorId(fs); try { IEditorPart editor = wb.getActiveWorkbenchWindow().getActivePage().getActiveEditor(); if(editor instanceof STPEditor) IDESessionSettings.setActiveSTPEditor((STPEditor) editor); wb.getActiveWorkbenchWindow().getActivePage().openEditor(input, editorId); LogManager.logDebug("Editor opened", this); } catch (PartInitException e) { LogManager.logCritical("PartInitException run: " + e.getMessage(), this); e.printStackTrace(); } } } else { expandAction.run(); } } LogManager.logDebug("End run", this); }

Target:
public void run() { LogManager.logDebug("Start run", this); IWorkbench wb = PlatformUI.getWorkbench(); ISelection incoming = viewer.getViewer().getSelection(); IStructuredSelection selection = (IStructuredSelection)incoming; Object o = selection.getFirstElement(); if(o instanceof TreeNode) { TreeNode t = (TreeNode)o; if(t.isClickable()) { IFileStore fs = (IFileStore)t.getData(); if (fs != null) { IEditorInput input= createEditorInput(fs); try { IEditorPart editor = wb.getActiveWorkbenchWindow().getActivePage().getActiveEditor(); if(editor instanceof STPEditor) IDESessionSettings.activeSTPEditor = (STPEditor)editor; wb.getActiveWorkbenchWindow().getActivePage().openEditor(input, CEditor.ID); LogManager.logDebug("Editor opened", this); } catch (PartInitException e) { LogManager.logCritical("PartInitException run: " + e.getMessage(), this); } } } else { expandAction.run(); } } LogManager.logDebug("End run", this); }
Source:
public void withBothFirstResultAndFirstResultExpressionPresent() { try { this.context = new ClassPathXmlApplicationContext("JpaInvalidOutboundGatewayParserTests.xml", getClass()); } catch (BeanDefinitionStoreException e) { assertTrue(e.getMessage().startsWith("Configuration problem: Only one of 'first-result' or 'first-result-expression' is allowed")); return; } assertTrue(false); }

Target:
public void withBothFirstResultAndFirstResultExpressionPresent() { try { this.context = new ClassPathXmlApplicationContext("JpaInvalidOutboundGatewayParserTests.xml", getClass()); } catch (BeanDefinitionStoreException e) { assertTrue(e.getMessage().startsWith("Configuration problem: Only one of 'first-result' or 'first-result-expression' is allowed")); return; } fail("BeanDefinitionStoreException expected."); }
Source:
public Object[] getParameters() { switch (control) { case START_SEND: case FINISH_SEND: case CANCEL_SEND: return new Object[]{control.toByte(), siteName}; } return new Object[]{control.toByte()}; }

Target:
public Object[] getParameters() { return new Object[]{control, siteName}; }
Source:
public void setVms(ListModel<Pair<String, VM>> vms) { this.vms = vms; }

Target:
private void setVms(ListModel<Pair<String, VM>> vms) { this.vms = vms; }
Source:
private JAXBElement<RegistryObjectType> createIdentifiable(RegistryObjectType registryObjectType) { JAXBElement<RegistryObjectType> i = new JAXBElement<>(new QName( "urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0", "Identifiable"), RegistryObjectType.class, registryObjectType); return i; }

Target:
private JAXBElement<RegistryObjectType> createIdentifiable(RegistryObjectType registryObjectType) { return new JAXBElement<>(new QName( "urn:oasis:names:tc:ebxml-regrep:xsd:rim:3.0", "Identifiable"), RegistryObjectType.class, registryObjectType); }
Source:
private synchronized void createGroupIfNecessary(ResourceGroupId id, QueryExecution queryExecution, Executor executor) { Session session = queryExecution.getSession(); SelectionContext context = new SelectionContext(session.getIdentity().getPrincipal().isPresent(), session.getUser(), session.getSource(), getQueryPriority(session), queryExecution instanceof DataDefinitionExecution); if (!groups.containsKey(id)) { InternalResourceGroup group; if (id.getParent().isPresent()) { createGroupIfNecessary(id.getParent().get(), queryExecution, executor); InternalResourceGroup parent = groups.get(id.getParent().get()); requireNonNull(parent, "parent is null"); group = parent.getOrCreateSubGroup(id.getLastSegment()); } else { RootInternalResourceGroup root = new RootInternalResourceGroup(id.getSegments().get(0), this::exportGroup, executor); group = root; rootGroups.add(root); } configurationManager.get().configure(group, context); checkState(groups.put(id, group) == null, "Unexpected existing resource group"); } }

Target:
private synchronized void createGroupIfNecessary(ResourceGroupId id, QueryExecution queryExecution, Executor executor) { Session session = queryExecution.getSession(); SelectionContext context = new SelectionContext( session.getIdentity().getPrincipal().isPresent(), session.getUser(), session.getSource(), getQueryPriority(session), determineQueryType(queryExecution)); if (!groups.containsKey(id)) { InternalResourceGroup group; if (id.getParent().isPresent()) { createGroupIfNecessary(id.getParent().get(), queryExecution, executor); InternalResourceGroup parent = groups.get(id.getParent().get()); requireNonNull(parent, "parent is null"); group = parent.getOrCreateSubGroup(id.getLastSegment()); } else { RootInternalResourceGroup root = new RootInternalResourceGroup(id.getSegments().get(0), this::exportGroup, executor); group = root; rootGroups.add(root); } configurationManager.get().configure(group, context); checkState(groups.put(id, group) == null, "Unexpected existing resource group"); } }
Source:
public SimpleFieldSet getFieldSet() { SimpleFieldSet fs = new SimpleFieldSet(true); fs.put("Total", event.totalBlocks); fs.put("Required", event.minSuccessfulBlocks); fs.put("Failed", event.failedBlocks); fs.put("FatallyFailed", event.fatallyFailedBlocks); fs.put("LatestFailure", event.latestFailure != null ? event.latestFailure.getTime() : 0); fs.put("Succeeded",event.succeedBlocks); fs.put("LatestSuccess", event.latestSuccess != null ? event.latestSuccess.getTime() : 0); fs.put("FinalizedTotal", event.finalizedTotal); if(event.minSuccessFetchBlocks != 0) fs.put("MinSuccessFetchBlocks", event.minSuccessFetchBlocks); fs.putSingle("Identifier", ident); fs.put("Global", global); return fs; }

Target:
public SimpleFieldSet getFieldSet() { SimpleFieldSet fs = new SimpleFieldSet(true); fs.put("Total", event.totalBlocks); fs.put("Required", event.minSuccessfulBlocks); fs.put("Failed", event.failedBlocks); fs.put("FatallyFailed", event.fatallyFailedBlocks); fs.put("Succeeded",event.succeedBlocks); fs.put("LastProgress", event.latestSuccess != null ? event.latestSuccess.getTime() : 0); fs.put("FinalizedTotal", event.finalizedTotal); if(event.minSuccessFetchBlocks != 0) fs.put("MinSuccessFetchBlocks", event.minSuccessFetchBlocks); fs.putSingle("Identifier", ident); fs.put("Global", global); return fs; }
Source:
public void putNext(Tuple t) throws IOException { if (t == null) { log.warn("Null tuple found; Skipping tuple"); return; } Preconditions.checkArgument(2 <= t.size(), "Expected tuple size >= 2 but found size %s", t.size()); Object pigKey = t.get(0); if (pigKey == null) { log.warn("Null key found; Skipping tuple"); return; } Object pigValue = t.get(1); if (pigValue == null) { log.warn("Null value found; Skipping tuple"); return; } K key = keyConverter.toWritable(pigKey); V value = valueConverter.toWritable(pigValue); try { writer.write(key, value); } catch (InterruptedException e) { throw new IOException(e); } }

Target:
public void putNext(Tuple t) throws IOException { if (t == null) { counterHelper.incrCounter(Error.NULL_TUPLE, 1); return; } K key = keyConverter.toWritable(t.get(0)); if (key == null) { counterHelper.incrCounter(Error.NULL_KEY, 1); return; } V value = valueConverter.toWritable(t.get(1)); if (value == null) { counterHelper.incrCounter(Error.NULL_VALUE, 1); return; } try { writer.write(key, value); } catch (InterruptedException e) { throw new IOException(e); } }
Source:
private int numberOfEntries(ByteBuffer mmap) { return (mmap.capacity() - INDEX_SIZE_EXCLUDING_ENTRIES - (version == (short) 1 ? (resetKey.getFirst().sizeInBytes() + RESET_KEY_TYPE_FIELD_LENGTH + LAST_MODIFIED_TIME_FIELD_LENGTH) : 0)) / (keySize + valueSize); }

Target:
private int numberOfEntries(ByteBuffer mmap) { return (mmap.capacity() - indexSizeExcludingEntries) / (keySize + valueSize); }
Source:
protected boolean isDocument(HttpResponseHeader responseHeader) { return responseHeader.getHeaders().stream() .filter(header -> "Content-Type".equalsIgnoreCase(header.getName())) .anyMatch( header -> header.getValue().startsWith("text/html") || header.getValue().startsWith("application/xml")); }

Target:
protected boolean isDocument(HttpResponseHeader responseHeader) { return responseHeader.getHeaderValues(HttpHeader.CONTENT_TYPE).stream() .anyMatch( header -> header.startsWith("text/html") || header.startsWith("application/xml")); }
Source:
public <T> boolean putMapping(Class<T> clazz) { if (clazz.isAnnotationPresent(Mapping.class)) { String mappingPath = clazz.getAnnotation(Mapping.class).mappingPath(); if (!StringUtils.isEmpty(mappingPath)) { String mappings = readFileFromClasspath(mappingPath); if (!StringUtils.isEmpty(mappings)) { return putMapping(clazz, mappings); } } else { LOGGER.info("mappingPath in @Mapping has to be defined. Building mappings using @Field"); } } try { final MappingBuilder mappingBuilder = new MappingBuilder(elasticsearchConverter); return putMapping(clazz, mappingBuilder.buildMapping(clazz)); } catch (Exception e) { throw new ElasticsearchException("Failed to build mapping for " + clazz.getSimpleName(), e); } }

Target:
public <T> boolean putMapping(Class<T> clazz) { if (clazz.isAnnotationPresent(Mapping.class)) { String mappingPath = clazz.getAnnotation(Mapping.class).mappingPath(); if (!StringUtils.isEmpty(mappingPath)) { String mappings = readFileFromClasspath(mappingPath); if (!StringUtils.isEmpty(mappings)) { return putMapping(clazz, mappings); } } else { LOGGER.info("mappingPath in @Mapping has to be defined. Building mappings using @Field"); } } try { MappingBuilder mappingBuilder = new MappingBuilder(elasticsearchConverter); return putMapping(clazz, mappingBuilder.buildMapping(clazz)); } catch (Exception e) { throw new ElasticsearchException("Failed to build mapping for " + clazz.getSimpleName(), e); } }
Source:
public String toString() { long columnCount = getColumnCount(); String name = getName(); StringBuilder stringBuilder = new StringBuilder("Table "); if (name != null && !name.isEmpty()) { stringBuilder.append(getName()); stringBuilder.append(" "); } stringBuilder.append("contains "); stringBuilder.append(columnCount); stringBuilder.append(" columns: "); for (int i = 0; i < columnCount; i++) { if (i != 0) { stringBuilder.append(", "); } stringBuilder.append(getColumnName(i)); } stringBuilder.append("."); stringBuilder.append(" And "); stringBuilder.append(size()); stringBuilder.append(" rows."); return stringBuilder.toString(); }

Target:
public String toString() { long columnCount = getColumnCount(); String name = getName(); StringBuilder stringBuilder = new StringBuilder("The Table "); if (name != null && !name.isEmpty()) { stringBuilder.append(getName()); stringBuilder.append(" "); } stringBuilder.append("contains "); stringBuilder.append(columnCount); stringBuilder.append(" columns: "); for (int i = 0; i < columnCount; i++) { if (i != 0) { stringBuilder.append(", "); } stringBuilder.append(getColumnName(i)); } stringBuilder.append("."); stringBuilder.append(" And "); stringBuilder.append(size()); stringBuilder.append(" rows."); return stringBuilder.toString(); }
Source:
public void shouldReturnModifiedValuesMap() { assertThat(HashMap.of(1, "1").put(2, "2").mapValues(Integer::parseInt)).isEqualTo(HashMap.of(1, 1).put(2, 2)); }

Target:
public void shouldReturnModifiedValuesMap() { assertThat(emptyIntString().put(1, "1").put(2, "2").mapValues(Integer::parseInt)).isEqualTo(emptyMap().put(1, 1).put(2, 2)); }
Source:
private double getFreespeed(Map<String, String> tags, double linkLength, LinkProperties properties) { if (tags.containsKey(OsmTags.MAXSPEED)) { double maxSpeed = parseSpeedTag(tags.get(OsmTags.MAXSPEED), properties); return adjustFreeSpeed ? LinkProperties.calculateSpeedIfSpeedTag(maxSpeed) : maxSpeed; } else { return LinkProperties.calculateSpeedIfNoSpeedTag(linkLength, properties); } }

Target:
private double getFreespeed(Map<String, String> tags, double linkLength, LinkProperties properties) { if (tags.containsKey(OsmTags.MAXSPEED)) { double maxSpeed = parseSpeedTag(tags.get(OsmTags.MAXSPEED), properties); return LinkProperties.calculateSpeedIfSpeedTag(maxSpeed, freeSpeedFactor); } else { return LinkProperties.calculateSpeedIfNoSpeedTag(linkLength, properties); } }
Source:
public static <T> Optional<T> findFirstPresent(Supplier<Optional<T>>... suppliers) { return Stream.of(suppliers) .flatMap(supplier -> toStream(supplier.get())) .findFirst(); }

Target:
public static <T> Optional<T> findFirstPresent(Supplier<Optional<T>>... suppliers) { return Stream.of(suppliers) .flatMap(supplier -> stream(supplier.get())) .findFirst(); }
Source:
private void validateCompatibilityModeMigration(final EventType original, final EventTypeBase eventType, final List<SchemaChange> changes) throws InvalidEventTypeException { if (original.getCompatibilityMode() == CompatibilityMode.FIXED && eventType.getCompatibilityMode() == CompatibilityMode.COMPATIBLE) { final List<SchemaChange.Type> changesTypes = changes.stream().map(SchemaChange::getType) .collect(Collectors.toList()); if (!FIXED_TO_COMPATIBLE_ALLOWED_CHANGES.containsAll(changesTypes)) { final String errorMessage = changes.stream() .filter(change -> !FIXED_TO_COMPATIBLE_ALLOWED_CHANGES.contains(change.getType())) .map(this::formatErrorMessage) .collect(Collectors.joining(", ")); throw new InvalidEventTypeException("Invalid schema: " + errorMessage); } } }

Target:
private void validateCompatibilityModeMigration(final EventType original, final EventTypeBase eventType, final List<SchemaChange> changes) throws InvalidEventTypeException { if (original.getCompatibilityMode() == CompatibilityMode.FIXED && eventType.getCompatibilityMode() == CompatibilityMode.COMPATIBLE) { final List<SchemaChange> forbiddenChanges = changes.stream() .filter(change -> !FIXED_TO_COMPATIBLE_ALLOWED_CHANGES.contains(change.getType())) .collect(Collectors.toList()); if (!forbiddenChanges.isEmpty()) { final String errorMessage = forbiddenChanges.stream().map(this::formatErrorMessage) .collect(Collectors.joining(", ")); throw new InvalidEventTypeException("Invalid schema: " + errorMessage); } } }
Source:
private StorageDomain updateStorageDomainInMemoryVolumes(List<DiskImage> disksList) { List<DiskImage> memoryDisksList = MemoryUtils.createDiskDummies(VmDeviceUtils.getTotalMemorySizeInBytes(getVm()), MemoryUtils.METADATA_SIZE_IN_BYTES); StorageDomain storageDomain = MemoryStorageHandler.getInstance().findStorageDomainForMemory( getParameters().getStoragePoolId(), memoryDisksList, getVmDisksDummies(), getVm()); disksList.addAll(memoryDisksList); return storageDomain; }

Target:
private StorageDomain updateStorageDomainInMemoryVolumes(List<DiskImage> disksList) { List<DiskImage> memoryDisksList = MemoryUtils.createDiskDummies(VmUtils.getSnapshotMemorySizeInBytes(getVm()), MemoryUtils.METADATA_SIZE_IN_BYTES); StorageDomain storageDomain = MemoryStorageHandler.getInstance().findStorageDomainForMemory( getParameters().getStoragePoolId(), memoryDisksList, getVmDisksDummies(), getVm()); disksList.addAll(memoryDisksList); return storageDomain; }
Source:
public boolean hasNoErrors() { return !getMessages().stream().anyMatch(e -> e.getSeverity().equals(Severity.ERROR)); }

Target:
public boolean hasNoErrors() { return getMessages().stream().noneMatch(e -> e.getSeverity().equals(Severity.ERROR)); }
Source:
private static SupremeCourtJudgment createScJudgmentWithRandomData(String prefix, int numericPrefix){ SupremeCourtJudgment scJudgment = new SupremeCourtJudgment(); TestInMemoryObjectFactoryHelper.fillJudgmentWithRandomData(scJudgment, prefix, numericPrefix); scJudgment.getSourceInfo().setSourceCode(SourceCode.SUPREME_COURT); scJudgment.getSourceInfo().setSourceJudgmentId(prefix+RandomStringUtils.randomAlphabetic(20)); scJudgment.getSourceInfo().setSourceJudgmentUrl("<LINK_0>" + RandomStringUtils.randomAlphabetic(20)); scJudgment.setPersonnelType(getRandomScPersonnelType()); SupremeCourtJudgmentForm judgmentForm = new SupremeCourtJudgmentForm(); judgmentForm.setName(RandomStringUtils.randomAlphabetic(10)); scJudgment.setScJudgmentForm(judgmentForm); return scJudgment; }

Target:
private static SupremeCourtJudgment createScJudgmentWithRandomData(String prefix, int numericPrefix){ SupremeCourtJudgment scJudgment = new SupremeCourtJudgment(); TestInMemoryObjectFactoryHelper.fillJudgmentWithRandomData(scJudgment, prefix, numericPrefix); scJudgment.getSourceInfo().setSourceCode(SourceCode.SUPREME_COURT); scJudgment.setPersonnelType(getRandomScPersonnelType()); SupremeCourtJudgmentForm judgmentForm = new SupremeCourtJudgmentForm(); judgmentForm.setName(RandomStringUtils.randomAlphabetic(10)); scJudgment.setScJudgmentForm(judgmentForm); return scJudgment; }
Source:
private List<ValidationMessage> doValidation( final Path resourcePath, final InputStream inputStream ) throws NoProjectException { final ValidatorResultBuilder resultBuilder = new ValidatorResultBuilder(); final Builder builder = builderCache.assertBuilder( project( resourcePath ) ); if ( !builder.isBuilt() ) { builder.build(); } final Builder clone = builder.clone(); final IncrementalBuildResults incrementalBuildResults = clone.updateResource( Paths.convert( resourcePath ), inputStream ); if ( isIncrementalBuildPossible( resourcePath ) ) { resultBuilder.add( incrementalBuildResults.getAddedMessages() ); } else { resultBuilder.add( clone.build().getMessages() ); } return resultBuilder.results(); }

Target:
private List<ValidationMessage> doValidation( final Path resourcePath, final InputStream inputStream ) throws NoProjectException { final ValidatorResultBuilder resultBuilder = new ValidatorResultBuilder(); final Builder builder = builderCache.assertBuilder( project( resourcePath ) ); final org.uberfire.java.nio.file.Path nioResourcePath = Paths.convert( resourcePath ); if ( isIncrementalBuildPossible( resourcePath ) ) { if ( !builder.isBuilt() ) { builder.build(); } final Builder clone = builder.clone(); final IncrementalBuildResults incrementalBuildResults = clone.updateResource( nioResourcePath, inputStream ); resultBuilder.add( incrementalBuildResults.getAddedMessages() ); } else { final Builder clone = builder.clone(); resultBuilder.add( clone.build( nioResourcePath, inputStream ).getMessages() ); } return resultBuilder.results(); }
Source:
public void fetchLocation() throws Exception { Venue venue = new Venue(new VenueGroup("group"), new VenueType("type"), Lists.newArrayList(new VenueName("info", new Language("en")))); CivicLocation civic = new CivicLocation("country", "city", "street", "number", "postCode"); GeoLocation geo = new GeoLocation(65.65656565, 75.75757575); CivicLocationDTO civicDTO = new CivicLocationDTO("country", "city", "street", "number", "postCode"); GeoLocationDTO geoDTO = new GeoLocationDTO(65.65656565, 75.75757575); final AccessPoint ap = new AccessPoint(new ID("id1"), "ip", new MacAddress("aa:bb"), "sn", "model", venue, geo, civic, new CapabilityList(Lists.newArrayList(new Capability(256, "a")))); context.checking(new Expectations() {{ oneOf(repository).findById("id1"); will(returnValue(Optional.of(ap))); }}); ApLocationDTO dto = new ApLocationDTO(civicDTO, geoDTO); Reply<?> reply = service.fetchLocation("id1"); assertThat(reply, containsValue(dto)); }

Target:
public void fetchLocation() throws Exception { CivicLocationDTO civicDTO = new CivicLocationDTO("country", "city", "street", "number", "postCode"); GeoLocationDTO geoDTO = new GeoLocationDTO(10.0, 20.0); CivicLocation civicLocation = new CivicLocation("country", "city", "street", "number", "postCode"); GeoLocation geoLocation = new GeoLocation(10.0, 20.0); final AccessPoint ap = newAp().civicLocation(civicLocation).geoLocation(geoLocation).build(); context.checking(new Expectations() {{ oneOf(repository).findById("id1"); will(returnValue(Optional.of(ap))); }}); ApLocationDTO dto = new ApLocationDTO(civicDTO, geoDTO); Reply<?> reply = service.fetchLocation("id1"); assertThat(reply, containsValue(dto)); }
Source:
public void testInnerJoinPropagatesPredicatesViaEquiConditions() { ImmutableList.Builder<JoinNode.EquiJoinClause> criteriaBuilder = ImmutableList.builder(); criteriaBuilder.add(new JoinNode.EquiJoinClause(A, D)); List<JoinNode.EquiJoinClause> criteria = criteriaBuilder.build(); Map<Symbol, ColumnHandle> leftAssignments = Maps.filterKeys(scanAssignments, Predicates.in(ImmutableList.of(A, B, C))); TableScanNode leftScan = new TableScanNode( newId(), DUAL_TABLE_HANDLE, ImmutableList.copyOf(leftAssignments.keySet()), leftAssignments, Optional.empty(), TupleDomain.all(), TupleDomain.all()); Map<Symbol, ColumnHandle> rightAssignments = Maps.filterKeys(scanAssignments, Predicates.in(ImmutableList.of(D, E, F))); TableScanNode rightScan = new TableScanNode( newId(), DUAL_TABLE_HANDLE, ImmutableList.copyOf(rightAssignments.keySet()), rightAssignments, Optional.empty(), TupleDomain.all(), TupleDomain.all()); FilterNode left = filter(leftScan, equals(AE, bigintLiteral(10))); PlanNode node = new JoinNode(newId(), JoinNode.Type.INNER, left, rightScan, criteria, ImmutableList.<Symbol>builder() .addAll(rightScan.getOutputSymbols()) .build(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); Expression effectivePredicate = effectivePredicateExtractor.extract(node); assertEquals( normalizeConjuncts(effectivePredicate), normalizeConjuncts(equals(DE, bigintLiteral(10)))); }

Target:
public void testInnerJoinPropagatesPredicatesViaEquiConditions() { Map<Symbol, ColumnHandle> leftAssignments = Maps.filterKeys(scanAssignments, Predicates.in(ImmutableList.of(A, B, C))); TableScanNode leftScan = tableScanNode(leftAssignments); Map<Symbol, ColumnHandle> rightAssignments = Maps.filterKeys(scanAssignments, Predicates.in(ImmutableList.of(D, E, F))); TableScanNode rightScan = tableScanNode(rightAssignments); FilterNode left = filter(leftScan, equals(AE, bigintLiteral(10))); PlanNode node = new JoinNode(newId(), JoinNode.Type.INNER, left, rightScan, ImmutableList.of(new JoinNode.EquiJoinClause(A, D)), ImmutableList.<Symbol>builder() .addAll(rightScan.getOutputSymbols()) .build(), Optional.empty(), Optional.empty(), Optional.empty(), Optional.empty()); Expression effectivePredicate = effectivePredicateExtractor.extract(node); assertEquals( normalizeConjuncts(effectivePredicate), normalizeConjuncts(equals(DE, bigintLiteral(10)))); }
Source:
public void dragStart(DragSourceEvent event) { final IStructuredSelection selection = (IStructuredSelection) fTreeViewer.getSelection(); LocalSelectionTransfer.getTransfer().setSelection(selection); }

Target:
public void dragStart(DragSourceEvent event) { LocalSelectionTransfer.getTransfer().setSelection(fTreeViewer.getSelection()); }
Source:
public DocumentLock getLock(DocumentReference doc) { XWikiContext context = (XWikiContext) this.execution.getContext().getProperty("xwikicontext"); XWikiDocument xdoc; try { xdoc = context.getWiki().getDocument(doc, context); if (xdoc == null) { return null; } String documentId = xdoc.getDocumentReference().getName(); Family family = this.familyRepository.getFamilyById(documentId); if (family == null) { return null; } XWikiLock xlock = xdoc.getLock(context); if (xlock != null && !xlock.getUserName().equals(context.getUser())) { Set<String> actions = Collections.singleton("edit"); User user = this.userManager.getUser(xlock.getUserName()); return new DocumentLock(user, xlock.getDate(), "This family is already being edited by " + user.getName(), actions, false); } } catch (XWikiException e) { this.logger.error("Failed to access the document lock: {}", e.getMessage(), e); } return null; }

Target:
public DocumentLock getLock(DocumentReference doc) { XWikiContext context = this.provider.get(); XWikiDocument xdoc; try { xdoc = context.getWiki().getDocument(doc, context); if (xdoc == null) { return null; } String documentId = xdoc.getDocumentReference().getName(); Family family = this.familyRepository.getFamilyById(documentId); if (family == null) { return null; } XWikiLock xlock = xdoc.getLock(context); User user = this.userManager.getUser(xlock.getUserName()); if (xlock != null && !user.getId().equals(this.userManager.getCurrentUser().getId())) { Set<String> actions = Collections.singleton("edit"); return new DocumentLock(user, xlock.getDate(), this.tm.translate("family.locks.familyInUse", user.getName()), actions, false); } } catch (XWikiException e) { this.logger.error("Failed to access the document lock: {}", e.getMessage(), e); } return null; }
Source:
public void itemWriterWithNoEmbeddedHeaders() throws Exception { AvroItemWriter avroItemWriter = new AvroItemWriter(output, plainOldUserSchemaResource,PlainOldUser.class); avroItemWriter.setEmbedHeader(false); avroItemWriter.afterPropertiesSet(); avroItemWriter.open(new ExecutionContext()); avroItemWriter.write(this.plainOldUsers()); avroItemWriter.close(); verifyRecords(outputStream.toByteArray(), this.plainOldUsers(), PlainOldUser.class, false); }

Target:
public void itemWriterWithNoEmbeddedHeaders() throws Exception { AvroItemWriter<PlainOldUser> avroItemWriter = new AvroItemWriter(output, PlainOldUser.class); avroItemWriter.open(new ExecutionContext()); avroItemWriter.write(this.plainOldUsers()); avroItemWriter.close(); verifyRecords(outputStream.toByteArray(), this.plainOldUsers(), PlainOldUser.class, false); }
Source:
public void testEncryptionGcmCtr() throws Exception { Configuration conf = new Configuration(); conf.set(SchemaCryptoPropertiesFactory.CONF_ENCRYPTION_ALGORITHM, "AES_GCM_V1"); runTest(conf); }

Target:
public void testEncryptionGcmCtr() throws Exception { Configuration conf = new Configuration(); conf.set(SchemaCryptoPropertiesFactory.CONF_ENCRYPTION_ALGORITHM, ParquetCipher.AES_GCM_CTR_V1.toString()); runTest(conf); }
Source:
public int hashCode() { int result = id != null ? id.hashCode() : 0; result = 31 * result + (interval != null ? interval.hashCode() : 0); result = 31 * result + (columns != null ? columns.hashCode() : 0); result = 31 * result + (int) (size ^ (size >>> 32)); result = 31 * result + numRows; return result; }

Target:
public int hashCode() { return Objects.hash(id, interval, columns, size, numRows, aggregators); }
Source:
public void warn() { if (!disabled) { logger.warning("DNS multicast capability has been removed from Jenkins."); } }

Target:
public static void warn() { if (!disabled) { LOGGER.warning("DNS multicast capability has been removed from Jenkins. More information: <LINK_0>"); } }
Source:
protected void unpackFrameData(byte[] bytes) throws InvalidDataException { int marker = BufferTools.indexOfTerminatorForEncoding(bytes, 1, bytes[0]); description = new EncodedText(bytes[0], BufferTools.copyBuffer(bytes, 1, marker - 1)); marker += description.getTerminator().length; value = new EncodedText(bytes[0], BufferTools.copyBuffer(bytes, marker, bytes.length - marker)); }

Target:
protected void unpackFrameData(byte[] bytes) throws InvalidDataException { int marker = BufferTools.indexOfTerminatorForEncoding(bytes, 1, bytes[0]); if (marker >= 0) { description = new EncodedText(bytes[0], BufferTools.copyBuffer(bytes, 1, marker - 1)); marker += description.getTerminator().length; } else { description = new EncodedText(bytes[0], ""); marker = 1; } if (bytes.length - marker >= 0) { value = new EncodedText(bytes[0], BufferTools.copyBuffer(bytes, marker, bytes.length - marker)); } else { value = new EncodedText(bytes[0], ""); } }
Source:
boolean boxedNotEqual3(Boolean B, Boolean V) { return B != V; }

Target:
void boxedNotEqual3(Boolean B, Boolean V) { if (B != V) { foo(); } else { bar(); } }
Source:
public static QueryTree build(List<QueryTree> children) { if (children.size() == 0) throw new IllegalArgumentException("Cannot build DisjunctionNode with no children"); if (children.size() == 1) return children.get(0); List<QueryTree> anyChildren = children.stream().filter(QueryTree::isAny).collect(Collectors.toList()); if (anyChildren.isEmpty() == false) { return anyChildren.get(0); } return new DisjunctionNode(children); }

Target:
public static QueryTree build(List<QueryTree> children) { if (children.size() == 0) throw new IllegalArgumentException("Cannot build DisjunctionNode with no children"); if (children.size() == 1) return children.get(0); Optional<QueryTree> firstAnyChild = children.stream().filter(QueryTree::isAny).findAny(); return firstAnyChild.orElseGet(() -> new DisjunctionNode(children)); }