auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private ClassLoaderLookupPolicy getApplicationClassLoaderLookupPolicy(ArtifactClassLoader parent, DomainDescriptor descriptor) { final Map<String, LookupStrategy> pluginsLookupStrategies = new SmallMap<>(); for (ArtifactPluginDescriptor artifactPluginDescriptor : descriptor.getPlugins()) { artifactPluginDescriptor.getClassLoaderModel().getExportedPackages() .forEach(p -> pluginsLookupStrategies.put(p, PARENT_FIRST)); } return parent.getClassLoaderLookupPolicy().extend(pluginsLookupStrategies); }

Target:
private ClassLoaderLookupPolicy getApplicationClassLoaderLookupPolicy(ArtifactClassLoader parent, DomainDescriptor descriptor) { final Map<String, LookupStrategy> pluginsLookupStrategies = new HashMap<>(); for (ArtifactPluginDescriptor artifactPluginDescriptor : descriptor.getPlugins()) { artifactPluginDescriptor.getClassLoaderModel().getExportedPackages() .forEach(p -> pluginsLookupStrategies.put(p, PARENT_FIRST)); } return parent.getClassLoaderLookupPolicy().extend(pluginsLookupStrategies); }
Source:
public void updateModel(final @Nullable ISegmentStore<ISegment> dataInput) { final TableViewer tableViewer = getTableViewer(); Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (!tableViewer.getTable().isDisposed()) { tableViewer.getTable().setTopIndex(0); tableViewer.setSelection(StructuredSelection.EMPTY); if (dataInput == null) { tableViewer.setInput(null); tableViewer.setItemCount(0); return; } tableViewer.setInput(dataInput); SegmentStoreContentProvider contentProvider = (SegmentStoreContentProvider) getTableViewer().getContentProvider(); tableViewer.setItemCount(contentProvider.getSegmentCount()); addPackListener(); } } }); }

Target:
public void updateModel(final @Nullable ISegmentStore<ISegment> dataInput) { final TableViewer tableViewer = getTableViewer(); Display.getDefault().asyncExec(new Runnable() { @Override public void run() { if (!tableViewer.getTable().isDisposed()) { tableViewer.getTable().setTopIndex(0); tableViewer.setSelection(StructuredSelection.EMPTY); if (dataInput == null) { tableViewer.setInput(null); tableViewer.setItemCount(0); return; } addPackListener(); tableViewer.setInput(dataInput); SegmentStoreContentProvider contentProvider = (SegmentStoreContentProvider) getTableViewer().getContentProvider(); tableViewer.setItemCount(contentProvider.getSegmentCount()); } } }); }
Source:
private void handleTabOffset(byte cc2) { if (captionStringBuilder.length() == 0) { switch (cc2) { case CTRL_TAB_OFFSET_1: tabOffset++; break; case CTRL_TAB_OFFSET_2: tabOffset += 2; break; case CTRL_TAB_OFFSET_3: tabOffset += 3; break; } } }

Target:
private void handleTabOffset(byte cc2) { currentCue.tab(cc2 - 0x20); }
Source:
public boolean onBlockDestroyed(ItemStack stack, World worldIn, BlockState state, BlockPos pos, LivingEntity entityLiving) { if((state.getBlock() instanceof CropsBlock && ((CropsBlock) state.getBlock()).isMaxAge(state)) || state.getBlock() instanceof PumpkinBlock) { CropsBlock.spawnDrops(state,worldIn,pos); } return super.onBlockDestroyed(stack, worldIn, state, pos, entityLiving); }

Target:
public boolean onBlockDestroyed(ItemStack stack, World worldIn, BlockState state, BlockPos pos, LivingEntity entityLiving) { if((state.getBlock() instanceof CropsBlock && ((CropsBlock) state.getBlock()).isMaxAge(state))) { CropsBlock.spawnDrops(state,worldIn,pos); } return super.onBlockDestroyed(stack, worldIn, state, pos, entityLiving); }
Source:
public boolean tryAdvance(Consumer<? super Map<Address, CacheEntry<K, V>>> action) { while (!iterator.hasNext()) { if (nextSegment < totalSegments) { try { if (trace) log.tracef("Attempting to receive all replicas for segment %s with topology %s", nextSegment, topology); List<Map<Address, CacheEntry<K, V>>> segmentEntries = stateReceiver.getAllReplicasForSegment(nextSegment, topology).get(); if (trace && !segmentEntries.isEmpty()) log.tracef("Segment %s entries received: %s", nextSegment, segmentEntries); iterator = segmentEntries.iterator(); nextSegment++; } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new CacheException(e); } catch (ExecutionException | CancellationException e) { stateReceiver.stop(); throw new CacheException(e.getMessage(), e.getCause()); } } else { return false; } } action.accept(iterator.next()); return true; }

Target:
public boolean tryAdvance(Consumer<? super Map<Address, CacheEntry<K, V>>> action) { while (!iterator.hasNext()) { if (nextSegment < totalSegments) { try { if (trace) log.tracef("Attempting to receive all replicas for segment %s with topology %s", nextSegment, topology); List<Map<Address, CacheEntry<K, V>>> segmentEntries = stateReceiver.getAllReplicasForSegment(nextSegment, topology).get(); if (trace && !segmentEntries.isEmpty()) log.tracef("Segment %s entries received: %s", nextSegment, segmentEntries); iterator = segmentEntries.iterator(); nextSegment++; } catch (InterruptedException e) { stateReceiver.stop(); Thread.currentThread().interrupt(); throw new CacheException(e); } catch (ExecutionException | CancellationException e) { stateReceiver.stop(); throw new CacheException(e.getMessage(), e.getCause()); } } else { streamInProgress.compareAndSet(true, false); return false; } } action.accept(iterator.next()); return true; }
Source:
public static boolean isAdminUser(DbUser user) { List<Role> userRoles = getRoleDAO().getAnyAdminRoleForUserAndGroups(user.getId(), StringUtils.join(user.getGroupIds(), ",")); if (userRoles.size() > 0) { log.debug("LoginAdminUser: User logged to admin using role '{}'", userRoles.get(0).getname()); return true; } return false; }

Target:
public static boolean isAdminUser(DbUser user) { List<Role> userRoles = getRoleDAO().getAnyAdminRoleForUserAndGroups(user.getId(), StringUtils.join(user.getGroupIds(), ",")); if (!userRoles.isEmpty()) { log.debug("LoginAdminUser: User logged to admin using role '{}'", userRoles.get(0).getname()); return true; } return false; }
Source:
public void onLocationChangedSlightly(fr.free.nrw.commons.location.LatLng latLng) { Timber.d("Location significantly changed"); if (isMapBoxReady && latLng != null &&!isUserBrowsing()) { handleLocationUpdate(latLng,LOCATION_SLIGHTLY_CHANGED); } }

Target:
public void onLocationChangedSlightly(fr.free.nrw.commons.location.LatLng latLng) { Timber.d("Location slightly changed"); if (isMapBoxReady && latLng != null &&!isUserBrowsing()) { handleLocationUpdate(latLng,LOCATION_SLIGHTLY_CHANGED); } }
Source:
public MicroProfileReactiveMessagingSubsystemDefinition() { super( new SimpleResourceDefinition.Parameters( SUBSYSTEM_PATH, MicroProfileReactiveMessagingExtension.getResourceDescriptionResolver(SUBSYSTEM_NAME)) .setAddHandler(AddHandler.INSTANCE) .setRemoveHandler(new ModelOnlyRemoveStepHandler()) .setCapabilities(REACTIVE_STREAMS_OPERATORS_CAPABILITY) ); }

Target:
public MicroProfileReactiveMessagingSubsystemDefinition() { super( new SimpleResourceDefinition.Parameters( SUBSYSTEM_PATH, MicroProfileReactiveMessagingExtension.getResourceDescriptionResolver(SUBSYSTEM_NAME)) .setAddHandler(AddHandler.INSTANCE) .setRemoveHandler(new ReloadRequiredRemoveStepHandler()) .setCapabilities(REACTIVE_STREAMS_OPERATORS_CAPABILITY) ); }
Source:
public List<StructuredViewer> getViewers() { List<StructuredViewer> viewers = new ArrayList<StructuredViewer>(); ISearchResultPage page = getCurrentPage(); if (page instanceof AbstractTextSearchViewPage) { try { Method getViewer = page.getClass().getDeclaredMethod("getViewer"); getViewer.setAccessible(true); StructuredViewer viewer = (StructuredViewer) getViewer.invoke(page); viewers.add(viewer); } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { } } return viewers; }

Target:
public List<StructuredViewer> getViewers() { List<StructuredViewer> viewers = new ArrayList<StructuredViewer>(); ISearchResultPage page = getCurrentPage(); if (page instanceof AbstractTextSearchViewPage) { try { Method getViewer = AbstractTextSearchViewPage.class.getDeclaredMethod("getViewer"); getViewer.setAccessible(true); StructuredViewer viewer = (StructuredViewer) getViewer.invoke(page); viewers.add(viewer); } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { } } return viewers; }
Source:
protected void onInit() throws Exception { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(this.getBeanFactory()); this.evaluationContext.setTypeConverter(new StandardTypeConverter(new DefaultConversionService())); if (this.mongoTemplate == null) { this.mongoTemplate = new MongoTemplate(this.mongoDbFactory, this.mongoConverter); } this.initialized = true; }

Target:
protected void onInit() throws Exception { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(this.getBeanFactory()); TypeLocator typeLocator = this.evaluationContext.getTypeLocator(); if (typeLocator instanceof StandardTypeLocator) { ((StandardTypeLocator) typeLocator).registerImport("org.springframework.data.mongodb.core.query"); } if (this.mongoTemplate == null) { this.mongoTemplate = new MongoTemplate(this.mongoDbFactory, this.mongoConverter); } this.initialized = true; }
Source:
public void clockSkew(String server, long skew) { if (skew > WARN_SKEW_THRESHOLD_NANOS && skew < ERROR_SKEW_THRESHOLD_NANOS) { log.warn("Skew (in nanos) greater than expected", skew); } else if (skew >= ERROR_SKEW_THRESHOLD_NANOS) { log.error("Skew (in nanos) much greater than expected", skew); } metricRegistry.histogram(String.format("clock-skew-%s-histogram", server)) .update(skew); metricRegistry.counter(String.format("clock-skew-%s-counter", server)).inc(); }

Target:
public void clockSkew(String server, long skew) { if (skew > WARN_SKEW_THRESHOLD_NANOS && skew < ERROR_SKEW_THRESHOLD_NANOS) { log.warn("Skew (in nanos) greater than expected on server {}", SafeArg.of("skew", skew), SafeArg.of("server", server)); } else if (skew >= ERROR_SKEW_THRESHOLD_NANOS) { log.error("Skew (in nanos) much greater than expected on server {}", SafeArg.of("skew", skew), SafeArg.of("server", server)); } metricRegistry.histogram("clock-skew").update(skew); }
Source:
protected boolean IsPowerManagementLegal(VdsStatic vdsStatic, String clsuterCompatibilityVersion) { boolean result = true; if (vdsStatic.getpm_enabled()) { if (vdsStatic.getpm_user() == null || vdsStatic.getpm_user().length() == 0 || vdsStatic.getpm_password() == null || vdsStatic.getpm_password().length() == 0) if (StringHelper.isNullOrEmpty(vdsStatic.getpm_type())) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_PM_ENABLED_WITHOUT_AGENT_CREDENTIALS); result = false; } else if (!Regex.IsMatch(Config.<String> GetValue(ConfigValues.VdsFenceType, clsuterCompatibilityVersion), String.format("(,|^)%1$s(,|$)", vdsStatic.getpm_type()))) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_AGENT_NOT_SUPPORTED); result = false; } } return result; }

Target:
protected boolean IsPowerManagementLegal(VdsStatic vdsStatic, String clsuterCompatibilityVersion) { boolean result = true; if (vdsStatic.getpm_enabled()) { if (StringHelper.isNullOrEmpty(vdsStatic.getpm_type()) || !Regex.IsMatch(Config.<String> GetValue(ConfigValues.VdsFenceType, clsuterCompatibilityVersion), String.format("(,|^)%1$s(,|$)", vdsStatic.getpm_type()))) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_AGENT_NOT_SUPPORTED); result = false; } else if (StringUtils.isEmpty(vdsStatic.getpm_user()) || StringUtils.isEmpty(vdsStatic.getpm_password())) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_PM_ENABLED_WITHOUT_AGENT_CREDENTIALS); result = false; } } return result; }
Source:
public String buildCollectorFile(ConcurStandardAccountingExtractFile saeFileContents, ConcurStandardAccountingExtractBatchReportData reportData) { if (saeFileContents == null) { throw new IllegalArgumentException("saeFileContents cannot be null"); } else if (reportData == null) { throw new IllegalArgumentException("reportData cannot be null"); } CollectorBatch collectorBatch = buildCollectorBatch(saeFileContents, reportData); if (collectorBatch == null) { LOG.error("There was a problem preparing the data for the Collector file; will not create a file. See earlier logs for details."); return StringUtils.EMPTY; } return writeToCollectorFile(saeFileContents.getOriginalFileName(), collectorBatch, reportData); }

Target:
public String buildCollectorFile(ConcurStandardAccountingExtractFile saeFileContents, ConcurStandardAccountingExtractBatchReportData reportData) { if (saeFileContents == null) { throw new IllegalArgumentException("saeFileContents cannot be null"); } else if (reportData == null) { throw new IllegalArgumentException("reportData cannot be null"); } CollectorBatch collectorBatch = buildCollectorBatch(saeFileContents, reportData); if (collectorBatch == null) { LOG.error("buildCollectorFile(): There was a problem preparing the data for the Collector file;" + " will not create a file. See earlier logs for details."); return StringUtils.EMPTY; } return writeToCollectorFile(saeFileContents.getOriginalFileName(), collectorBatch, reportData); }
Source:
public void registerOperations(ManagementResourceRegistration resourceRegistration) { if (showResources) { resourceRegistration.registerOperationHandler(ShowJaxrsResourcesHandler.DEFINITION, new ShowJaxrsResourcesHandler()); } else { resourceRegistration.registerOperationHandler(ADD_DEFINITION, JaxrsSubsystemAdd.INSTANCE); resourceRegistration.registerOperationHandler(REMOVE_DEFINITION, ReloadRequiredRemoveStepHandler.INSTANCE); } }

Target:
public void registerOperations(ManagementResourceRegistration resourceRegistration) { super.registerOperations(resourceRegistration); resourceRegistration.registerOperationHandler(ShowJaxrsResourcesHandler.DEFINITION, new ShowJaxrsResourcesHandler()); }
Source:
public void testFetchStdout() throws TimeoutException { WaitingConsumer consumer = new WaitingConsumer(); container.followOutput(consumer, STDOUT); consumer.waitUntil(frame -> frame.getType() == STDOUT && frame.getUtf8String().contains("home"), 30, TimeUnit.SECONDS); }

Target:
public void testFetchStdout() throws TimeoutException { WaitingConsumer consumer = new WaitingConsumer(); container.followOutput(consumer, STDOUT); consumer.waitUntil(frame -> frame.getType() == STDOUT && frame.getUtf8String().contains("home"), 4, TimeUnit.SECONDS); }
Source:
AppSourceFunction(int bufferSize, int maxParallelism, int numberOfChannels) { this.maxParallelism = maxParallelism; this.numberOfChannels = numberOfChannels; String shortString = "I am a very long string to test partial records hohoho hahaha "; StringBuilder builder = new StringBuilder(shortString); for (int i = 0; i <= 2 * bufferSize / shortString.length() + 1; i++) { builder.append(shortString); } this.longOrShortString = builder.toString(); }

Target:
AppSourceFunction(int bufferSize, int maxParallelism, int numberOfChannels) { this.maxParallelism = maxParallelism; this.numberOfChannels = numberOfChannels; this.keys = initKeys(numberOfChannels); StringBuilder builder = new StringBuilder(shortString); for (int i = 0; i <= 2 * bufferSize / shortString.length() + 1; i++) { builder.append(shortString); } this.longOrShortString = builder.toString(); }
Source:
public BigDecimal getExchangeRateLast(String cryptoCurrency, String fiatCurrency) { if (isExchangeRateExist(cryptoCurrency, fiatCurrency)) { log.warn("{}-{} pair not supported", cryptoCurrency, fiatCurrency); return null; } try { log.info("{}-{} pair SET getExchangeRateLast", cryptoCurrency, fiatCurrency); setTicker(cryptoCurrency, fiatCurrency); return rateInfo.getLast(); } catch (Exception e) { log.error("", e); } return null; }

Target:
public BigDecimal getExchangeRateLast(String cryptoCurrency, String fiatCurrency) { if (isExchangeRateExist(cryptoCurrency, fiatCurrency)) { log.warn("{}-{} pair not supported", cryptoCurrency, fiatCurrency); return null; } try { log.info("{}-{} pair SET getExchangeRateLast", cryptoCurrency, fiatCurrency); setTicker(cryptoCurrency, fiatCurrency); return bitKubRateInfo.getLast(); } catch (Exception e) { log.error("", e); } return null; }
Source:
public synchronized void scheduleRequestIfNecessary() { if (isFinished() || isFailed()) { return; } if (noMoreLocations && completedClients.size() == allClients.size()) { if (pageBuffer.peekLast() != NO_MORE_PAGES) { checkState(pageBuffer.add(NO_MORE_PAGES), "Could not add no more pages marker"); } if (pageBuffer.peek() == NO_MORE_PAGES) { close(); } notifyBlockedCallers(); return; } long neededBytes = bufferCapacity - bufferRetainedSizeInBytes; if (neededBytes <= 0) { return; } long averageResponseSize = Math.max(1, responseSizeExponentialMovingAverage.get()); int clientCount = (int) ((1.0 * neededBytes / averageResponseSize) * concurrentRequestMultiplier); clientCount = Math.max(clientCount, 1); int pendingClients = allClients.size() - queuedClients.size() - completedClients.size(); clientCount -= pendingClients; for (int i = 0; i < clientCount; ) { HttpPageBufferClient client = queuedClients.poll(); if (client == null) { return; } if (removedClients.contains(client)) { continue; } DataSize max = new DataSize(Math.min(averageResponseSize * 2, maxResponseSize.toBytes()), BYTE); client.scheduleRequest(max); i++; } }

Target:
public synchronized void scheduleRequestIfNecessary() { if (isFinished() || isFailed()) { return; } if (noMoreLocations && completedClients.size() == allClients.size()) { if (pageBuffer.peekLast() != NO_MORE_PAGES) { checkState(pageBuffer.add(NO_MORE_PAGES), "Could not add no more pages marker"); } if (pageBuffer.peek() == NO_MORE_PAGES) { close(); } notifyBlockedCallers(); return; } long neededBytes = bufferCapacity - bufferRetainedSizeInBytes; if (neededBytes <= 0) { return; } long averageResponseSize = max(1, responseSizeExponentialMovingAverage.get()); int clientCount = (int) ((1.0 * neededBytes / averageResponseSize) * concurrentRequestMultiplier); clientCount = max(clientCount, 1); int pendingClients = allClients.size() - queuedClients.size() - completedClients.size(); clientCount -= pendingClients; for (int i = 0; i < clientCount; ) { HttpPageBufferClient client = queuedClients.poll(); if (client == null) { return; } if (removedClients.contains(client)) { continue; } DataSize max = new DataSize(min(averageResponseSize * 2, maxResponseSize.toBytes()), BYTE); client.scheduleRequest(max); i++; } }
Source:
private synchronized void regenerateMdsDataBundle(boolean startBundle, String... moduleNames) { LOGGER.info("Regenerating the mds entities bundle"); clearModulesCache(moduleNames); cleanEntitiesBundleCachedClasses(); boolean constructed = mdsConstructor.constructEntities(); if (!constructed) { return; } LOGGER.info("Updating mds data provider"); mdsDataProvider.updateDataProvider(); File dest = new File(monitor.bundleLocation()); if (dest.exists()) { LOGGER.info("Waiting for entities context"); monitor.waitForEntitiesContext(); } File tmpBundleFile; try { LOGGER.info("Generating bundle jar"); tmpBundleFile = generate(); LOGGER.info("Generated bundle jar"); } catch (IOException e) { throw new MdsException("Unable to generate entities bundle", e); } FileUtils.deleteQuietly(dest); try { FileUtils.copyFile(tmpBundleFile, dest); } catch (IOException e) { LOGGER.error("Unable to copy the mds-entities bundle to the bundle directory. Installing from jdo directory", e); dest = tmpBundleFile; } monitor.stopEntitiesBundle(); stopModulesForCoreBundleRefresh(moduleNames); try { monitor.start(dest, false); } finally { FileUtils.deleteQuietly(tmpBundleFile); } refreshModules(moduleNames); if (startBundle) { monitor.start(); } startModulesForCoreBundleRefresh(moduleNames); ThreadSuspender.sleep(2000); }

Target:
private synchronized void regenerateMdsDataBundle(boolean startBundle, String... moduleNames) { LOGGER.info("Regenerating the mds entities bundle"); clearModulesCache(moduleNames); cleanEntitiesBundleCachedClasses(); boolean constructed = mdsConstructor.constructEntities(); if (!constructed) { return; } LOGGER.info("Updating mds data provider"); mdsDataProvider.updateDataProvider(); File dest = new File(monitor.bundleLocation()); if (dest.exists()) { LOGGER.info("Waiting for entities context"); monitor.waitForEntitiesContext(); } File tmpBundleFile; try { LOGGER.info("Generating bundle jar"); tmpBundleFile = generate(); LOGGER.info("Generated bundle jar"); } catch (IOException e) { throw new MdsException("Unable to generate entities bundle", e); } FileUtils.deleteQuietly(dest); try { FileUtils.copyFile(tmpBundleFile, dest); } catch (IOException e) { LOGGER.error("Unable to copy the mds-entities bundle to the bundle directory. Installing from temp directory", e); dest = tmpBundleFile; } monitor.stopEntitiesBundle(); stopModulesForCoreBundleRefresh(moduleNames); try { monitor.start(dest, false); } finally { FileUtils.deleteQuietly(tmpBundleFile); } refreshModules(moduleNames); if (startBundle) { monitor.start(); } startModulesForCoreBundleRefresh(moduleNames); ThreadSuspender.sleep(2000); }
Source:
public void testGetAllSchemaPropertiesConnectorsForIOConnection() { Set<PropertyPathConnector> actualConnectors = testInputProperties.getAllSchemaPropertiesConnectors(true); assertThat(actualConnectors, Matchers.contains(testInputProperties.FLOW_CONNECTOR)); assertTrue(actualConnectors.size() == 1); assertEquals("outputSchema", new ArrayList<>(actualConnectors).get(0).getPropertyPath()); }

Target:
public void testGetAllSchemaPropertiesConnectorsForIOConnection() { Set<PropertyPathConnector> actualConnectors = testInputProperties.getAllSchemaPropertiesConnectors(true); assertThat(actualConnectors, Matchers.contains(testInputProperties.OUTGOING_CONNECTOR)); assertEquals(1,actualConnectors.size()); assertEquals("outputSchema", new ArrayList<>(actualConnectors).get(0).getPropertyPath()); }
Source:
private String getAnExistingDOIForWorkflow(Workflow workflow) { String latestWorkflowVersionDOIURL = null; Optional<WorkflowVersion> potentialWorfklowVersion = workflow.getWorkflowVersions().stream() .filter((WorkflowVersion v) -> v.getDoiURL() != null) .filter((WorkflowVersion v) -> !v.getDoiURL().isEmpty()) .findAny(); if (potentialWorfklowVersion.isPresent()) { latestWorkflowVersionDOIURL = potentialWorfklowVersion.get().getDoiURL(); } return latestWorkflowVersionDOIURL; }

Target:
private Optional<String> getAnExistingDOIForWorkflow(Workflow workflow) { return workflow.getWorkflowVersions().stream() .map(v -> v.getDoiURL()) .filter(doi -> !StringUtils.isEmpty(doi)).findAny(); }
Source:
private void registerPreDeleteResourceChangeListener() { if (preDeleteProjectListener == null) { preDeleteProjectListener = new IResourceChangeListener() { public void resourceChanged(IResourceChangeEvent event) { IResource resource = event.getResource(); if (resource instanceof IProject) { IProject project = (IProject) resource; if (project.isAccessible()) { if (RepositoryProvider.getProvider(project) instanceof GitProvider) { IResource dotGit = project .findMember(Constants.DOT_GIT); if (dotGit != null && dotGit.getType() == IResource.FOLDER) GitProjectData.reconfigureWindowCache(); } } else { File location = project.getLocation().toFile(); File dotGit = new File(location, Constants.DOT_GIT); if (dotGit.exists() && dotGit.isDirectory()) { GitProjectData.reconfigureWindowCache(); } } } } }; ResourcesPlugin.getWorkspace().addResourceChangeListener(preDeleteProjectListener, IResourceChangeEvent.PRE_DELETE); } }

Target:
private void registerPreDeleteResourceChangeListener() { if (preDeleteProjectListener == null) { preDeleteProjectListener = new IResourceChangeListener() { public void resourceChanged(IResourceChangeEvent event) { IResource resource = event.getResource(); if (resource instanceof IProject) { IProject project = (IProject) resource; if (project.isAccessible()) { if (RepositoryProvider.getProvider(project) instanceof GitProvider) { IResource dotGit = project .findMember(Constants.DOT_GIT); if (dotGit != null && dotGit.getType() == IResource.FOLDER) GitProjectData.reconfigureWindowCache(); } } else { IPath locationPath = project.getLocation(); if (locationPath != null) { File locationDir = locationPath.toFile(); File dotGit = new File(locationDir, Constants.DOT_GIT); if (dotGit.exists() && dotGit.isDirectory()) { GitProjectData.reconfigureWindowCache(); } } } } } }; ResourcesPlugin.getWorkspace().addResourceChangeListener(preDeleteProjectListener, IResourceChangeEvent.PRE_DELETE); } }
Source:
public boolean containsTuple(IInputKey key, TupleMask seedMask, ITuple seed) { return containsTuple(key, TupleMask.identity(seedMask.sourceWidth).revertFrom(seed)); }

Target:
public boolean containsTuple(IInputKey key, TupleMask seedMask, ITuple seed) { return containsTuple(key, seed.toImmutable()); }
Source:
private static boolean containsTableFinishNode(PlanFragment planFragment) { return containsTableFinishNode(planFragment.getRoot()); }

Target:
private static boolean containsTableFinishNode(PlanFragment planFragment) { PlanNode root = planFragment.getRoot(); return root instanceof OutputNode && getOnlyElement(root.getSources()) instanceof TableFinishNode; }
Source:
public void testInstanceDelete() { RowSnapshot<TaskLists> taskList = new VirtualRowSnapshot<>(new LocalTaskListsTable(mAuthority)); Table<Tasks> taskTable = new TaskListScoped(taskList, new TasksTable(mAuthority)); RowSnapshot<Tasks> task = new VirtualRowSnapshot<>(taskTable); OperationsQueue queue = new BasicOperationsQueue(mClient); assertThat(new MultiBatch( new Put<>(taskList, new NameData("list1")), new Put<>(task, new TitleData("task1")) ), resultsIn(queue, new Assert<>(taskList, new NameData("list1")), new Assert<>(task, new TitleData("task1")), new PostOperationRelatedAssert<>(new InstanceTable(mAuthority), task, Instances.TASK_ID) )); assertThat(new SingletonBatch( new Delete<>(task) ), resultsIn(queue, new AssertEmptyTable<>(new TasksTable(mAuthority)), new AssertEmptyTable<>(new InstanceTable(mAuthority)) )); }

Target:
public void testInstanceDelete() throws Exception { RowSnapshot<TaskLists> taskList = new VirtualRowSnapshot<>(new LocalTaskListsTable(mAuthority)); Table<Tasks> taskTable = new TaskListScoped(taskList, new TasksTable(mAuthority)); RowSnapshot<Tasks> task = new VirtualRowSnapshot<>(taskTable); OperationsQueue queue = new BasicOperationsQueue(mClient); queue.enqueue(new MultiBatch( new Put<>(taskList, new NameData("list1")), new Put<>(task, new TitleData("task1")) )); queue.flush(); assertThat(new SingletonBatch( new Delete<>(task) ), resultsIn(queue, new AssertEmptyTable<>(new TasksTable(mAuthority)), new AssertEmptyTable<>(new InstanceTable(mAuthority)) )); }
Source:
public static boolean showRemoteSearch() { if (isRemoteProject()) { ArtifactRepositoryBean customNexusServer = TalendLibsServerManager.getInstance().getCustomNexusServer(); if (customNexusServer != null) { String repoType = customNexusServer.getType(); if (repoType.equals(ArtifactRepositoryBean.NexusType.NEXUS_2.name()) || repoType.equals(ArtifactRepositoryBean.NexusType.NEXUS_3.name()) || repoType.equals(ArtifactRepositoryBean.NexusType.ARTIFACTORY.name())) { return true; } } } return false; }

Target:
public static boolean showRemoteSearch() { ArtifactRepositoryBean customNexusServer = TalendLibsServerManager.getInstance().getCustomNexusServer(); if (customNexusServer != null) { String repoType = customNexusServer.getType(); if (repoType.equals(ArtifactRepositoryBean.NexusType.NEXUS_2.name()) || repoType.equals(ArtifactRepositoryBean.NexusType.NEXUS_3.name()) || repoType.equals(ArtifactRepositoryBean.NexusType.ARTIFACTORY.name())) { return true; } } return false; }
Source:
public void buildMissingContainerSetAndValidate( Map<Long, Long> container2BCSIDMap) throws IOException { for (Map.Entry<Long, Long> mapEntry : container2BCSIDMap.entrySet()) { long id = mapEntry.getKey(); if (!containerMap.containsKey(id)) { LOG.warn("Adding container to missing container set.", id); missingContainerSet.add(id); } else { Container container = containerMap.get(id); long containerBCSID = container.getBlockCommitSequenceId(); long snapshotBCSID = mapEntry.getValue(); if (containerBCSID < snapshotBCSID) { LOG.warn( "Marking container unhealthy as reported BCSID is smaller" + " than ratis snapshot recorded value {}", containerBCSID, snapshotBCSID); container.markContainerUnhealthy(); } } } }

Target:
public void buildMissingContainerSetAndValidate( Map<Long, Long> container2BCSIDMap) { container2BCSIDMap.entrySet().parallelStream().forEach((mapEntry) -> { long id = mapEntry.getKey(); if (!containerMap.containsKey(id)) { LOG.warn("Adding container to missing container set.", id); missingContainerSet.add(id); } else { Container container = containerMap.get(id); long containerBCSID = container.getBlockCommitSequenceId(); long snapshotBCSID = mapEntry.getValue(); if (containerBCSID < snapshotBCSID) { LOG.warn( "Marking container unhealthy as reported BCSID is smaller" + " than ratis snapshot recorded value {}", id, containerBCSID, snapshotBCSID); try { container.markContainerUnhealthy(); } catch (StorageContainerException sce) { LOG.error("Unable to persist unhealthy state for container {}", id); } } } }); }
Source:
public void removeCapabilityRequirements(OperationContext context, Resource resource, String attributeName, String... values) { String dependentName = this.capability.resolve(context.getCurrentAddress()).getName(); for (String value : values) { this.requirementResolver.apply(context, value).ifPresent(requirementName -> context.deregisterCapabilityRequirement(requirementName, dependentName)); } }

Target:
public void removeCapabilityRequirements(OperationContext context, Resource resource, String attributeName, String... values) { String dependentName = this.capability.resolve(context.getCurrentAddress()).getName(); for (String value : values) { final String requirementName = this.requirementResolver.apply(context, value); if (requirementName != null) { context.deregisterCapabilityRequirement(requirementName, dependentName); } } }
Source:
public String getReverseLookupDomain() { String reverse = getConfig(REVERSE_LOOKUP_NETWORK); if (Strings.isBlank(reverse)) reverse = getAttribute(ADDRESS); reverseNetwork = new Cidr(reverse + "/24"); return Joiner.on('.').join(Iterables.skip(Lists.reverse(Lists.newArrayList(Splitter.on('.').split(reverse))), 1)) + " .in-addr.arpa"; }

Target:
public String getReverseLookupDomain() { return getAttribute(REVERSE_LOOKUP_DOMAIN); }
Source:
private static boolean isBlacklistedVersionGreaterOrEqual(String blacklistedVersion, String pluginVersion) { Semver blacklistedSemver = new Semver(blacklistedVersion); Semver pluginSemver = new Semver(pluginVersion); if (blacklistedSemver.getMajor() < pluginSemver.getMajor()) { return false; } if (blacklistedSemver.getMajor() > pluginSemver.getMajor()) { return true; } if (blacklistedSemver.getMinor() < pluginSemver.getMinor()) { return false; } if (blacklistedSemver.getMinor() > pluginSemver.getMinor()) { return true; } if (blacklistedSemver.getPatch() < pluginSemver.getPatch()) { return false; } return true; }

Target:
private static boolean isBlacklistedVersionGreaterOrEqual(String blacklistedVersion, String pluginVersion) { Semver blacklistedSemver = new Semver(blacklistedVersion); Semver pluginSemver = new Semver(pluginVersion); return !blacklistedSemver.isLowerThan(pluginSemver); }
Source:
public void shouldCapture() throws Exception { Map<String, Object> responsePayloadMap = new ObjectMapper().readValue(load(STRIPE_CAPTURE_SUCCESS_RESPONSE), HashMap.class); when(response.readEntity(Map.class)).thenReturn(responsePayloadMap); when(stripeGatewayClient.postRequest(any(URI.class), anyString(), any(Map.class), any(MediaType.class), anyString())).thenReturn(response); CaptureResponse response = stripeCaptureHandler.capture(captureGatewayRequest); assertTrue(response.isSuccessful()); assertThat(response.getTransactionId().isPresent(), is(true)); assertThat(response.getTransactionId().get(), is("ch_123456")); }

Target:
public void shouldCapture() throws Exception { Map<String, Object> responsePayloadMap = new ObjectMapper().readValue(load(STRIPE_CAPTURE_SUCCESS_RESPONSE), HashMap.class); when(response.readEntity(Map.class)).thenReturn(responsePayloadMap); when(stripeGatewayClient.postRequest(any(URI.class), anyString(), any(Map.class), any(MediaType.class), anyString())).thenReturn(response); CaptureResponse response = stripeCaptureHandler.capture(captureGatewayRequest); assertTrue(response.isSuccessful()); assertThat(response.state(), is(CaptureResponse.ChargeState.COMPLETE)); assertThat(response.getTransactionId().isPresent(), is(true)); assertThat(response.getTransactionId().get(), is("ch_123456")); }
Source:
public void testCountHistorical() throws Exception { String expected = "SELECT count(xTable.art_id) FROM (\n" + " SELECT max(txs1.transaction_id) as transaction_id, art1.art_id, txs1.branch_id\n" + " FROM \n" + "osee_artifact art1, osee_txs txs1\n" + " WHERE \n" + "art1.art_type_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.transaction_id <= ?\n" + " AND \n" + "txs1.mod_type != 3 AND txs1.branch_id = ?\n" + " GROUP BY art1.art_id, txs1.branch_id\n" + ") xTable"; OptionsUtil.setFromTransaction(queryData.getOptions(), EXPECTED_TX_ID); queryData.addCriteria(TYPES); QuerySqlContext context = queryEngine.createCountContext(session, queryData); Assert.assertEquals(expected, context.getSql()); List<Object> parameters = context.getParameters(); Assert.assertEquals(3, parameters.size()); List<AbstractJoinQuery> joins = context.getJoins(); Assert.assertEquals(0, joins.size()); Iterator<Object> iterator = parameters.iterator(); Assert.assertEquals(CoreArtifactTypes.CodeUnit.getGuid().intValue(), iterator.next()); Assert.assertEquals(EXPECTED_TX_ID, iterator.next()); Assert.assertEquals(EXPECTED_BRANCH_ID, iterator.next()); }

Target:
public void testCountHistorical() throws Exception { String expected = "SELECT count(xTable.art_id) FROM (\n" + " SELECT max(txs1.transaction_id) as transaction_id, art1.art_id, txs1.branch_id\n" + " FROM \n" + "osee_artifact art1, osee_txs txs1\n" + " WHERE \n" + "art1.art_type_id = ? AND art1.gamma_id = txs1.gamma_id AND txs1.transaction_id <= ?\n" + " AND \n" + "txs1.mod_type <> 3 AND txs1.branch_id = ?\n" + " GROUP BY art1.art_id, txs1.branch_id\n" + ") xTable"; OptionsUtil.setFromTransaction(queryData.getOptions(), EXPECTED_TX_ID); queryData.addCriteria(TYPES); QuerySqlContext context = queryEngine.createCountContext(session, queryData); Assert.assertEquals(expected, context.getSql()); List<Object> parameters = context.getParameters(); Assert.assertEquals(3, parameters.size()); List<AbstractJoinQuery> joins = context.getJoins(); Assert.assertEquals(0, joins.size()); Iterator<Object> iterator = parameters.iterator(); Assert.assertEquals(CoreArtifactTypes.CodeUnit.getGuid(), iterator.next()); Assert.assertEquals(EXPECTED_TX_ID, iterator.next()); Assert.assertEquals(EXPECTED_BRANCH_ID, iterator.next()); }
Source:
private void initialize() { if (getBatchSize() <= 0) { withBatchSize(1); logger.warn("batchSize should be 1 or greater -- setting batchSize to 1"); } if (getThreadCount() <= 0) { int threadCount = clients.size(); withThreadCount(threadCount); logger.warn("threadCount should be 1 or greater -- setting threadCount to number of hosts: " + threadCount); } if (initialized.getAndSet(true)) return; if(inputType == Void.class) { for (int i=0;i<getThreadCount(); i++) { CallArgs newInput = callArgsGenerator.apply(null); if(newInput != null) { submitCall((CallArgsImpl) newInput); } } } threadPool = new CallingThreadPoolExecutor(this, getThreadCount()); jobStartTime = Calendar.getInstance(); started.set(true); }

Target:
private void initialize() { if (getBatchSize() <= 0) { withBatchSize(1); logger.warn("batchSize should be 1 or greater -- setting batchSize to 1"); } if (getThreadCount() <= 0) { int threadCount = clients.size(); withThreadCount(threadCount); logger.warn("threadCount should be 1 or greater -- setting threadCount to number of hosts: " + threadCount); } if (initialized.getAndSet(true)) return; threadPool = new CallingThreadPoolExecutor(this, getThreadCount()); jobStartTime = Calendar.getInstance(); started.set(true); if(callArgsGenerator != null) { for (int i=0;i<getThreadCount(); i++) { CallArgs newInput = callArgsGenerator.apply(null); if(newInput != null) { if(!(newInput instanceof CallArgsImpl)) throw new MarkLogicInternalException("Unsupported implementation of call arguments."); submitCall((CallArgsImpl) newInput); } } } }
Source:
public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings) { if (args.size() != 1 && args.size() != 2) { throw new IAE("Function[%s] needs 1 or 2 arguments", name()); } ExprEval value = args.get(0).eval(bindings); if (value.type() != ExprType.STRING) { throw new IAE("first argument should be string type but got %s type", value.type()); } DateTimeFormatter formatter = ISODateTimeFormat.dateOptionalTimeParser(); if (args.size() > 1) { ExprEval format = args.get(1).eval(bindings); if (format.type() != ExprType.STRING) { throw new IAE("second argument should be string type but got %s type", format.type()); } formatter = DateTimeFormat.forPattern(format.asString()); } DateTime date; try { date = DateTimes.wrapFormatter(formatter).parse(value.asString()); } catch (IllegalArgumentException e) { throw new IAE(e, "invalid value %s", value.asString()); } return toValue(date); }

Target:
public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings) { if (args.size() != 1 && args.size() != 2) { throw new IAE("Function[%s] needs 1 or 2 arguments", name()); } ExprEval value = args.get(0).eval(bindings); if (value.type() != ExprType.STRING) { throw new IAE("first argument should be string type but got %s type", value.type()); } DateTimes.UtcFormatter formatter = DateTimes.ISO_DATE_OPTIONAL_TIME; if (args.size() > 1) { ExprEval format = args.get(1).eval(bindings); if (format.type() != ExprType.STRING) { throw new IAE("second argument should be string type but got %s type", format.type()); } formatter = DateTimes.wrapFormatter(DateTimeFormat.forPattern(format.asString())); } DateTime date; try { date = formatter.parse(value.asString()); } catch (IllegalArgumentException e) { throw new IAE(e, "invalid value %s", value.asString()); } return toValue(date); }
Source:
private OrganizationalUnit getOU( String ouIdentifier, Collection<OrganizationalUnit> organizationalUnits ) { Optional<OrganizationalUnit> targetOU = organizationalUnits.stream() .filter( p -> p.getIdentifier().equalsIgnoreCase( ouIdentifier ) ).findFirst(); if ( targetOU.isPresent() ) { return targetOU.get(); } return null; }

Target:
private Optional<OrganizationalUnit> getOU( String ouIdentifier, Collection<OrganizationalUnit> organizationalUnits ) { Optional<OrganizationalUnit> targetOU = organizationalUnits.stream() .filter( p -> p.getIdentifier().equalsIgnoreCase( ouIdentifier ) ).findFirst(); return targetOU; }
Source:
public String toMetadata() { StringBuilder sb = new StringBuilder(serviceName); sb.append(":tags:"); tags.entrySet().stream().forEach(kv -> { sb.append(kv.getKey()); sb.append("="); sb.append(kv.getValue()); sb.append("|tag|"); }); return sb.toString(); }

Target:
public String toMetadata() { StringBuilder sb = new StringBuilder(serviceName); sb.append(TAGS_SPERATOR); tags.entrySet().stream().forEach(kv -> { sb.append(kv.getKey().replaceAll(EQ, KEY_VALUE_SEPERATOR)); sb.append(EQ); sb.append(kv.getValue().replaceAll(EQ, KEY_VALUE_SEPERATOR)); sb.append(TAG_SEPERATOR); }); return sb.toString(); }
Source:
public CraftTweakerRecipeMapper() { if (Loader.isModLoaded("crafttweaker")) { for (ModContainer mod : Iterables.concat(Loader.instance().getActiveModList(), ModAPIManager.INSTANCE.getAPIList())) { if (mod.getModId().equals("crafttweaker")) { ctCompat = VersionParser.parseVersionReference("crafttweaker@[4.1.5,)").containsVersion(mod.getProcessedVersion()); break; } } } }

Target:
public CraftTweakerRecipeMapper() { ctCompat = Loader.isModLoaded("crafttweaker") && VersionParser.parseVersionReference("crafttweaker@[4.1.5,)").containsVersion(Loader.instance().getIndexedModList().get("crafttweaker").getProcessedVersion()); }
Source:
public static CliCommand getCommandExecutor(final String commandName) throws CommandException { final String commandCamel = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, commandName.toString()); final Iterator<CliCommand> implementations = getAllCommands(); while (implementations.hasNext()) { final CliCommand implementation = implementations.next(); final String className = implementation.getClass().getSimpleName(); if (className.equalsIgnoreCase(commandCamel)) { return implementation; } } throw new CommandException("No command class: " + commandName); }

Target:
public static CliCommand getCommandExecutor(final String commandName) throws CommandException { final String commandCamel = CaseFormat.UPPER_UNDERSCORE.to(CaseFormat.UPPER_CAMEL, commandName.toString()); final Iterable<CliCommand> implementations = getAllCommands(); for (final CliCommand implementation : implementations) { final String className = implementation.getClass().getSimpleName(); if (className.equalsIgnoreCase(commandCamel)) { return implementation; } } throw new CommandException("No command class: " + commandName); }
Source:
private static void serializeHostThread(HostThread hostThread, ISafeByteBufferWriter buffer) { String string = hostThread.getHost(); byte[] strArray = string.getBytes(CHARSET); buffer.putShort((short) strArray.length); buffer.put(strArray); buffer.put((byte) 0); buffer.putInt(hostThread.getTid()); }

Target:
private static void serializeHostThread(HostThread hostThread, ISafeByteBufferWriter buffer) { buffer.putString(hostThread.getHost()); buffer.putInt(hostThread.getTid()); }
Source:
public ExecRow makeRow(boolean latestVersion, TupleDescriptor td, TupleDescriptor parent) throws StandardException { ExecIndexRow row; int value = -1; if (td != null) { if (!(td instanceof NaturalNumberDescriptor)) throw new RuntimeException("Unexpected TupleDescriptor " + td.getClass().getName()); NaturalNumberDescriptor nnd = (NaturalNumberDescriptor)td; value = nnd.getValue(); } row = getExecutionFactory().getIndexableRow(SYSNATURALNUMBERS_COLUMN_COUNT); row.setColumn(SYSNATURALNUMBERS_N, new SQLInteger(value)); return row; }

Target:
public ExecRow makeRow(boolean latestVersion, TupleDescriptor td, TupleDescriptor parent) throws StandardException { ExecRow row; int value = -1; if (td != null) { if (!(td instanceof NaturalNumberDescriptor)) throw new RuntimeException("Unexpected TupleDescriptor " + td.getClass().getName()); NaturalNumberDescriptor nnd = (NaturalNumberDescriptor)td; value = nnd.getValue(); } row = getExecutionFactory().getValueRow(SYSNATURALNUMBERS_COLUMN_COUNT); row.setColumn(SYSNATURALNUMBERS_N, new SQLInteger(value)); return row; }
Source:
private File getNextUnusedFilename(File destination, String name) { String nameWithoutSuffix = null; if( name.indexOf('.') == -1 ) { nameWithoutSuffix = name; } else if( name.endsWith(".tar.gz")) nameWithoutSuffix = name.substring(0, name.length() - ".tar.gz".length()); else nameWithoutSuffix = name.substring(0, name.lastIndexOf('.')); String suffix = name.substring(nameWithoutSuffix.length()); int i = 1; String tmpName = null; File file = new File (destination, name); while (file.exists()) { tmpName = nameWithoutSuffix + "(" + i++ + ")" + suffix; file = new File(destination, tmpName); } return file; }

Target:
protected File getNextUnusedFilename(File destination, String name) { String nameWithoutSuffix = null; if( name.indexOf('.') == -1 ) { nameWithoutSuffix = name; } else if( name.endsWith(".tar.gz")) nameWithoutSuffix = name.substring(0, name.length() - ".tar.gz".length()); else nameWithoutSuffix = name.substring(0, name.lastIndexOf('.')); String suffix = name.substring(nameWithoutSuffix.length()); int i = 1; String tmpName = null; File file = new File (destination, name); while (file.exists()) { tmpName = nameWithoutSuffix + "(" + i++ + ")" + suffix; file = new File(destination, tmpName); } return file; }
Source:
public StreetSplitter( Graph graph, HashGridSpatialIndex<Edge> hashGridSpatialIndex, SpatialIndex transitStopIndex ) { this.graph = graph; if (graphsWithSplitters.contains(graph)) { throw new UnsupportedOperationException("Only one street splitter should be active on a graph at any given time"); } LOG.info("New StreetSpiltter created successfully!"); graphsWithSplitters.add(graph); this.transitStopIndex = transitStopIndex; if (hashGridSpatialIndex == null) { synchronized (this) { idx = new HashGridSpatialIndex<>(); for (StreetEdge se : Iterables.filter(graph.getEdges(), StreetEdge.class)) { idx.insert(se.getGeometry(), se); } } } else { idx = hashGridSpatialIndex; } }

Target:
public StreetSplitter( Graph graph, HashGridSpatialIndex<Edge> hashGridSpatialIndex, SpatialIndex transitStopIndex ) { this.graph = graph; if (graphsWithSplitters.contains(graph)) { LOG.warn("Multiple StreetSplitters detected on the same graph! Make sure only the most recently created one is used going forward!"); } LOG.info("New StreetSpiltter created successfully!"); graphsWithSplitters.add(graph); this.transitStopIndex = transitStopIndex; if (hashGridSpatialIndex == null) { synchronized (this) { idx = new HashGridSpatialIndex<>(); for (StreetEdge se : Iterables.filter(graph.getEdges(), StreetEdge.class)) { idx.insert(se.getGeometry(), se); } } } else { idx = hashGridSpatialIndex; } }
Source:
public PythonVisitorContext(AstNode rootAst, PyFileInputTree rootTree, PythonFile pythonFile) { this.rootAst = rootAst; this.rootTree = (PyFileInputTreeImpl) rootTree; this.pythonFile = pythonFile; this.parsingException = null; SymbolTableBuilderVisitor symbolTableBuilderVisitor = new SymbolTableBuilderVisitor(); symbolTableBuilderVisitor.scanFile(this); symbolTable = symbolTableBuilderVisitor.symbolTable(); }

Target:
public PythonVisitorContext(AstNode rootAst, PyFileInputTree rootTree, PythonFile pythonFile) { this.rootAst = rootAst; this.rootTree = rootTree; this.pythonFile = pythonFile; this.parsingException = null; SymbolTableBuilderVisitor symbolTableBuilderVisitor = new SymbolTableBuilderVisitor(); symbolTableBuilderVisitor.scanFile(this); symbolTable = symbolTableBuilderVisitor.symbolTable(); }
Source:
private boolean support( ValueGroup[] valueGroups ) { return valueGroups.length == 1 && ValueGroup.NUMBER.equals( valueGroups[0] ); }

Target:
private boolean support( ValueGroup[] valueGroups ) { return valueGroups.length == 1 && valueGroups[0] == ValueGroup.NUMBER; }
Source:
public org.codice.solr.client.solrj.SolrClient newClient(String coreName) { Args.notEmpty(coreName, "Cannot create Solr client. Solr core name"); String solrDir = getProperty(SOLR_DATA_DIR); Args.notEmpty(solrDir, "Cannot create Solr client. Solr data directory"); ConfigurationStore.getInstance().setDataDirectoryPath(solrDir); LOGGER.debug( "Solr({}): Creating an HTTP Solr client using url [{}]", coreName, getCoreUrl(coreName)); return new SolrClientAdapter(coreName, () -> createSolrHttpClient(coreName)); }

Target:
public org.codice.solr.client.solrj.SolrClient newClient(String coreName) { Validate.notEmpty(coreName, "Solr core name is missing. Cannot create Solr client."); LOGGER.debug( "Solr({}): Creating an HTTP Solr client using url [{}]", coreName, solrSettings.getCoreUrl(coreName)); return new SolrClientAdapter(coreName, () -> createSolrHttpClient(coreName)); }
Source:
public RelBuilder projectExcept(Iterable<RexNode> expressions) { List<RexNode> allExpressions = new ArrayList<>(fields()); for (RexNode excludeExp : expressions) { if (!allExpressions.remove(excludeExp)) { throw RESOURCE.expressionNotFound(excludeExp.toString()).ex(); } } return this.project(allExpressions); }

Target:
public RelBuilder projectExcept(Iterable<RexNode> expressions) { List<RexNode> allExpressions = new ArrayList<>(fields()); Set<RexNode> excludeExpressions = new HashSet<>(); for (RexNode excludeExp : expressions) { if (!excludeExpressions.add(excludeExp)) { throw new IllegalArgumentException( "Input list contains duplicates. Expression " + excludeExp + " exists multiple times."); } if (!allExpressions.remove(excludeExp)) { throw new IllegalArgumentException("Expression " + excludeExp.toString() + " not found."); } } return this.project(allExpressions); }