auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Collection<ContentType> getDirectlyAssociated(final ContentTypeCatalog catalog, final String fileSpec, final int typeMask) { if ((typeMask & (IContentType.FILE_EXTENSION_SPEC | IContentType.FILE_NAME_SPEC)) == 0) { throw new IllegalArgumentException("This method only apply to name or extension based associations"); } final IEclipsePreferences root = context.getNode(ContentTypeManager.CONTENT_TYPE_PREF_NODE); final Set<ContentType> result = new HashSet<>(3); try { root.accept(new IPreferenceNodeVisitor() { @Override public boolean visit(IEclipsePreferences node) { if (node == root) return true; String[] fileSpecs = ContentTypeSettings.getFileSpecs(node, typeMask); for (String fileSpecification : fileSpecs) if (fileSpecification.equalsIgnoreCase(fileSpec)) { ContentType associated = catalog.getContentType(node.name()); if (associated != null) result.add(associated); break; } return false; } }); } catch (BackingStoreException bse) { ContentType.log(ContentMessages.content_errorLoadingSettings, bse); } return result == null ? Collections.EMPTY_SET : result; }

Target:
public Collection<ContentType> getDirectlyAssociated(final ContentTypeCatalog catalog, final String fileSpec, final int typeMask) { if ((typeMask & (IContentType.FILE_EXTENSION_SPEC | IContentType.FILE_NAME_SPEC)) == 0) { throw new IllegalArgumentException("This method only apply to name or extension based associations"); } final IEclipsePreferences root = context.getNode(ContentTypeManager.CONTENT_TYPE_PREF_NODE); final Set<ContentType> result = new HashSet<>(3); try { root.accept(node -> { if (node == root) return true; String[] fileSpecs = ContentTypeSettings.getFileSpecs(node, typeMask); for (String fileSpecification : fileSpecs) if (fileSpecification.equalsIgnoreCase(fileSpec)) { ContentType associated = catalog.getContentType(node.name()); if (associated != null) result.add(associated); break; } return false; }); } catch (BackingStoreException bse) { ContentType.log(ContentMessages.content_errorLoadingSettings, bse); } return result == null ? Collections.EMPTY_SET : result; }
Source:
protected String getFullHelpText() { return "Analysis module: " + getName(); }

Target:
protected String getFullHelpText() { return String.format(Messages.TmfAbstractAnalysisModule_AnalysisModule, getName()); }
Source:
protected ApplicationProcess start(java.io.File appDir, SDKRunnerConfiguration runnerCfg, CodeServerProcess codeServerProcess, ApplicationProcess.Callback callback) throws RunnerException { final java.io.File startUpScriptFile; final java.io.File logsDir = new java.io.File(appDir, LOG_FOLDER); try { generateSetEnvScript(appDir, runnerCfg); startUpScriptFile = generateStartUpScript(appDir, runnerCfg); Files.createDirectory(logsDir.toPath()); } catch (IOException e) { throw new RunnerException(e); } final List<java.io.File> logFiles = new ArrayList<>(1); logFiles.add(new java.io.File(logsDir, LOG_FILE)); return new TomcatProcess(appDir, startUpScriptFile, logFiles, runnerCfg, callback, codeServerProcess, eventService); }

Target:
protected ApplicationProcess start(java.io.File appDir, SDKRunnerConfiguration runnerCfg, CodeServerProcess codeServerProcess, ApplicationProcess.Callback callback) throws RunnerException { final java.io.File startUpScriptFile; final java.io.File logsDir = new java.io.File(appDir, LOG_FOLDER); try { generateSetEnvScript(appDir, runnerCfg); startUpScriptFile = generateStartUpScript(appDir, runnerCfg); Files.createDirectory(logsDir.toPath()); } catch (IOException e) { throw new RunnerException(e); } final List<java.io.File> logFiles = ImmutableList.of(new java.io.File(logsDir, LOG_FILE)); return new TomcatProcess(appDir, startUpScriptFile, logFiles, runnerCfg, callback, codeServerProcess, eventService); }
Source:
private void registerAllOvfDisks(List<DiskImage> ovfStoreDiskImages) { for (DiskImage ovfStoreDiskImage : ovfStoreDiskImages) { ovfStoreDiskImage.setDiskAlias("OVF_STORE"); ovfStoreDiskImage.setDiskDescription("OVF_STORE"); ovfStoreDiskImage.setShareable(true); RegisterDiskParameters registerDiskParams = new RegisterDiskParameters(ovfStoreDiskImage, getParameters().getStorageDomainId()); String result = "succeeded"; try { if (!runInternalAction(VdcActionType.RegisterDisk, registerDiskParams, null).getSucceeded()) { result = "failed"; } } catch (Exception e) { result = "failed"; log.error(e); } log.infoFormat("Register OVF_STORE disk id {0} for storage domain {1} has {2}", ovfStoreDiskImage.getId(), getParameters().getStorageDomainId(), result); } }

Target:
private void registerAllOvfDisks(List<DiskImage> ovfStoreDiskImages) { for (DiskImage ovfStoreDiskImage : ovfStoreDiskImages) { ovfStoreDiskImage.setDiskAlias(OvfInfoFileConstants.OvfStoreDescriptionLabel); ovfStoreDiskImage.setDiskDescription(OvfInfoFileConstants.OvfStoreDescriptionLabel); ovfStoreDiskImage.setShareable(true); RegisterDiskParameters registerDiskParams = new RegisterDiskParameters(ovfStoreDiskImage, getParameters().getStorageDomainId()); String result = "succeeded"; if (!runInternalAction(VdcActionType.RegisterDisk, registerDiskParams, null).getSucceeded()) { result = "failed"; } log.infoFormat("Register new floating OVF_STORE disk with disk id {0} for storage domain {1} has {2}", ovfStoreDiskImage.getId(), getParameters().getStorageDomainId(), result); } }
Source:
private UpdateCalibrationResponse addUnprocessedItem(final String unprocessedItem) { this.unprocessed.add(unprocessedItem); return this; }

Target:
private void addUnprocessedItem(final String unprocessedItem) { this.unprocessed.add(unprocessedItem); }
Source:
public void testConfig_Basic() { Configuration conf = BigtableConfiguration.configure("projectId", "instanceId"); Assert.assertEquals("projectId", conf.get(BigtableOptionsFactory.PROJECT_ID_KEY)); Assert.assertEquals("instanceId", conf.get(BigtableOptionsFactory.INSTANCE_ID_KEY)); Assert.assertEquals(BigtableConfiguration.getConnectionClass().getName(), conf.get("hbase.client.connection.impl")); Assert.assertNull(conf.get(BigtableOptionsFactory.APP_PROFILE_ID_KEY)); }

Target:
public void testConfig_Basic() { Configuration conf = BigtableConfiguration.configure("projectId", "instanceId"); Assert.assertEquals("projectId", conf.get(BigtableOptionsFactory.PROJECT_ID_KEY)); Assert.assertEquals("instanceId", conf.get(BigtableOptionsFactory.INSTANCE_ID_KEY)); Assert.assertNull(conf.get(BigtableOptionsFactory.APP_PROFILE_ID_KEY)); Assert.assertEquals(BigtableConfiguration.getConnectionClass().getName(), conf.get(BigtableConfiguration.HBASE_CLIENT_CONNECTION_IMPL)); }
Source:
private void removeTrailingSlash() { try { URI uri = new URI(settings.getServerURI()); uri = uri.normalize(); String uriString = uri.toString(); if (uriString.endsWith("/")) { settings.setServerURI(uriString.substring(0, uriString.length() - 1)); } } catch (URISyntaxException e) { String message = "There was an error loading json from the DHIS2 settings."; LOGGER.debug(message); throw new JsonIOException(message, e); } }

Target:
private String removeTrailingSlash() throws URISyntaxException { URI uri = new URI(settings.getServerURI()); uri = uri.normalize(); String uriString = uri.toString(); if (uriString.endsWith("/")) { uriString = uriString.substring(0, uriString.length() - 1); } return uriString; }
Source:
public void should_parse_but_not_add_issue_if_inputFile_not_found() { when(ruleFinder.find(any(RuleQuery.class))).thenReturn(Rule.create()); File report = FileUtils.toFile(getClass().getResource("parsing/sample.xml")); when(settings.getString(GroovyPlugin.CODENARC_REPORT_PATH)).thenReturn(report.getAbsolutePath()); File sonarhome = projectdir.newFolder("sonarhome"); FileSystem fileSystem = mock(FileSystem.class); when(fileSystem.predicates()).thenReturn(mock(FilePredicates.class)); when(fileSystem.workDir()).thenReturn(sonarhome); sensor = new CodeNarcSensor(groovy, perspectives, moduleFileSystem, fileSystem, profile, ruleFinder); sensor.analyse(project, context); verify(issuable, never()).addIssue(any(Issue.class)); }

Target:
public void should_parse_but_not_add_issue_if_inputFile_not_found() { when(ruleFinder.find(any(RuleQuery.class))).thenReturn(Rule.create()); File report = FileUtils.toFile(getClass().getResource("parsing/sample.xml")); when(settings.getString(GroovyPlugin.CODENARC_REPORT_PATH)).thenReturn(report.getAbsolutePath()); sensor.analyse(project, context); verify(issuable, never()).addIssue(any(Issue.class)); }
Source:
public static void dropTables() throws Exception { try { disableAndDropNonSystemTables(driver); } finally { try { if (driver != null) { assertTrue(destroyDriver(driver)); } } finally { driver = null; } } }

Target:
public static void dropTables() throws Exception { try { disableAndDropNonSystemTables(driver); } finally { try { assertTrue(destroyDriver(driver)); } finally { driver = null; } } }
Source:
void onPanelDragDrop(DropEvent event) { String vmGid = event.getData("VM_GID"); if (!vmGid.isEmpty()) { Guid vmGuid = Guid.createGuidFromString(vmGid); boolean pinned = Boolean.valueOf(event.getData("PINNED")); int vNumaNodeIndex = Integer.parseInt(event.getData("INDEX")); container.removeStyleName(style.dragOver()); event.preventDefault(); UpdatedVnumaEvent.fire(this, vmGuid, pinned, vNumaNodeIndex, pNumaNodeIndex); } }

Target:
void onPanelDragDrop(DropEvent event) { String vmGid = event.getData("VM_GID"); if (StringUtils.isNotEmpty(vmGid)) { Guid vmGuid = Guid.createGuidFromString(vmGid); boolean pinned = Boolean.valueOf(event.getData("PINNED")); int vNumaNodeIndex = Integer.parseInt(event.getData("INDEX")); container.removeStyleName(style.dragOver()); event.preventDefault(); UpdatedVnumaEvent.fire(this, vmGuid, pinned, vNumaNodeIndex, pNumaNodeIndex); } else { container.removeStyleName(style.dragOver()); } }
Source:
public <T> T withExtractedArchive(TaskRequest request, ArchiveProvider archiveProvider, WithWorkspaceAction<T> func) throws IOException { TempDir workspacePath = null; try { try { workspacePath = RetryExecutor.retryExecutor() .retryIf(exception -> true) .withInitialRetryWait(EXTRACT_MIN_RETRY_WAIT_MS) .withMaxRetryWait(EXTRACT_MAX_RETRY_WAIT_MS) .onRetry((exception, retryCount, retryLimit, retryWait) -> logger.warn("Failed to extract archive: retry of {}", retryCount, retryLimit, exception)) .withRetryLimit(EXTRACT_RETRIES) .run(() -> { TempDir newWorkSpacePath = null; try { newWorkSpacePath = createNewWorkspace(request); Optional<StorageObject> in = archiveProvider.open(); if (in.isPresent()) { ProjectArchives.extractTarArchive(newWorkSpacePath.get(), in.get().getContentInputStream()); } return newWorkSpacePath; } catch (Throwable e) { if (newWorkSpacePath != null) { newWorkSpacePath.close(); } throw e; } }); } catch (RetryExecutor.RetryGiveupException e) { Throwables.propagate(e); } return func.run(workspacePath.get()); } finally { if (workspacePath != null) { workspacePath.close(); } } }

Target:
public <T> T withExtractedArchive(TaskRequest request, ArchiveProvider archiveProvider, WithWorkspaceAction<T> func) throws IOException { TempDir workspacePath = null; try { try { workspacePath = RetryExecutor.retryExecutor() .retryIf(exception -> true) .withInitialRetryWait(EXTRACT_MIN_RETRY_WAIT_MS) .withMaxRetryWait(EXTRACT_MAX_RETRY_WAIT_MS) .onRetry((exception, retryCount, retryLimit, retryWait) -> logger.warn("Failed to extract archive: retry of {}", retryCount, retryLimit, exception)) .withRetryLimit(EXTRACT_RETRIES) .run(() -> { TempDir newWorkSpacePath = null; try { newWorkSpacePath = createNewWorkspace(request); Optional<StorageObject> in = archiveProvider.open(); if (in.isPresent()) { ProjectArchives.extractTarArchive(newWorkSpacePath.get(), in.get().getContentInputStream()); } return newWorkSpacePath; } catch (Throwable e) { if (newWorkSpacePath != null) { newWorkSpacePath.close(); } throw e; } }); } catch (RetryExecutor.RetryGiveupException e) { throw Throwables.propagate(e.getCause()); } return func.run(workspacePath.get()); } finally { if (workspacePath != null) { workspacePath.close(); } } }
Source:
public void verify_put_invoked_one_time_when_invoke_get_default_state_in_multithreaded_environment() { final int numberOfEntities = 1000; final Collection<Callable<Object>> tasks = new ArrayList<>(); for (int i = 0; i < numberOfEntities; i++) { tasks.add(Executors.callable(new Runnable() { @Override public void run() { final TestEntity testEntity = TestEntity.newInstance(newUuid()); testEntity.getDefaultState(); } })); } executeInMultithreadedEnvironment(tasks); final int expected = 1; verify(spyMap, times(expected)).put(any(), any()); assertEquals(expected, spyMap.size()); }

Target:
public void verify_put_invoked_one_time_when_invoke_get_default_state_in_multithreaded_environment() { final int numberOfEntities = 1000; final Collection<Callable<Object>> tasks = newArrayListWithExpectedSize(numberOfEntities); for (int i = 0; i < numberOfEntities; i++) { tasks.add(Executors.callable(new Runnable() { @Override public void run() { final TestEntity testEntity = TestEntity.newInstance(newUuid()); testEntity.getDefaultState(); } })); } executeInMultithreadedEnvironment(tasks); final int expected = 1; verify(spyMap, times(expected)).put(any(), any()); assertEquals(expected, spyMap.size()); }
Source:
public void invoke(@NotNull final Project project, final Editor editor, PsiFile file, DataContext dataContext) { if (!CommonRefactoringUtil.checkReadOnlyStatus(file)) return; if (editor.getSettings().isVariableInplaceRenameEnabled()) { final TemplateState templateState = TemplateManagerImpl.getTemplateState(editor); if (templateState != null && !templateState.isFinished()) return; } SelectionModel selectionModel = editor.getSelectionModel(); List<GoExpression> expressions = selectionModel.hasSelection() ? collectExpressionsInSelection(file, selectionModel) : collectExpressionsAtOffset(file, editor.getDocument(), editor.getCaretModel().getOffset()); if (expressions.size() > 1) { smartIntroduce(project, editor, expressions); } else if (expressions.size() == 1) { GoExpression expression = ContainerUtil.getFirstItem(expressions); if (expression == null) { showCannotPerform(project, editor); return; } performOnElement(project, editor, expression); } else { showCannotPerform(project, editor); } }

Target:
public void invoke(@NotNull final Project project, final Editor editor, PsiFile file, DataContext dataContext) { if (!CommonRefactoringUtil.checkReadOnlyStatus(file)) return; performAction(new GoIntroduceOperation(project, editor, file)); }
Source:
public SearchRequestBuilder buildScrollSearchRequest() { String indices = index != null && !index.isEmpty() ? index : "_all"; List<String> fields = columns.stream() .map(column -> column.getColumnName()) .collect(toList()); SearchRequestBuilder searchRequestBuilder = client.prepareSearch(indices) .setTypes(type) .setSearchType(QUERY_THEN_FETCH) .setScroll(new TimeValue(scrollTimeout.toMillis())) .setFetchSource(fields.toArray(new String[fields.size()]), null) .setQuery(buildSearchQuery()) .setPreference("_shards:" + shard) .setSize(scrollSize); LOG.debug("ElasticSearch Request: %s", searchRequestBuilder); return searchRequestBuilder; }

Target:
public SearchRequestBuilder buildScrollSearchRequest() { String indices = index != null && !index.isEmpty() ? index : "_all"; List<String> fields = columns.stream() .map(ElasticsearchColumnHandle::getColumnName) .collect(toList()); SearchRequestBuilder searchRequestBuilder = client.prepareSearch(indices) .setTypes(type) .setSearchType(QUERY_THEN_FETCH) .setScroll(new TimeValue(scrollTimeout.toMillis())) .setFetchSource(fields.toArray(new String[0]), null) .setQuery(buildSearchQuery()) .setPreference("_shards:" + shard) .setSize(scrollSize); LOG.debug("Elasticsearch Request: %s", searchRequestBuilder); return searchRequestBuilder; }
Source:
public void setHits(long accessHit) { this.accessHit = accessHit > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) accessHit; }

Target:
public void setHits(long accessHit) { this.hits = accessHit > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) accessHit; }
Source:
private List<Item> items(ActivityFormDTO schema, List<LocationDTO> locations, SiteDTO site, List<SiteHistoryDTO> histories) { List<Item> items = new ArrayList<>(); Map<String, Object> baselineState = histories.get(0).getJsonMap(); RenderContext ctx = new RenderContext(schema, locations, site, baselineState); boolean first = true; for (SiteHistoryDTO history : histories) { if (isAttachmentHistoryEntry(history.getEntityName())) { continue; } ctx.setHistory(history); Item item = new Item(); if (first) { if (history.isInitial()) { item.setMsg(I18N.MESSAGES.siteHistoryCreated(history.getDateCreated(), history.getUserName(), history.getUserEmail())); } first = false; } else { item.setMsg(I18N.MESSAGES.siteHistoryUpdated(history.getDateCreated(), history.getUserName(), history.getUserEmail())); item.setDetails(details(ctx)); } items.add(item); } Collections.reverse(items); return items; }

Target:
private List<Item> items(ActivityFormDTO schema, List<LocationDTO> locations, SiteDTO site, List<SiteHistoryDTO> histories) { List<Item> items = new ArrayList<>(); Map<String, Object> baselineState = histories.get(0).getJsonMap(); RenderContext ctx = new RenderContext(schema, locations, site, baselineState); boolean first = true; for (SiteHistoryDTO history : histories) { ctx.setHistory(history); Item item = new Item(); if (first) { if (history.isInitial()) { item.setMsg(I18N.MESSAGES.siteHistoryCreated(history.getDateCreated(), history.getUserName(), history.getUserEmail())); } first = false; } else { item.setMsg(I18N.MESSAGES.siteHistoryUpdated(history.getDateCreated(), history.getUserName(), history.getUserEmail())); item.setDetails(details(ctx)); } items.add(item); } Collections.reverse(items); return items; }
Source:
public void testLoadCatalogFromExternalFile() throws CatalogApiException, IOException, URISyntaxException { URL originURL = Resources.getResource("SpyCarBasic.xml"); File originFile = new File(originURL.toURI()); File destinationFile = new File("/var/tmp/SpyCarBasic.xml"); destinationFile.deleteOnExit(); Files.copy(originFile, destinationFile); final VersionedCatalog c = loader.loadDefaultCatalog(destinationFile.toURI().toString()); Assert.assertEquals(c.getCatalogName(), "SpyCarBasic"); }

Target:
public void testLoadCatalogFromExternalFile() throws CatalogApiException, IOException, URISyntaxException { File originFile = new File(Resources.getResource("SpyCarBasic.xml").toURI()); File destinationFile = new File(Files.createTempDir().toString() + "/SpyCarBasicRelocated.xml"); destinationFile.deleteOnExit(); Files.copy(originFile, destinationFile); final VersionedCatalog c = loader.loadDefaultCatalog(destinationFile.toURI().toString()); Assert.assertEquals(c.getCatalogName(), "SpyCarBasic"); }
Source:
public void presentAnnotationIsAvailable() throws Exception { Method method = ClassWithDummyMethod.class.getMethod("annotatedDummyMethod"); FrameworkMethod frameworkMethod = new FrameworkMethod(method); Annotation annotation = frameworkMethod.getAnnotation(Rule.class); assertThat(annotation, isA((Class)Rule.class)); }

Target:
public void presentAnnotationIsAvailable() throws Exception { Method method = ClassWithDummyMethod.class.getMethod("annotatedDummyMethod"); FrameworkMethod frameworkMethod = new FrameworkMethod(method); Annotation annotation = frameworkMethod.getAnnotation(Rule.class); assertTrue(Rule.class.isAssignableFrom(annotation.getClass())); }
Source:
public void createSubscriptions(Long userId, String[] vocabularyCodes) { for (String vocabularyCode : vocabularyCodes) { if (!notificationRepository.findByUserIdAndVocabularyCode(userId, vocabularyCode).isPresent()) { final VocabularyV5 vocabulary = vocabularyRepository.findOne(vocabularyCode); if (vocabulary != null) { final VocabularyConversion vocabularyConversion = vocabularyConversionRepository.findByIdV5(vocabularyCode); final Notification newNotification = new Notification(userId, vocabularyConversion, vocabularyCode, vocabulary.getVersion()); notificationRepository.save(newNotification); } } } }

Target:
public void createSubscriptions(Long userId, String[] vocabularyCodes) { final List<String> subscribedVocabularies = notificationRepository.findByUserId(userId).stream() .map(Notification::getVocabularyCode).collect(Collectors.toList()); final String[] newVocabulariesToSubscribe = Stream.of(vocabularyCodes) .filter(code -> !subscribedVocabularies.contains(code)).toArray(String[]::new); vocabularyRepository.findByIdIn(newVocabulariesToSubscribe).forEach(vocabulary -> { final VocabularyConversion vocabularyConversion = vocabularyConversionRepository.findByIdV5(vocabulary.getId()); final Notification newNotification = new Notification(userId, vocabularyConversion, vocabulary.getId(), vocabulary.getVersion()); notificationRepository.save(newNotification); }); }
Source:
public Map<UUID, Set<UUID>> createPhysicalLocatorSet(UUID locatorId) throws Exception { Insert<GenericTableSchema> op = plSetTable.insert(locatorId); try { UUID newId = modify(client, plSetTable, op) .result(Duration.Inf()); if (newId == null) throw new VtepException( endPoint, "cannot create locator set for locator: " + locatorId); Map<UUID, Set<UUID>> locatorSet = retrievePhysicalLocatorSet( plSetTable.getUuidMatcher(newId)); if (locatorSet.isEmpty()) throw new VtepException( endPoint, "cannot retrieve locator set for locator: " + locatorId); return locatorSet; } catch (TimeoutException tOut) { throw new VtepException(endPoint, tOut); } }

Target:
public Map<UUID, Set<UUID>> createPhysicalLocatorSet(UUID locatorId) throws Exception { Insert<GenericTableSchema> op = plSetTable.insert(locatorId); try { UUID newId = modify(client, plSetTable, op).result(Duration.Inf()); if (newId == null) throw new VtepException( endPoint, "cannot create locator set for locator: " + locatorId); Map<UUID, Set<UUID>> locatorSet = retrievePhysicalLocatorSet( plSetTable.getUuidMatcher(newId)); if (locatorSet.isEmpty()) throw new VtepRetrievalException( "locator set for locator " + locatorId); return locatorSet; } catch (TimeoutException tOut) { throw new VtepException(endPoint, tOut); } }
Source:
protected void decode(ChannelHandlerContext ctx, Object msg, List<Object> out) throws Exception { if (LOG.isDebugEnabled()) { LOG.debug("Received request from channel to decode.", msg, ctx.channel()); } if (!(msg instanceof ByteBuf)) { out.add(msg); return; } ByteBuf buffer = (ByteBuf) msg; buffer.markReaderIndex(); if (usingV3Protocol) { try { out.add(reqV3.decode(buffer)); } catch (InvalidProtocolBufferException e) { usingV3Protocol = false; buffer.resetReaderIndex(); out.add(reqPreV3.decode(buffer)); } } else { out.add(reqPreV3.decode(buffer)); } }

Target:
protected void decode(ChannelHandlerContext ctx, Object msg, List<Object> out) throws Exception { if (LOG.isTraceEnabled()) { LOG.trace("Received request from channel to decode.", msg, ctx.channel()); } if (!(msg instanceof ByteBuf)) { out.add(msg); return; } ByteBuf buffer = (ByteBuf) msg; buffer.markReaderIndex(); if (usingV3Protocol) { try { out.add(reqV3.decode(buffer)); } catch (InvalidProtocolBufferException e) { usingV3Protocol = false; buffer.resetReaderIndex(); out.add(reqPreV3.decode(buffer)); } } else { out.add(reqPreV3.decode(buffer)); } }
Source:
private boolean azureSingleResourceGroupDeploymentEnabled() { String userCrn = ThreadBasedUserCrnProvider.getUserCrn(); boolean azureSingleResourceGroupDeploymentEnabled = entitlementService.azureSingleResourceGroupDeploymentEnabled(userCrn, Crn.safeFromString(userCrn).getAccountId()); LOGGER.debug("Azure Single Resource Group deployment model is {}, generating default value accordingly!", azureSingleResourceGroupDeploymentEnabled ? "enabled" : "disabled"); return azureSingleResourceGroupDeploymentEnabled; }

Target:
private boolean azureSingleResourceGroupDeploymentEnabled() { String accountId = ThreadBasedUserCrnProvider.getAccountId(); boolean azureSingleResourceGroupDeploymentEnabled = entitlementService.azureSingleResourceGroupDeploymentEnabled(INTERNAL_ACTOR_CRN, accountId); LOGGER.debug("Azure Single Resource Group deployment model is {}, generating default value accordingly!", azureSingleResourceGroupDeploymentEnabled ? "enabled" : "disabled"); return azureSingleResourceGroupDeploymentEnabled; }
Source:
public void testAmILeader() { BooleanResult isLeader1 = new BooleanResult(); BooleanResult isLeader2 = new BooleanResult(); ZkLeaderElector leaderElector1 = new ZkLeaderElector( "1", getZkUtilsWithNewClient(), new ZkLeaderElector.ZkLeaderElectorListener() { @Override public void onBecomingLeader() { isLeader1.res = true; } }); ZkLeaderElector leaderElector2 = new ZkLeaderElector( "2", getZkUtilsWithNewClient(), new ZkLeaderElector.ZkLeaderElectorListener() { @Override public void onBecomingLeader() { isLeader2.res = true; } }); leaderElector1.amILeader(); leaderElector2.amILeader(); Assert.assertFalse(TestZkUtils.testWithDelayBackOff(()->isLeader1.res, 2, 100)); Assert.assertFalse(TestZkUtils.testWithDelayBackOff(()->isLeader2.res, 2, 100)); leaderElector1.tryBecomeLeader(); leaderElector2.tryBecomeLeader(); Assert.assertTrue(leaderElector1.amILeader()); Assert.assertFalse(leaderElector2.amILeader()); }

Target:
public void testAmILeader() { BooleanResult isLeader1 = new BooleanResult(); BooleanResult isLeader2 = new BooleanResult(); ZkLeaderElector leaderElector1 = new ZkLeaderElector( "1", getZkUtilsWithNewClient(), new ZkLeaderElector.ZkLeaderElectorListener() { @Override public void onBecomingLeader() { isLeader1.res = true; } }); ZkLeaderElector leaderElector2 = new ZkLeaderElector( "2", getZkUtilsWithNewClient(), new ZkLeaderElector.ZkLeaderElectorListener() { @Override public void onBecomingLeader() { isLeader2.res = true; } }); Assert.assertFalse(leaderElector1.amILeader()); Assert.assertFalse(leaderElector2.amILeader()); leaderElector1.tryBecomeLeader(); leaderElector2.tryBecomeLeader(); Assert.assertTrue(leaderElector1.amILeader()); Assert.assertFalse(leaderElector2.amILeader()); }
Source:
@Deprecated @Override public ChunkBiomeContainer getBiomes() { throw new UnsupportedOperationException("Chunk method called on a cube"); }

Target:
@Deprecated @Override public ChunkBiomeContainer getBiomes() { return this.cube.getBiomes(); }
Source:
public RelNode convert(RelNode relNode) { FlinkLogicalAggregate agg = (FlinkLogicalAggregate) relNode; RelNode input = agg.getInput(); int[] groupSet = agg.getGroupSet().toArray(); RelTraitSet traitSet = relNode.getTraitSet().replace(FlinkConventions.BATCH_PHYSICAL()); Tuple2<int[], Seq<AggregateCall>> auxGroupSetAndCallsTuple = AggregateUtil.checkAndSplitAggCalls(agg); int[] auxGroupSet = auxGroupSetAndCallsTuple._1; Seq<AggregateCall> aggCallsWithoutAuxGroupCalls = auxGroupSetAndCallsTuple._2; Tuple3<int[][], DataType[][], UserDefinedFunction[]> aggBufferTypesAndFunctions = AggregateUtil.transformToBatchAggregateFunctions( aggCallsWithoutAuxGroupCalls, input.getRowType(), null); UserDefinedFunction[] aggFunctions = aggBufferTypesAndFunctions._3(); RelTraitSet requiredTraitSet = input.getTraitSet() .replace(FlinkConventions.BATCH_PHYSICAL()); if (groupSet.length != 0) { FlinkRelDistribution requiredDistribution = FlinkRelDistribution.hash(groupSet, false); requiredTraitSet = requiredTraitSet.replace(requiredDistribution); RelCollation sortCollation = createRelCollation(groupSet); requiredTraitSet = requiredTraitSet.replace(sortCollation); } else { requiredTraitSet = requiredTraitSet.replace(FlinkRelDistribution.SINGLETON()); } RelNode convInput = RelOptRule.convert(input, requiredTraitSet); return new BatchExecPythonGroupAggregate( relNode.getCluster(), null, traitSet, convInput, agg.getRowType(), convInput.getRowType(), convInput.getRowType(), groupSet, auxGroupSet, aggCallsWithoutAuxGroupCalls, aggFunctions); }

Target:
public RelNode convert(RelNode relNode) { FlinkLogicalAggregate agg = (FlinkLogicalAggregate) relNode; RelNode input = agg.getInput(); int[] groupSet = agg.getGroupSet().toArray(); RelTraitSet traitSet = relNode.getTraitSet().replace(FlinkConventions.BATCH_PHYSICAL()); Tuple2<int[], Seq<AggregateCall>> auxGroupSetAndCallsTuple = AggregateUtil.checkAndSplitAggCalls(agg); int[] auxGroupSet = auxGroupSetAndCallsTuple._1; Seq<AggregateCall> aggCallsWithoutAuxGroupCalls = auxGroupSetAndCallsTuple._2; Tuple3<int[][], DataType[][], UserDefinedFunction[]> aggBufferTypesAndFunctions = AggregateUtil.transformToBatchAggregateFunctions( aggCallsWithoutAuxGroupCalls, input.getRowType(), null); UserDefinedFunction[] aggFunctions = aggBufferTypesAndFunctions._3(); RelTraitSet requiredTraitSet = input.getTraitSet() .replace(FlinkConventions.BATCH_PHYSICAL()); if (groupSet.length != 0) { FlinkRelDistribution requiredDistribution = FlinkRelDistribution.hash(groupSet, false); requiredTraitSet = requiredTraitSet.replace(requiredDistribution); RelCollation sortCollation = createRelCollation(groupSet); requiredTraitSet = requiredTraitSet.replace(sortCollation); } else { requiredTraitSet = requiredTraitSet.replace(FlinkRelDistribution.SINGLETON()); } RelNode convInput = RelOptRule.convert(input, requiredTraitSet); return new BatchExecPythonGroupAggregate( relNode.getCluster(), traitSet, convInput, agg.getRowType(), convInput.getRowType(), convInput.getRowType(), groupSet, auxGroupSet, aggCallsWithoutAuxGroupCalls, aggFunctions); }
Source:
public List<Todo> getTodoList() { ImmutableList<RowResult<byte[]>> results = transactionManager.runTaskWithRetry((transaction) -> { BatchingVisitable<RowResult<byte[]>> rowResultBatchingVisitable = transaction.getRange( TodoSchema.todoTable(), RangeRequest.all()); ImmutableList.Builder<RowResult<byte[]>> rowResults = ImmutableList.builder(); rowResultBatchingVisitable.batchAccept(10, items -> { rowResults.addAll(items); return true; }); return rowResults.build(); }); return results.stream() .map(RowResult::getOnlyColumnValue) .map(ValueType.STRING::convertToString) .map(ImmutableTodo::of) .collect(Collectors.toList()); }

Target:
public List<Todo> getTodoList() { ImmutableList<RowResult<byte[]>> results = transactionManager.runTaskWithRetry((transaction) -> { BatchingVisitable<RowResult<byte[]>> rowResultBatchingVisitable = transaction.getRange( TodoSchema.todoTable(), RangeRequest.all()); ImmutableList.Builder<RowResult<byte[]>> rowResults = ImmutableList.builder(); rowResultBatchingVisitable.batchAccept(1000, items -> { rowResults.addAll(items); return true; }); return rowResults.build(); }); return results.stream() .map(RowResult::getOnlyColumnValue) .map(ValueType.STRING::convertToString) .map(ImmutableTodo::of) .collect(Collectors.toList()); }
Source:
private void shutdown() { Fuseki.serverLog.info("Shutting down dataset") ; dataset.close() ; if ( dataset instanceof DatasetGraphTransaction ) { DatasetGraphTransaction dsgtxn = (DatasetGraphTransaction)dataset ; StoreConnection.release(dsgtxn.getLocation()) ; } dataset = null ; }

Target:
public synchronized void shutdown() { if ( state == CLOSING ) return; Fuseki.serverLog.info(format("Shutting down data service for %s", endpoints.keySet())); expel(dataset); dataset = null; state = CLOSED; }
Source:
public CreativeTabs toNative(Category category, ItemStack item) { if (category.name.startsWith("nova:")) { switch (category.name) { case Category.BUILDING_BLOCKS_NAME: return CreativeTabs.tabBlock; case Category.DECORATIONS_NAME: return CreativeTabs.tabDecorations; case Category.TECHNOLOGY_NAME: return CreativeTabs.tabRedstone; case Category.TRANSPORTATION_NAME: return CreativeTabs.tabTransport; case Category.FOOD_NAME: return CreativeTabs.tabFood; case Category.TOOLS_NAME: return CreativeTabs.tabTools; case Category.COMBAT_NAME: return CreativeTabs.tabCombat; case Category.ALCHEMY_NAME: return CreativeTabs.tabBrewing; case Category.MATERIALS_NAME: return CreativeTabs.tabMaterials; case Category.MISCELLANEOUS_NAME: return CreativeTabs.tabMisc; } } Optional<CreativeTabs> first = Arrays.stream(CreativeTabs.creativeTabArray) .filter(tab -> tab.getTabLabel().equals(category.name)) .findFirst(); if (first.isPresent()) { return first.get(); } else { Optional<Item> categoryItem = category.item; ModCreativeTab tab = new ModCreativeTab(category.name, categoryItem.isPresent() ? Game.natives().toNative(categoryItem.get()) : item); return tab; } }

Target:
public CreativeTabs toNative(Category category, ItemStack item) { if (category.name.startsWith("nova:")) { switch (category.name) { case Category.BUILDING_BLOCKS_NAME: return CreativeTabs.tabBlock; case Category.DECORATIONS_NAME: return CreativeTabs.tabDecorations; case Category.TECHNOLOGY_NAME: return CreativeTabs.tabRedstone; case Category.TRANSPORTATION_NAME: return CreativeTabs.tabTransport; case Category.FOOD_NAME: return CreativeTabs.tabFood; case Category.TOOLS_NAME: return CreativeTabs.tabTools; case Category.COMBAT_NAME: return CreativeTabs.tabCombat; case Category.ALCHEMY_NAME: return CreativeTabs.tabBrewing; case Category.MATERIALS_NAME: return CreativeTabs.tabMaterials; case Category.MISCELLANEOUS_NAME: return CreativeTabs.tabMisc; } } return Arrays.stream(CreativeTabs.creativeTabArray) .filter(tab -> tab.getTabLabel().equals(category.name)) .findFirst() .orElseGet(() -> new ModCreativeTab(category.name, category.item.map(ItemConverter.instance()::toNative).orElse(item))); }
Source:
public TemplateEngineFreemarkerAuthenticityFormDirective(Context context) { this.authenticityToken = context.getSession().getAuthenticityToken(); }

Target:
public TemplateEngineFreemarkerAuthenticityFormDirective(Context context) { this.context = context; }
Source:
public void test() throws InterruptedException { Thread.sleep(5000L); verify(eventListener, atLeast(4)).handleEvent("testSchedulerMultipleExecutions"); verify(eventListener, atLeast(2)).handleEvent("testSchedulerSingleExecution"); verify(eventListener, atMost(3)).handleEvent("testSchedulerSingleExecution"); }

Target:
public void test() throws ReflectiveOperationException, SchedulerException { Field schedulerField = SchedulerServiceImpl.class.getDeclaredField("scheduler"); schedulerField.setAccessible(true); Scheduler scheduler = (Scheduler) schedulerField.get(schedulerService); JobKey jobKey = new JobKey("testSchedulerMultipleExecutions", "nuxeo"); JobDetail jobDetail = scheduler.getJobDetail(jobKey); assertThat(jobDetail).isNotNull(); assertThat(jobDetail.isConcurrentExectionDisallowed()).isFalse(); jobKey = new JobKey("testSchedulerSingleExecution", "nuxeo"); jobDetail = scheduler.getJobDetail(jobKey); assertThat(jobDetail).isNotNull(); assertThat(jobDetail.isConcurrentExectionDisallowed()).isTrue(); }
Source:
private void decrementLatchAndHandle(int count) { if (latch.addAndGet(-count) > 0) { return; } Map<Integer, Object> result = createHashMap(partitionResults.length()); for (int partitionId = 0; partitionId < partitionResults.length(); partitionId++) { Object partitionResult = partitionResults.get(partitionId); if (partitionResult instanceof Throwable) { future.setResult(partitionResult); if (callback != null) { callback.onFailure((Throwable) partitionResult); } return; } if (partitionResult != null) { result.put(partitionId, partitionResult); } } future.setResult(result); if (callback != null) { callback.onResponse(result); } }

Target:
private void decrementLatchAndHandle(int count) { if (latch.addAndGet(-count) > 0) { return; } Map<Integer, Object> result = createHashMap(partitionResults.length()); for (int partitionId = 0; partitionId < partitionResults.length(); partitionId++) { Object partitionResult = partitionResults.get(partitionId); if (partitionResult instanceof Throwable) { future.setResult(partitionResult); if (callback != null) { callback.onFailure((Throwable) partitionResult); } return; } if (partitionResult != null) { result.put(partitionId, partitionResult == NULL_RESULT ? null : partitionResult); } } future.setResult(result); if (callback != null) { callback.onResponse(result); } }
Source:
public NoVotePresenter( EventBus eventBus, MyView view, MyProxy proxy) { super(eventBus, view, proxy, ApplicationPresenter.SLOT_MAIN); }

Target:
NoVotePresenter( EventBus eventBus, MyView view, MyProxy proxy) { super(eventBus, view, proxy, ApplicationPresenter.SLOT_MAIN); }
Source:
public void testRuleDirExpansion() throws Exception { scratch.file( "foo/BUILD", "genrule(name = 'bar',", " srcs = ['bar_in.txt'],", " cmd = 'touch $(RULEDIR)',", " outs = ['bar/bar_out.txt'])", "genrule(name = 'baz',", " srcs = ['bar/bar_out.txt'],", " cmd = 'touch $(RULEDIR)',", " outs = ['logs/baz_out.txt', 'logs/baz.log'])"); getConfiguredTarget(" FileConfiguredTarget bazOutTarget = getFileConfiguredTarget(" SpawnAction bazAction = (SpawnAction) getGeneratingAction(bazOutTarget.getArtifact()); String fooExpected = "touch " + bazOutTarget .getArtifact() .getExecPath() .getParentDirectory() .getParentDirectory() .getPathString(); getConfiguredTarget(" Artifact barOut = bazAction.getInputs().iterator().next(); assertThat(barOut.getExecPath().endsWith(PathFragment.create("foo/bar/bar_out.txt"))).isTrue(); SpawnAction barAction = (SpawnAction) getGeneratingAction(barOut); String barExpected = "touch " + barOut.getExecPath().getParentDirectory().getPathString(); assertCommandEquals(fooExpected, barAction.getArguments().get(2)); assertCommandEquals(fooExpected, bazAction.getArguments().get(2)); assertThat(fooExpected.equals(barExpected)).isFalse(); }

Target:
public void testRuleDirExpansion() throws Exception { scratch.file( "foo/BUILD", "genrule(name = 'bar',", " srcs = ['bar_in.txt'],", " cmd = 'touch $(RULEDIR)',", " outs = ['bar/bar_out.txt'])", "genrule(name = 'baz',", " srcs = ['bar/bar_out.txt'],", " cmd = 'touch $(RULEDIR)',", " outs = ['baz/baz_out.txt', 'logs/baz.log'])"); String expectedRegex = "touch bazel-out.*foo"; assertThat(getCommand(" assertThat(getCommand(" }
Source:
protected boolean canDoAction() { GlusterVolumeEntity volume = getGlusterVolume(); if (!super.canDoAction()) { return false; } if (volume.getAsyncTask() == null || volume.getAsyncTask().getType() != GlusterTaskType.REMOVE_BRICK || volume.getAsyncTask().getStatus() != JobExecutionStatus.STARTED) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_NOT_STARTED); } return true; }

Target:
protected boolean canDoAction() { GlusterVolumeEntity volume = getGlusterVolume(); if (!super.canDoAction()) { return false; } if (!(GlusterTaskUtils.isTaskOfType(volume, GlusterTaskType.REMOVE_BRICK)) || !(GlusterTaskUtils.isTaskStatus(volume, JobExecutionStatus.STARTED))) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_NOT_STARTED); } return true; }
Source:
public final void run() { try (FlowScopeLog log = new FlowScopeLogBuilder(LOGGER, Level.FINE, "TimeGraphView:ZoomThread", "start", fZoomStartTime, "end", fZoomEndTime).setCategoryAndId(getViewId(), fScopeId).build()) { doRun(); } finally { fDirty.updateAndGet(i -> i > 0 ? i - 1 : i); } }

Target:
public final void run() { try (FlowScopeLog log = new FlowScopeLogBuilder(LOGGER, Level.FINE, "TimeGraphView:ZoomThread", "start", fZoomStartTime, "end", fZoomEndTime).setCategoryAndId(getViewId(), fScopeId).build()) { doRun(); } finally { fDirty.incrementAndGet(); } }
Source:
private void populateInheritance(Table table, Set<Table> processed) { if (table.hasParent() && !processed.contains(table)) { Table parent = table.getParent(this.elideTableConfig); if (parent.hasParent()) { populateInheritance(parent, processed); } Map<String, Measure> measures = getInheritedMeasures(table, new HashMap<String, Measure>()); table.setMeasures(new ArrayList<Measure>(measures.values())); Map<String, Dimension> dimensions = getInheritedDimensions(table, new HashMap<String, Dimension>()); table.setDimensions(new ArrayList<Dimension>(dimensions.values())); Map<String, Join> joins = getInheritedJoins(table, new HashMap<String, Join>()); table.setJoins(new ArrayList<Join>(joins.values())); String schema = getInheritedSchema(table); table.setSchema(schema); String dbConnectionName = (String) getInheritedConnection(table); table.setDbConnectionName(dbConnectionName); String sql = (String) getInheritedSql(table); table.setSql(sql); String tableName = (String) getInheritedTable(table); table.setTable(tableName); } processed.add(table); }

Target:
private void populateInheritance(Table table, Set<Table> processed) { if (processed.contains(table)) { return; } processed.add(table); if (!table.hasParent()) { return; } Table parent = table.getParent(this.elideTableConfig); if (!processed.contains(parent)) { populateInheritance(parent, processed); } Map<String, Measure> measures = getInheritedMeasures(parent, attributesListToMap(table.getMeasures())); table.setMeasures(new ArrayList<Measure>(measures.values())); Map<String, Dimension> dimensions = getInheritedDimensions(parent, attributesListToMap(table.getDimensions())); table.setDimensions(new ArrayList<Dimension>(dimensions.values())); Map<String, Join> joins = getInheritedJoins(parent, attributesListToMap(table.getJoins())); table.setJoins(new ArrayList<Join>(joins.values())); String schema = getInheritedSchema(parent, table.getSchema()); table.setSchema(schema); String dbConnectionName = (String) getInheritedConnection(parent, table.getDbConnectionName()); table.setDbConnectionName(dbConnectionName); String sql = (String) getInheritedSql(parent, table.getSql()); table.setSql(sql); String tableName = (String) getInheritedTable(parent, table.getTable()); table.setTable(tableName); }
Source:
protected List<Workflow> githubWebhookDelete(String repository, String gitReference, String username, String installationId) { Optional<String> gitReferenceName = GitHelper.parseGitHubReference(gitReference); if (gitReferenceName.isEmpty()) { String msg = "Reference " + gitReference + " is not of the valid form"; LOG.error(msg); sessionFactory.getCurrentSession().clear(); LambdaEvent lambdaEvent = createBasicEvent(repository, gitReference, username, LambdaEvent.LambdaEventType.DELETE); lambdaEvent.setMessage(msg); lambdaEvent.setSuccess(false); lambdaEventDAO.create(lambdaEvent); sessionFactory.getCurrentSession().getTransaction().commit(); throw new CustomWebApplicationException(msg, LAMBDA_FAILURE); } List<Workflow> workflows = workflowDAO.findAllByPath("github.com/" + repository, false).stream().filter(workflow -> Objects.equals(workflow.getMode(), DOCKSTORE_YML)).collect( Collectors.toList()); workflows.forEach(workflow -> { if (workflow.getActualDefaultVersion() != null && workflow.getActualDefaultVersion().getName().equals(gitReferenceName.get())) { workflow.setActualDefaultVersion(null); } }); workflows.forEach(workflow -> workflow.getWorkflowVersions().removeIf(workflowVersion -> Objects.equals(workflowVersion.getName(), gitReferenceName.get()) && !workflowVersion.isFrozen())); LambdaEvent lambdaEvent = createBasicEvent(repository, gitReference, username, LambdaEvent.LambdaEventType.DELETE); lambdaEventDAO.create(lambdaEvent); return workflows; }

Target:
protected List<Workflow> githubWebhookDelete(String repository, String gitReference, String username, String installationId) { Optional<String> gitReferenceName = GitHelper.parseGitHubReference(gitReference); if (gitReferenceName.isEmpty()) { String msg = "Reference " + gitReference + " is not of the valid form"; LOG.error(msg); sessionFactory.getCurrentSession().clear(); LambdaEvent lambdaEvent = createBasicEvent(repository, gitReference, username, LambdaEvent.LambdaEventType.DELETE); lambdaEvent.setMessage(msg); lambdaEvent.setSuccess(false); lambdaEventDAO.create(lambdaEvent); sessionFactory.getCurrentSession().getTransaction().commit(); throw new CustomWebApplicationException(msg, LAMBDA_FAILURE); } List<Workflow> workflows = workflowDAO.findAllByPath("github.com/" + repository, false).stream().filter(workflow -> Objects.equals(workflow.getMode(), DOCKSTORE_YML)).collect( Collectors.toList()); workflows.forEach(workflow -> { if (workflow.getActualDefaultVersion() != null && workflow.getActualDefaultVersion().getName().equals(gitReferenceName.get())) { Optional<WorkflowVersion> max = workflow.getWorkflowVersions().stream() .filter(v -> !Objects.equals(v.getName(), gitReferenceName.get())) .max(Comparator.comparingLong(ver -> ver.getDate().getTime())); workflow.setActualDefaultVersion(max.orElse(null)); } }); workflows.forEach(workflow -> workflow.getWorkflowVersions().removeIf(workflowVersion -> Objects.equals(workflowVersion.getName(), gitReferenceName.get()) && !workflowVersion.isFrozen())); LambdaEvent lambdaEvent = createBasicEvent(repository, gitReference, username, LambdaEvent.LambdaEventType.DELETE); lambdaEventDAO.create(lambdaEvent); return workflows; }
Source:
protected boolean handle(Op op, int framelen) throws IOException { assert Thread.currentThread() instanceof EitherSide.Reader; switch (op) { case EXIT: onExit(dis.readInt()); return true; case STDOUT: onStdout(readChunk(framelen)); return true; case STDERR: onStderr(readChunk(framelen)); return true; default: return false; } }

Target:
protected boolean handle(Op op, int framelen) throws IOException { assert Thread.currentThread() instanceof EitherSide.Reader; assert !op.clientSide; switch (op) { case EXIT: onExit(dis.readInt()); return true; case STDOUT: onStdout(readChunk(framelen)); return true; case STDERR: onStderr(readChunk(framelen)); return true; default: return false; } }
Source:
public void persist(CatalogItem<?, ?> catalogItem) { checkArgument(getCatalogItem(catalogItem.getSymbolicName(), catalogItem.getVersion()) != null, "Unknown catalog item %s", catalogItem); mgmt.getRebindManager().getChangeListener().onUnmanaged(catalogItem); }

Target:
public void persist(CatalogItem<?, ?> catalogItem) { checkArgument(getCatalogItem(catalogItem.getSymbolicName(), catalogItem.getVersion()) != null, "Unknown catalog item %s", catalogItem); mgmt.getRebindManager().getChangeListener().onChanged(catalogItem); }
Source:
protected Void visitIntegerLiteral(IntegerLiteral node, Integer indent) { builder.append(String.format(Locale.ENGLISH, "%d", node.getValue())); return null; }

Target:
protected Void visitIntegerLiteral(IntegerLiteral node, Integer indent) { builder.append(node.getValue()); return null; }
Source:
public void setParams(Collection<?> set) { if (set != null) { this.set = set; elements = set.toArray(); this.hasS = true; prob = set.isEmpty() ? 1 : 1.0 / set.size(); logprob = set.isEmpty() ? 0 : (-Math.log(set.size())); finiteSupport = elements.clone(); } }

Target:
public void setParams(Collection<?> set) { if (set != null) { this.set = set; elements = set.toArray(); this.hasS = true; prob = set.isEmpty() ? 1 : 1.0 / set.size(); logprob = set.isEmpty() ? 0 : (-Math.log(set.size())); } }
Source:
public void mouseUp(MouseEvent e) { if (DRAG_NONE != _dragState) { setCapture(false); if (e.button == 1 && DRAG_TRACE_ITEM == _dragState) { _timeProvider.notifyStartFinishTime(); if (_dragX == _dragX0) { long time = getTimeAtX(e.x); _timeProvider.setSelectedTimeNotify(time, false); } _dragState = DRAG_NONE; } else if (e.button == 1 && DRAG_SPLIT_LINE == _dragState) { redraw(); _dragState = DRAG_NONE; } else if (e.button == 3 && DRAG_ZOOM == _dragState) { Point size = getCtrlSize(); int nameWidth = _timeProvider.getNameSpace(); int x = e.x - nameWidth; if (Math.max(_dragX, _dragX0) > nameWidth && _dragX != _dragX0) { long time0 = getTimeAtX(_dragX0); long time1 = getTimeAtX(_dragX); if (time0 < time1) { _timeProvider.setStartFinishTimeNotify(time0, time1); } else { _timeProvider.setStartFinishTimeNotify(time1, time0); } } else { redraw(); } _dragState = DRAG_NONE; } } }

Target:
public void mouseUp(MouseEvent e) { if (fPendingMenuDetectEvent != null && e.button == 3 && _dragX == _dragX0) { setCapture(false); _dragState = DRAG_NONE; menuDetectedImpl(fPendingMenuDetectEvent); } if (DRAG_NONE != _dragState) { setCapture(false); if (e.button == 1 && DRAG_TRACE_ITEM == _dragState) { _timeProvider.notifyStartFinishTime(); if (_dragX == _dragX0) { long time = getTimeAtX(e.x); _timeProvider.setSelectedTimeNotify(time, false); } _dragState = DRAG_NONE; } else if (e.button == 1 && DRAG_SPLIT_LINE == _dragState) { redraw(); _dragState = DRAG_NONE; } else if (e.button == 3 && DRAG_ZOOM == _dragState) { Point size = getCtrlSize(); int nameWidth = _timeProvider.getNameSpace(); int x = e.x - nameWidth; if (Math.max(_dragX, _dragX0) > nameWidth && _dragX != _dragX0) { long time0 = getTimeAtX(_dragX0); long time1 = getTimeAtX(_dragX); if (time0 < time1) { _timeProvider.setStartFinishTimeNotify(time0, time1); } else { _timeProvider.setStartFinishTimeNotify(time1, time0); } } else { redraw(); } _dragState = DRAG_NONE; } } }
Source:
public static BodyBuilder method(HttpMethod method, String uri) { return new DefaultBodyBuilder(method, new UriTemplate(uri)); }

Target:
public static BodyBuilder method(HttpMethod method, String uri) { return new DefaultBodyBuilder(method, uri); }