auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static JSONObject convert(ImmutableGraph<?, ?> graph) { final JSONObject jsonGraph = new JSONObject(); final JSONArray jsonEdgesArray = new JSONArray(); final JSONArray jsonVerticesArray = new JSONArray(); jsonGraph.put("edges", jsonEdgesArray); jsonGraph.put("vertices", jsonVerticesArray); if (graph != null) { graph.asGenericGraph().getProperties().forEach((key, value) -> jsonGraph.put(key, value)); graph.getEdges().stream().forEach(edge -> { final GenericEdge genericEdge = edge.asGenericEdge(); final Map<String, Object> edgeProperties = new HashMap<>(genericEdge.getProperties()); edgeProperties.put("source", genericEdge.getSource().getId()); edgeProperties.put("target", genericEdge.getTarget().getId()); final JSONObject jsonEdge = new JSONObject(edgeProperties); jsonEdgesArray.put(jsonEdge); }); graph.getVertices().stream().forEach(vertex -> { final JSONObject jsonVertex = new JSONObject(vertex.asGenericVertex().getProperties()); jsonVerticesArray.put(jsonVertex); }); final Focus defaultFocus = graph.getDefaultFocus(); final JSONObject jsonFocus = new JSONObject(); jsonFocus.put("type", defaultFocus.getId()); jsonFocus.put("vertexIds", new JSONArray(defaultFocus.getVertexRefs())); jsonGraph.put("defaultFocus", jsonFocus); } return jsonGraph; }

Target:
public static JSONObject convert(ImmutableGraph<?, ?> graph) { final JSONObject jsonGraph = new JSONObject(); final JSONArray jsonEdgesArray = new JSONArray(); final JSONArray jsonVerticesArray = new JSONArray(); jsonGraph.put("edges", jsonEdgesArray); jsonGraph.put("vertices", jsonVerticesArray); if (graph != null) { graph.asGenericGraph().getProperties().forEach((key, value) -> jsonGraph.put(key, value)); graph.getEdges().stream() .sorted(Comparator.comparing(Edge::getId)) .forEach(edge -> { final GenericEdge genericEdge = edge.asGenericEdge(); final Map<String, Object> edgeProperties = new HashMap<>(genericEdge.getProperties()); edgeProperties.put("source", genericEdge.getSource().getId()); edgeProperties.put("target", genericEdge.getTarget().getId()); final JSONObject jsonEdge = new JSONObject(edgeProperties); jsonEdgesArray.put(jsonEdge); }); graph.getVertices().stream() .sorted(Comparator.comparing(Vertex::getId)) .forEach(vertex -> { final JSONObject jsonVertex = new JSONObject(vertex.asGenericVertex().getProperties()); jsonVerticesArray.put(jsonVertex); }); final Focus defaultFocus = graph.getDefaultFocus(); final JSONObject jsonFocus = new JSONObject(); jsonFocus.put("type", defaultFocus.getId()); jsonFocus.put("vertexIds", new JSONArray(defaultFocus.getVertexRefs())); jsonGraph.put("defaultFocus", jsonFocus); } return jsonGraph; }
Source:
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setIncludeEventTypes(EventType.EVTS_ALL); if (indexingDisabled) { GridQueryProcessor.idxCls = DummyQueryIndexing.class; cfg.setSystemViewExporterSpi(new JmxSystemViewExporterSpi() { @Override protected void register(SystemView<?> sysView) { } }); } return cfg; }

Target:
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); cfg.setIncludeEventTypes(EventType.EVTS_ALL); if (indexingDisabled) GridQueryProcessor.idxCls = DummyQueryIndexing.class; return cfg; }
Source:
public void update() throws APIException { Map<String, Object> body = new HashMap<String, Object>() {{ put("name", name); }}; APIFileSet fileSet = postResource(selfURI, body, APIFileSet.class); clone(fileSet); }

Target:
public void update() throws APIException { APIFileSet fileSet = postResource(selfURI, Collections.singletonMap("name", name), APIFileSet.class); clone(fileSet); }
Source:
public void commitDropTable(Table table, boolean deleteData) throws MetaException { String dataSourceName = Preconditions .checkNotNull(table.getParameters().get(Constants.DRUID_DATA_SOURCE), "WTF dataSource name is null !" ); if (deleteData == true) { LOG.info(String.format("Dropping with purge all the data for data source [%s]", dataSourceName )); List<DataSegment> dataSegmentList = DruidStorageHandlerUtils .getDataSegment(connector, druidMetadataStorageTablesConfig, dataSourceName); if (dataSegmentList.isEmpty()) { LOG.info(String.format("Nothing to delete for data source [%s]", dataSourceName)); return; } for (DataSegment dataSegment : dataSegmentList) { try { deleteSegment(dataSegment); } catch (SegmentLoadingException e) { LOG.error(String.format("Error while deleting segment [%s]", dataSegment.getIdentifier()), e ); } } } if (DruidStorageHandlerUtils .disableDataSource(connector, druidMetadataStorageTablesConfig, dataSourceName)) { LOG.info(String.format("Successfully dropped druid data source [%s]", dataSourceName)); } }

Target:
public void commitDropTable(Table table, boolean deleteData) throws MetaException { if (MetaStoreUtils.isExternalTable(table)) { return; } String dataSourceName = Preconditions .checkNotNull(table.getParameters().get(Constants.DRUID_DATA_SOURCE), "DataSource name is null !" ); if (deleteData == true) { LOG.info(String.format("Dropping with purge all the data for data source [%s]", dataSourceName )); List<DataSegment> dataSegmentList = DruidStorageHandlerUtils .getDataSegmentList(connector, druidMetadataStorageTablesConfig, dataSourceName); if (dataSegmentList.isEmpty()) { LOG.info(String.format("Nothing to delete for data source [%s]", dataSourceName)); return; } for (DataSegment dataSegment : dataSegmentList) { try { deleteSegment(dataSegment); } catch (SegmentLoadingException e) { LOG.error(String.format("Error while deleting segment [%s]", dataSegment.getIdentifier()), e ); } } } if (DruidStorageHandlerUtils .disableDataSource(connector, druidMetadataStorageTablesConfig, dataSourceName)) { LOG.info(String.format("Successfully dropped druid data source [%s]", dataSourceName)); } }
Source:
public AzureLeaderElector(LeaseBlobManager leaseBlobManager) { this.isLeader = new AtomicBoolean(false); this.leaseBlobManager = leaseBlobManager; this.isLeader = new AtomicBoolean(false); this.leaseId = new AtomicReference<>(null); }

Target:
public AzureLeaderElector(LeaseBlobManager leaseBlobManager) { this.isLeader = new AtomicBoolean(false); this.leaseBlobManager = leaseBlobManager; this.leaseId = new AtomicReference<>(null); }
Source:
protected PlanNodeStatsEstimate visitComparisonExpression(ComparisonExpression node, Void context) { ComparisonExpressionType type = node.getType(); Expression left = node.getLeft(); Expression right = node.getRight(); if (!(left instanceof SymbolReference) && right instanceof SymbolReference) { return process(new ComparisonExpression(type.flip(), right, left)); } if (left instanceof Literal && !(right instanceof Literal)) { return process(new ComparisonExpression(type.flip(), right, left)); } if (right instanceof Literal) { Optional<Symbol> symbol = asSymbol(left); SymbolStatsEstimate leftStats = getSymbolStatsEstimate(left); OptionalDouble literal = doubleValueFromLiteral(getType(left), (Literal) right); return comparisonExpressionToLiteralStats(input, symbol, leftStats, literal, type); } if (right instanceof SymbolReference) { return comparisonSymbolToSymbolStats(input, Symbol.from(left), Symbol.from(right), type); } return filterStatsForUnknownExpression(input); }

Target:
protected PlanNodeStatsEstimate visitComparisonExpression(ComparisonExpression node, Void context) { ComparisonExpressionType type = node.getType(); Expression left = node.getLeft(); Expression right = node.getRight(); checkArgument(!(left instanceof Literal && right instanceof Literal), "Literal-to-literal not supported here, should be eliminated earlier"); if (!(left instanceof SymbolReference) && right instanceof SymbolReference) { return process(new ComparisonExpression(type.flip(), right, left)); } if (left instanceof Literal && !(right instanceof Literal)) { return process(new ComparisonExpression(type.flip(), right, left)); } Optional<Symbol> leftSymbol = asSymbol(left); SymbolStatsEstimate leftStats = getExpressionStats(left); if (right instanceof Literal) { OptionalDouble literal = doubleValueFromLiteral(getType(left), (Literal) right); return comparisonExpressionToLiteralStats(input, leftSymbol, leftStats, literal, type); } Optional<Symbol> rightSymbol = asSymbol(right); SymbolStatsEstimate rightStats = getExpressionStats(right); if (isSingleValue(rightStats)) { OptionalDouble value = isNaN(rightStats.getLowValue()) ? OptionalDouble.empty() : OptionalDouble.of(rightStats.getLowValue()); return comparisonExpressionToLiteralStats(input, leftSymbol, leftStats, value, type); } return comparisonExpressionToExpressionStats(input, leftSymbol, leftStats, rightSymbol, rightStats, type); }
Source:
public void handleUnimprovedHoursSpentInputChange( ChangeEvent event ) { try { Long value = unimprovedHoursSpentInput.getValue().isEmpty() ? null : Long.parseLong( unimprovedHoursSpentInput.getValue() ); presenter.onUnimprovedHoursSpentChange( value ); } catch ( NumberFormatException e ) { } }

Target:
public void handleUnimprovedHoursSpentInputChange( ChangeEvent event ) { boolean isNumeric = unimprovedHoursSpentInput.getValue().matches( "\\d+" ); if (isNumeric) { presenter.onUnimprovedHoursSpentChange( Long.parseLong( unimprovedHoursSpentInput.getValue() ) ); } else { presenter.onUnimprovedHoursSpentChange( 0l ); unimprovedHoursSpentInput.setValue( "0" ); } }
Source:
public CapabilityList findAll() { List<Capability> capabilities = Lists.newArrayList(); for (Map.Entry<Integer, Capability> entry : values.entrySet()) { capabilities.add(entry.getValue()); } return new CapabilityList(capabilities); }

Target:
public CapabilityList findAll() { List<Capability> capabilities = Lists.newArrayList(this.capabilities.values()); return new CapabilityList(capabilities); }
Source:
public void selectTenant(final WebContext ctx, String id) { if ("main".equals(id) || Strings.areEqual(determineOriginalTenantId(ctx), id)) { UserAccount<?, ?> account = UserContext.getCurrentUser().as(UserAccount.class); auditLog.neutral("AuditLog.switchedToMainTenant") .hideFromUser() .causedByUser(account.getUniqueName(), account.getUserAccountData().getLogin().getUsername()) .forUser(account.getUniqueName(), account.getUserAccountData().getLogin().getUsername()) .forTenant(String.valueOf(account.getTenant().getId()), account.getTenant().getValue().getTenantData().getName()) .log(); ctx.setSessionValue(UserContext.getCurrentScope().getScopeId() + TenantUserManager.TENANT_SPY_ID_SUFFIX, null); ctx.respondWith().redirectTemporarily(ctx.get("goto").asString(wondergemRoot)); return; } assertPermission(TenantUserManager.PERMISSION_SELECT_TENANT); Optional<T> tenant = resolveAccessibleTenant(id, determineCurrentTenant(ctx)); if (!tenant.isPresent()) { UserContext.get().addMessage(Message.error(NLS.get("TenantController.cannotBecomeTenant"))); selectTenants(ctx); return; } T effectiveTenant = tenant.get(); auditLog.neutral("AuditLog.selectedTenant") .hideFromUser() .causedByCurrentUser() .forCurrentUser() .forTenant(String.valueOf(effectiveTenant.getId()), effectiveTenant.getTenantData().getName()) .log(); ctx.setSessionValue(UserContext.getCurrentScope().getScopeId() + TenantUserManager.TENANT_SPY_ID_SUFFIX, effectiveTenant.getIdAsString()); ctx.respondWith().redirectTemporarily(ctx.get("goto").asString(wondergemRoot)); }

Target:
public void selectTenant(final WebContext ctx, String id) { if ("main".equals(id) || Strings.areEqual(determineOriginalTenantId(ctx), id)) { String originalUserId = tenants.getTenantUserManager().getOriginalUserId(); UserAccount<?, ?> account = tenants.getTenantUserManager().fetchAccount(originalUserId); auditLog.neutral("AuditLog.switchedToMainTenant") .hideFromUser() .causedByUser(account.getUniqueName(), account.getUserAccountData().getLogin().getUsername()) .forUser(account.getUniqueName(), account.getUserAccountData().getLogin().getUsername()) .forTenant(account.getTenant().getIdAsString(), account.getTenant().getValue().getTenantData().getName()) .log(); ctx.setSessionValue(UserContext.getCurrentScope().getScopeId() + TenantUserManager.TENANT_SPY_ID_SUFFIX, null); ctx.respondWith().redirectTemporarily(ctx.get("goto").asString(wondergemRoot)); return; } assertPermission(TenantUserManager.PERMISSION_SELECT_TENANT); Optional<T> tenant = resolveAccessibleTenant(id, determineCurrentTenant(ctx)); if (!tenant.isPresent()) { UserContext.get().addMessage(Message.error(NLS.get("TenantController.cannotBecomeTenant"))); selectTenants(ctx); return; } T effectiveTenant = tenant.get(); auditLog.neutral("AuditLog.selectedTenant") .hideFromUser() .causedByCurrentUser() .forCurrentUser() .forTenant(effectiveTenant.getIdAsString(), effectiveTenant.getTenantData().getName()) .log(); ctx.setSessionValue(UserContext.getCurrentScope().getScopeId() + TenantUserManager.TENANT_SPY_ID_SUFFIX, effectiveTenant.getIdAsString()); ctx.respondWith().redirectTemporarily(ctx.get("goto").asString(wondergemRoot)); }
Source:
public List<ReplicaId> getReplicaIdsByState(ReplicaState state, String dcName) { List<ReplicaId> result = new ArrayList<>(); if (state.equals(ReplicaState.STANDBY.name())) { for (ReplicaId replicaId : replicas) { if (dcName == null || replicaId.getDataNodeId().getDatacenterName().equals(dcName)) { result.add(replicaId); } } } return result; }

Target:
public List<ReplicaId> getReplicaIdsByState(ReplicaState state, String dcName) { List<ReplicaId> result = new ArrayList<>(); if (state == ReplicaState.STANDBY) { result = replicas.stream() .filter(k -> dcName == null || k.getDataNodeId().getDatacenterName().equals(dcName)) .collect(Collectors.toList()); } return Collections.unmodifiableList(result); }
Source:
public TypeVariableName withBounds(Type... bounds) { return get(name, bounds); }

Target:
public TypeVariableName withBounds(Type... bounds) { return withBounds(TypeName.list(bounds)); }
Source:
public void testProjectWithNoTags() throws CoreException { IProject project = createProject("Project_1", (String) null); List knownTags = Arrays.asList(repositoryManager .getKnownTags(CVSWorkspaceRoot.getCVSFolderFor(project))); assertTrue(knownTags.isEmpty()); repositoryManager.refreshDefinedTags( CVSWorkspaceRoot.getCVSFolderFor(project), true, true, DEFAULT_MONITOR); assertTrue(knownTags.isEmpty()); }

Target:
public void testProjectWithNoTags() throws CoreException { IProject project = createProject("Project_1", (String) null); CVSTag knownTags[] = repositoryManager.getKnownTags(CVSWorkspaceRoot .getCVSFolderFor(project)); assertEquals(0, knownTags.length); knownTags = refreshTags(project); assertEquals(0, knownTags.length); }
Source:
public static Optional<Path> getFastpassPath(Project project) { Optional<Path> root = PantsUtil.findPantsExecutable(project).map(VirtualFile::getParent).map(r -> Paths.get(r.getCanonicalPath())); if(!root.isPresent()){ throw new PantsException("Not a pants project"); } return root.map(r -> r.resolve("fastpass/bin/fastpass")); }

Target:
public static Optional<Path> getFastpassPath(Project project) { Optional<Path> root = PantsUtil.findPantsExecutable(project).map(VirtualFile::getParent).map(r -> Paths.get(r.getCanonicalPath())); if(!root.isPresent()){ throw new PantsException("Not a Pants project"); } Optional<Path> fastpassPath = root.map(r -> r.resolve("fastpass/bin/fastpass")); if(fastpassPath.map(p -> p.toFile().exists()).orElse(false)){ return fastpassPath; } else { return Optional.empty(); } }
Source:
private void editQuestion(FeedbackQuestionAttributes updatedQuestion) throws InvalidParametersException, EntityDoesNotExistException { String err = validateQuestionGiverRecipientVisibility(updatedQuestion); if (!err.isEmpty()) { statusToUser.add(new StatusMessage(err, StatusMessageColor.DANGER)); isError = true; } String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); FeedbackQuestionDetails updatedQuestionDetails = updatedQuestion.getQuestionDetails(); List<String> questionDetailsErrors = updatedQuestionDetails.validateQuestionDetails(courseId); List<StatusMessage> questionDetailsErrorsMessages = new ArrayList<>(); for (String error : questionDetailsErrors) { questionDetailsErrorsMessages.add(new StatusMessage(error, StatusMessageColor.DANGER)); } if (questionDetailsErrors.isEmpty()) { logic.updateFeedbackQuestionNumber(updatedQuestion); statusToUser.add(new StatusMessage(Const.StatusMessages.FEEDBACK_QUESTION_EDITED, StatusMessageColor.SUCCESS)); statusToAdmin = "Feedback Question " + updatedQuestion.questionNumber + " for session:<span class=\"bold\">(" + updatedQuestion.feedbackSessionName + ")</span> for Course <span class=\"bold\">[" + updatedQuestion.courseId + "]</span> edited.<br>" + "<span class=\"bold\">" + updatedQuestionDetails.getQuestionTypeDisplayName() + ":</span> " + SanitizationHelper.sanitizeForHtml(updatedQuestionDetails.getQuestionText()); } else { statusToUser.addAll(questionDetailsErrorsMessages); isError = true; } }

Target:
private void editQuestion(FeedbackQuestionAttributes updatedQuestion) throws InvalidParametersException, EntityDoesNotExistException { String err = validateQuestionGiverRecipientVisibility(updatedQuestion); if (!err.isEmpty()) { statusToUser.add(new StatusMessage(err, StatusMessageColor.DANGER)); isError = true; } String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); FeedbackQuestionDetails updatedQuestionDetails = updatedQuestion.getQuestionDetails(); List<String> questionDetailsErrors = updatedQuestionDetails.validateQuestionDetails(courseId); List<StatusMessage> questionDetailsErrorsMessages = new ArrayList<>(); for (String error : questionDetailsErrors) { questionDetailsErrorsMessages.add(new StatusMessage(error, StatusMessageColor.DANGER)); } if (questionDetailsErrors.isEmpty()) { logic.updateFeedbackQuestionNumber(updatedQuestion); statusToUser.add(new StatusMessage(Const.StatusMessages.FEEDBACK_QUESTION_EDITED, StatusMessageColor.SUCCESS)); statusToAdmin = "Feedback Question " + updatedQuestion.questionNumber + " for session:<span class=\"bold\">(" + updatedQuestion.feedbackSessionName + ")</span> for Course <span class=\"bold\">[" + updatedQuestion.courseId + "]</span> edited.<br>" + "<span class=\"bold\">" + updatedQuestionDetails.getQuestionTypeDisplayName() + ":</span> " + SanitizationHelper.sanitizeForHtml(updatedQuestionDetails.getQuestionText()); } else { statusToUser.addAll(questionDetailsErrorsMessages); isError = true; } }
Source:
public void onTextSelected(ActionMode mode) { webViewActionMode = mode; Menu menu = mode.getMenu(); menu.findItem(getSystemMenuItemByName(menu, "select_all").getItemId()).setVisible(false); menu.findItem(getSystemMenuItemByName(menu, "web_search").getItemId()).setVisible(false); MenuItem shareItem = getSystemMenuItemByName(menu, "share"); if (shareItem == null) { shareItem = mode.getMenu().add(Menu.NONE, Menu.NONE, Menu.NONE, activity.getString(R.string.menu_share_page)); shareItem.setIcon(R.drawable.ic_share_dark); MenuItemCompat.setShowAsAction(shareItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT); } if (WikipediaApp.getInstance().isFeatureSelectTextAndShareTutorialEnabled() && WikipediaApp.getInstance().getOnboardingStateMachine().isShareTutorialEnabled()) { showShareOnboarding(shareItem); WikipediaApp.getInstance().getOnboardingStateMachine().setShareTutorial(); } shareItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { requestTextSelection(); if (webViewActionMode != null) { webViewActionMode.finish(); webViewActionMode = null; } return true; } }); createFunnel(); funnel.logHighlight(); }

Target:
public void onTextSelected(ActionMode mode) { webViewActionMode = mode; Menu menu = mode.getMenu(); hideSystemMenuItems(menu, "select_all", "web_search"); MenuItem shareItem = getSystemMenuItemByName(menu, "share"); if (shareItem == null) { shareItem = menu.add(Menu.NONE, Menu.NONE, Menu.NONE, activity.getString(R.string.menu_share_page)); shareItem.setIcon(R.drawable.ic_share_dark); MenuItemCompat.setShowAsAction(shareItem, MenuItemCompat.SHOW_AS_ACTION_ALWAYS | MenuItemCompat.SHOW_AS_ACTION_WITH_TEXT); } if (WikipediaApp.getInstance().isFeatureSelectTextAndShareTutorialEnabled() && WikipediaApp.getInstance().getOnboardingStateMachine().isShareTutorialEnabled()) { showShareOnboarding(shareItem); WikipediaApp.getInstance().getOnboardingStateMachine().setShareTutorial(); } shareItem.setOnMenuItemClickListener(new MenuItem.OnMenuItemClickListener() { @Override public boolean onMenuItemClick(MenuItem item) { requestTextSelection(); if (webViewActionMode != null) { webViewActionMode.finish(); webViewActionMode = null; } return true; } }); createFunnel(); funnel.logHighlight(); }
Source:
public boolean checkout(AbstractBuild build, Launcher launcher, BuildListener listener, File changelogFile) throws IOException, InterruptedException { SCM scm = getScm(); if(scm==null) return true; FilePath workspace = build.getWorkspace(); if(workspace!=null){ workspace.mkdirs(); } else{ return true; } boolean r = scm.checkout(build, launcher, workspace, listener, changelogFile); if (r) { calcPollingBaseline(build, launcher, listener); } return r; }

Target:
public boolean checkout(AbstractBuild build, Launcher launcher, BuildListener listener, File changelogFile) throws IOException, InterruptedException { SCM scm = getScm(); if(scm==null) return true; FilePath workspace = build.getWorkspace(); if(workspace!=null){ workspace.mkdirs(); } else { throw new AbortException("Cannot checkout SCM, workspace is not defined"); } boolean r = scm.checkout(build, launcher, workspace, listener, changelogFile); if (r) { calcPollingBaseline(build, launcher, listener); } return r; }
Source:
Map<SectionMatcher, Project.NameKey> getAllSections() { Map<SectionMatcher, Project.NameKey> all = Maps.newLinkedHashMap(); Project.NameKey p = getProject().getNameKey(); if (isAllProjects) { for (SectionMatcher m : getLocalAccessSections()) { all.put(m, p); } return all; } for (ProjectState s : tree()) { for (SectionMatcher m : s.getLocalAccessSections()) { all.put(m, s.getProject().getNameKey()); } } return all; }

Target:
List<SectionMatcher> getAllSections() { if (isAllProjects) { return getLocalAccessSections(); } List<SectionMatcher> all = Lists.newArrayList(); for (ProjectState s : tree()) { all.addAll(s.getLocalAccessSections()); } return all; }
Source:
public void testIncludeExcludePatternNoConflict() throws IOException { ReliableEventReader reader = new ReliableSpoolingFileEventReader.Builder() .spoolDirectory(WORK_DIR) .ignorePattern("^file[013]$") .includePattern("^file2$") .deletePolicy(DeletePolicy.IMMEDIATE.toString()) .build(); List<File> before = listFiles(WORK_DIR); Assert.assertEquals("Expected 5, not: " + before, 5, before.size()); List<Event> events; do { events = reader.readEvents(10); reader.commit(); } while (!events.isEmpty()); List<File> after = listFiles(WORK_DIR); Assert.assertEquals("Expected 4, not: " + after, 4, after.size()); Set<String> expectedLeftFiles = new HashSet<String>( Arrays.asList("file0", "file1", "file3", "emptylineFile")); for (File f: after) { expectedLeftFiles.remove(f.getName()); } Assert.assertTrue("Unexpected files were sent", expectedLeftFiles.isEmpty()); List<File> trackerFiles = listFiles(new File(WORK_DIR, SpoolDirectorySourceConfigurationConstants.DEFAULT_TRACKER_DIR)); Assert.assertEquals("Expected 0, not: " + trackerFiles, 0, trackerFiles.size()); }

Target:
public void testIncludeExcludePatternNoConflict() throws IOException { ReliableEventReader reader = new ReliableSpoolingFileEventReader.Builder() .spoolDirectory(WORK_DIR) .ignorePattern("^file[013]$") .includePattern("^file2$") .deletePolicy(DeletePolicy.IMMEDIATE.toString()) .build(); String[] beforeFiles = { "file0", "file1", "file2", "file3", "emptylineFile" }; Assert.assertTrue("Expected " + beforeFiles.length + " files in working dir", checkLeftFilesInDir(WORK_DIR, beforeFiles)); processEventsWithReader(reader, 10); String[] files = { "file0", "file1", "file3", "emptylineFile" }; Assert.assertTrue("Expected " + files.length + " files left in working dir", checkLeftFilesInDir(WORK_DIR, files)); Assert.assertTrue("Expected no files left in tracker dir", checkLeftFilesInDir(TRACKER_DIR, new String[0])); }
Source:
public void dispose() { disposed = true; if(sourceDocument != null && documentListener != null) { sourceDocument.removeDocumentListener(documentListener); sourceDocument = null; documentListener = null; } if(sourcePage != null) { Object outlinePage = sourcePage.getAdapter(IContentOutlinePage.class); if(outlinePage instanceof ConfigurableContentOutlinePage) { ((ConfigurableContentOutlinePage) outlinePage).setEditorPart(null); } } MavenPluginActivator.getDefault().getMavenProjectManager().removeMavenProjectChangedListener(this); if(structuredModel != null) { structuredModel.releaseFromEdit(); } if(activationListener != null) { activationListener.dispose(); activationListener = null; } ResourcesPlugin.getWorkspace().removeResourceChangeListener(MavenPomEditor.this); super.dispose(); }

Target:
public void dispose() { disposed = true; if(sourceDocument != null && documentListener != null) { sourceDocument.removeDocumentListener(documentListener); sourceDocument = null; documentListener = null; } MavenPluginActivator.getDefault().getMavenProjectManager().removeMavenProjectChangedListener(this); if(structuredModel != null) { structuredModel.releaseFromEdit(); } if(activationListener != null) { activationListener.dispose(); activationListener = null; } ResourcesPlugin.getWorkspace().removeResourceChangeListener(MavenPomEditor.this); super.dispose(); }
Source:
public ArticlePage navigateToCategoryMemberPage() { WebElement member = driver.findElement(categoryMembers); String memberName = member.getText(); wait.forXMilliseconds(1500); wait.forElementClickable(member); member.click(); new Loading(driver).handleAsyncPageReload(); PageObjectLogging.logInfo(String.format("You were redirected to page: \"%s\".", memberName)); return new ArticlePage(); }

Target:
public ArticlePage navigateToCategoryMemberPage() { new SkinHelper(driver).isSkin(Skin.MERCURY); WebElement member = driver.findElement(categoryMembers); String memberName = member.getText(); wait.forElementClickable(member); member.click(); new Loading(driver).handleAsyncPageReload(); PageObjectLogging.logInfo(String.format("You were redirected to page: \"%s\".", memberName)); new SkinHelper(driver).isSkin(Skin.MERCURY); return new ArticlePage(); }
Source:
private SqlMap<InMemoryTableElement<InMemoryEdge>> newEdgeMap() { return new SqlMap<InMemoryTableElement<InMemoryEdge>>( tableNameWithPrefix(EDGE_TABLE_NAME), KEY_COLUMN_NAME, VALUE_COLUMN_NAME, dataSource, serializer) { @Override protected Map<String, Object> additionalColumns(String key, InMemoryTableElement<InMemoryEdge> value) { SqlTableEdge edge = (SqlTableEdge) value; Map<String, Object> columns = new HashMap<>(); columns.put(IN_VERTEX_ID_COLUMN, edge.inVertexId()); columns.put(OUT_VERTEX_ID_COLUMN, edge.outVertexId()); return columns; } }; }

Target:
protected SqlMap<InMemoryTableElement<InMemoryEdge>> newEdgeMap() { return new SqlMap<InMemoryTableElement<InMemoryEdge>>( tableNameWithPrefix(EDGE_TABLE_NAME), KEY_COLUMN_NAME, VALUE_COLUMN_NAME, dataSource, serializer) { @Override protected Map<String, Object> additionalColumns(String key, InMemoryTableElement<InMemoryEdge> value) { SqlTableEdge edge = (SqlTableEdge) value; Map<String, Object> columns = new HashMap<>(); columns.put(IN_VERTEX_ID_COLUMN, edge.inVertexId()); columns.put(OUT_VERTEX_ID_COLUMN, edge.outVertexId()); return columns; } }; }
Source:
public void initializeGeneralConfigs () { GeneralConfig generalConfig = generalConfigRepository.getGeneralConfigByName("log.level"); setLogLevel(generalConfig.getValue()); }

Target:
public void initializeGeneralConfigs () { GeneralConfig generalConfig = generalConfigRepository.getGeneralConfigByName("log.level"); LoggerUtil.setLogLevel(generalConfig.getValue()); }
Source:
public Map<Import, String> getImportXML(final Metadata metadata, final List<Import> imports) { final Map<Import, String> importXML = new HashMap<>(); if (imports.size() > 0) { for (final String xml : getOtherDMNDiagramsXML(metadata)) { try (StringReader sr = toStringReader(xml)) { final Definitions definitions = marshaller.unmarshal(sr); findImportByDefinitions(definitions, imports).ifPresent(anImport -> { importXML.put(anImport, xml); }); } } } return importXML; }

Target:
public Map<Import, String> getImportXML(final Metadata metadata, final List<Import> imports) { final Map<Import, String> importXML = new HashMap<>(); if (imports.size() > 0) { for (final String xml : getOtherDMNDiagramsXML(metadata)) { try (final StringReader sr = toStringReader(xml)) { final Definitions definitions = marshaller.unmarshal(sr); findImportByDefinitions(definitions, imports).ifPresent(anImport -> { importXML.put(anImport, xml); }); } } } return importXML; }
Source:
public <T extends OAuth2AuthorizedClient> T loadAuthorizedClient(String clientRegistrationId, String principalName) { Assert.hasText(clientRegistrationId, "clientRegistrationId cannot be empty"); Assert.hasText(principalName, "principalName cannot be empty"); Object[] args = {clientRegistrationId, principalName}; int[] argTypes = {Types.VARCHAR, Types.VARCHAR}; PreparedStatementSetter pss = new ArgumentTypePreparedStatementSetter(args, argTypes); List<OAuth2AuthorizedClientData> result = this.jdbcOperations.query( LOAD_AUTHORIZED_CLIENT_SQL, pss, this.authorizedClientDataRowMapper); return !result.isEmpty() ? (T) this.authorizedClientDataConverter.convert(result.get(0)) : null; }

Target:
public <T extends OAuth2AuthorizedClient> T loadAuthorizedClient(String clientRegistrationId, String principalName) { Assert.hasText(clientRegistrationId, "clientRegistrationId cannot be empty"); Assert.hasText(principalName, "principalName cannot be empty"); SqlParameterValue[] parameters = new SqlParameterValue[] { new SqlParameterValue(Types.VARCHAR, clientRegistrationId), new SqlParameterValue(Types.VARCHAR, principalName) }; PreparedStatementSetter pss = new ArgumentPreparedStatementSetter(parameters); List<OAuth2AuthorizedClient> result = this.jdbcOperations.query( LOAD_AUTHORIZED_CLIENT_SQL, pss, this.authorizedClientRowMapper); return !result.isEmpty() ? (T) result.get(0) : null; }
Source:
public int hashCode() { return 42; }

Target:
public int hashCode() { return Objects.hashCode(mPath); }
Source:
protected boolean isHotPlugSupported() { if (Config.<Boolean> GetValue(ConfigValues.HotPlugEnabled, getVds().getVdsGroupCompatibilityVersion() .getValue())) { return true; } addCanDoActionMessage(VdcBllMessages.HOT_PLUG_IS_NOT_SUPPORTED); return false; }

Target:
protected boolean isHotPlugSupported() { if (FeatureSupported.hotPlug(getVds().getVdsGroupCompatibilityVersion())) { return true; } addCanDoActionMessage(VdcBllMessages.HOT_PLUG_IS_NOT_SUPPORTED); return false; }
Source:
public void selectByValue(String value) { Optional<WebElement> matchingButton = getButtons().stream() .filter(b -> b.getAttribute("value").equals(value)) .findFirst(); selectButton(matchingButton .orElseThrow(() -> new NoSuchElementException( "Cannot locate radio button with value: " + value))); }

Target:
public void selectByValue(String value) { Optional<WebElement> matchingButton = getButtons().stream() .filter(b -> value.equals(b.getAttribute("value"))) .findFirst(); selectButton(matchingButton .orElseThrow(() -> new NoSuchElementException( String.format("Cannot locate radio button with value: %s", value)))); }
Source:
static void encodeCubes(PacketBuffer out, Collection<Cube> cubes) { cubes.forEach(cube -> { out.writeBoolean(cube.isEmpty()); out.writeBoolean(cube.getStorage() != null); out.writeBoolean(cube.getBiomeArray() != null); }); cubes.forEach(cube -> { if (!cube.isEmpty()) { cube.getStorage().getData().write(out); } }); cubes.forEach(cube -> { if (cube.getStorage() != null) { out.writeBytes(cube.getStorage().getBlockLight().getData()); } }); cubes.forEach(cube -> { if (cube.getStorage() != null && cube.getWorld().provider.hasSkyLight()) { out.writeBytes(cube.getStorage().getSkyLight().getData()); } }); cubes.forEach(cube -> { if (!cube.isEmpty()) { byte[] heightmaps = ((ServerHeightMap) cube.getColumn().getOpacityIndex()).getDataForClient(); assert heightmaps.length == Cube.SIZE * Cube.SIZE * Integer.BYTES; out.writeBytes(heightmaps); } }); cubes.forEach(cube -> { if (cube.getBiomeArray() != null) out.writeBytes(cube.getBiomeArray()); }); }

Target:
static void encodeCubes(PacketBuffer out, Collection<Cube> cubes) { cubes.forEach(cube -> { byte flags = 0; if(cube.isEmpty()) flags |= 1; if(cube.getStorage() != null) flags |= 2; if(cube.getBiomeArray() != null) flags |= 4; out.writeByte(flags); }); cubes.forEach(cube -> { if (!cube.isEmpty()) { cube.getStorage().getData().write(out); } }); cubes.forEach(cube -> { if (cube.getStorage() != null) { out.writeBytes(cube.getStorage().getBlockLight().getData()); } }); cubes.forEach(cube -> { if (cube.getStorage() != null && cube.getWorld().provider.hasSkyLight()) { out.writeBytes(cube.getStorage().getSkyLight().getData()); } }); cubes.forEach(cube -> { if (!cube.isEmpty()) { byte[] heightmaps = ((ServerHeightMap) cube.getColumn().getOpacityIndex()).getDataForClient(); assert heightmaps.length == Cube.SIZE * Cube.SIZE * Integer.BYTES; out.writeBytes(heightmaps); } }); cubes.forEach(cube -> { if (cube.getBiomeArray() != null) out.writeBytes(cube.getBiomeArray()); }); }
Source:
protected final AuditMessageType getParticipantObjectIdentificationForRequest(T request, AssertionType assertion, AuditMessageType auditMsg) { ParticipantObjectIdentificationType participantObject = buildBaseParticipantObjectIdentificationType(getPayloadFromRequest(request)); byte[] baos = marshallToByteArrayFromRequest(request); TypeValuePairType oType = getTypeValuePairType(baos); participantObject.getParticipantObjectDetail().add(oType); auditMsg.getParticipantObjectIdentification().add(participantObject); return auditMsg; }

Target:
protected final AuditMessageType getParticipantObjectIdentificationForRequest(T request, AssertionType assertion, AuditMessageType auditMsg) { ParticipantObjectIdentificationType participantObject = buildBaseParticipantObjectIdentificationType(getPayloadFromRequest(request)); byte[] bArray = marshallToByteArrayFromRequest(request); TypeValuePairType oType = getTypeValuePairType(bArray); participantObject.getParticipantObjectDetail().add(oType); auditMsg.getParticipantObjectIdentification().add(participantObject); return auditMsg; }
Source:
public DeploymentGroup getDeploymentGroup(final String name) throws DeploymentGroupDoesNotExistException { log.debug("getting deployment-group: {}", name); final ZooKeeperClient client = provider.get("getDeploymentGroupResponse"); return getDeploymentGroup(client, name); }

Target:
public DeploymentGroup getDeploymentGroup(final String name) throws DeploymentGroupDoesNotExistException { log.debug("getting deployment-group: {}", name); final ZooKeeperClient client = provider.get("getDeploymentGroup"); return getDeploymentGroup(client, name); }
Source:
private RateLimiterRegistry createRateLimiterRegistry( RateLimiterConfigurationProperties rateLimiterConfigurationProperties, RegistryEventConsumer<RateLimiter> rateLimiterRegistryEventConsumer, CompositeCustomizer<RateLimiterConfigCustomizer> compositeRateLimiterCustomizer) { Map<String, RateLimiterConfig> configs = rateLimiterConfigurationProperties.getConfigs() .entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, entry -> rateLimiterConfigurationProperties .createRateLimiterConfig(entry.getValue(), compositeRateLimiterCustomizer, entry.getKey()))); return RateLimiterRegistry.of(configs, rateLimiterRegistryEventConsumer, rateLimiterConfigurationProperties.getTags()); }

Target:
private RateLimiterRegistry createRateLimiterRegistry( RateLimiterConfigurationProperties rateLimiterConfigurationProperties, RegistryEventConsumer<RateLimiter> rateLimiterRegistryEventConsumer, CompositeCustomizer<RateLimiterConfigCustomizer> compositeRateLimiterCustomizer) { Map<String, RateLimiterConfig> configs = rateLimiterConfigurationProperties.getConfigs() .entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, entry -> rateLimiterConfigurationProperties .createRateLimiterConfig(entry.getValue(), compositeRateLimiterCustomizer, entry.getKey()))); return RateLimiterRegistry.of(configs, rateLimiterRegistryEventConsumer, Map.copyOf(rateLimiterConfigurationProperties.getTags())); }
Source:
public void returns_list_of_errors_in_the_order_they_were_asserted() { softly.assertThat(class1ForTesting).isClassy(); softly.assertThat(class2ForTesting).isNotClassy(); assertThat(softly.errorsCollected()).as("size").hasSize(2); assertThat(softly.errorsCollected().get(0)).as("0").hasMessage("Not classy"); assertThat(softly.errorsCollected().get(1)).as("1").hasMessage("Classy"); }

Target:
public void returns_list_of_errors_in_the_order_they_were_asserted() { softly.assertThat(class1ForTesting).isClassy(); softly.assertThat(class2ForTesting).isNotClassy(); softly.assertThat("String").isEqualTo("Strung"); List<Throwable> errorsCollected = softly.errorsCollected(); assertThat(errorsCollected).as("size").hasSize(3); assertThat(errorsCollected.get(0)).as("0").hasMessage("Not classy"); assertThat(errorsCollected.get(1)).as("1").hasMessage("Classy"); assertThat(errorsCollected.get(2)).as("2").hasMessageMatching("(?s).*String.*equal to.*Strung.*not.*"); assertThat(errorsCollected).isEqualTo(softly.assertionErrorsCollected()); }
Source:
public boolean isHammingSimilar(ImmutableRoaringBitmap other, int tolerance) { final int size1 = highLowContainer.size(); final int size2 = other.highLowContainer.size(); int pos1 = 0; int pos2 = 0; int budget = tolerance; while(budget >= 0) { short key1 = this.highLowContainer.getKeyAtIndex(pos1); short key2 = other.highLowContainer.getKeyAtIndex(pos2); while(Util.compareUnsigned(key1, key2) < 0 && pos1 < size1) { budget -= highLowContainer.getContainerAtIndex(pos1).getCardinality(); key1 = highLowContainer.getKeyAtIndex(pos1++); } while(Util.compareUnsigned(key2, key1) < 0 && pos2 < size2) { budget -= other.highLowContainer.getContainerAtIndex(pos2).getCardinality(); key2 = other.highLowContainer.getKeyAtIndex(pos2++); } if(budget < 0) { return false; } if(pos1 == size1 || pos2 == size2) { break; } MappeableContainer left = highLowContainer.getContainerAtIndex(pos1++); MappeableContainer right = other.highLowContainer.getContainerAtIndex(pos2++); budget -= left.xorCardinality(right); } while(budget >= 0 && pos1 < size1) { MappeableContainer container = highLowContainer.getContainerAtIndex(pos1++); budget -= container.getCardinality(); } while(budget >= 0 && pos2 < size2) { MappeableContainer container = other.highLowContainer.getContainerAtIndex(pos2++); budget -= container.getCardinality(); } return budget >= 0; }

Target:
public boolean isHammingSimilar(ImmutableRoaringBitmap other, int tolerance) { final int size1 = highLowContainer.size(); final int size2 = other.highLowContainer.size(); int pos1 = 0; int pos2 = 0; int budget = tolerance; while(budget >= 0 && pos1 < size1 && pos2 < size2) { final short key1 = highLowContainer.getKeyAtIndex(pos1); final short key2 = other.highLowContainer.getKeyAtIndex(pos2); MappeableContainer left = highLowContainer.getContainerAtIndex(pos1); MappeableContainer right = other.highLowContainer.getContainerAtIndex(pos2); if(key1 == key2) { budget -= left.xorCardinality(right); ++pos1; ++pos2; } else if(Util.compareUnsigned(key1, key2) < 0) { budget -= left.getCardinality(); ++pos1; } else { budget -= right.getCardinality(); ++pos2; } } while(budget >= 0 && pos1 < size1) { MappeableContainer container = highLowContainer.getContainerAtIndex(pos1++); budget -= container.getCardinality(); } while(budget >= 0 && pos2 < size2) { MappeableContainer container = other.highLowContainer.getContainerAtIndex(pos2++); budget -= container.getCardinality(); } return budget >= 0; }
Source:
public static <K, V> DefaultedMap<K, V> defaultedMap(final Map<K, V> map, final Factory<? extends V> factory) { if (factory == null) { throw new NullPointerException("Factory must not be null"); } return new DefaultedMap<>(map, FactoryTransformer.factoryTransformer(factory)); }

Target:
public static <K, V> DefaultedMap<K, V> defaultedMap(final Map<K, V> map, final Factory<? extends V> factory) { return new DefaultedMap<>(map, FactoryTransformer.factoryTransformer( Objects.requireNonNull(factory, "Factory must not be null"))); }
Source:
public void test_evalute_Cookies () { browser.setUrl("<LINK_0>"); waitForMilliseconds(1000); browser.evaluate("document.cookie = \"cookie1=value1\";"); browser.evaluate("document.cookie = \"cookie2=value2\";"); String res = (String) browser.evaluate("return document.cookie;"); assertTrue(!res.isEmpty()); }

Target:
public void test_evalute_Cookies () { final AtomicBoolean loaded = new AtomicBoolean(false); browser.addProgressListener(ProgressListener.completedAdapter(event -> loaded.set(true))); browser.setUrl("<LINK_0>"); waitForPassCondition(() -> loaded.get()); browser.evaluate("document.cookie = \"cookie1=value1\";"); browser.evaluate("document.cookie = \"cookie2=value2\";"); String res = (String) browser.evaluate("return document.cookie;"); assertTrue(!res.isEmpty()); }
Source:
public void subscribe_renderGroup() { String sectionLabel = "section label"; String questionLabel = "question label"; List<Section> sectionList = getSectionList(sectionLabel, questionLabel, "group"); when(mPage.getSections()).thenReturn(sectionList); LinearLayout sectionLayout = new LinearLayout(Cache.getContext()); when(mFormDisplayPageView.createSectionLayout(sectionLabel)).thenReturn(sectionLayout); LinearLayout questionLayout = new LinearLayout(Cache.getContext()); when(mFormDisplayPageView.createQuestionGroupLayout(questionLabel)).thenReturn(questionLayout); presenter.subscribe(); verify(mFormDisplayPageView).createSectionLayout(sectionList.get(0).getLabel()); verify(mFormDisplayPageView).attachSectionToView(sectionLayout); verify(mFormDisplayPageView).attachQuestionToSection(sectionLayout, questionLayout); }

Target:
public void subscribe_renderGroup() { List<Section> sectionList = getSectionList(sectionLabel, questionLabel, "group"); when(mPage.getSections()).thenReturn(sectionList); LinearLayout sectionLayout = new LinearLayout(Cache.getContext()); when(mFormDisplayPageView.createSectionLayout(sectionLabel)).thenReturn(sectionLayout); LinearLayout questionLayout = new LinearLayout(Cache.getContext()); when(mFormDisplayPageView.createQuestionGroupLayout(questionLabel)).thenReturn(questionLayout); presenter.subscribe(); verify(mFormDisplayPageView).createSectionLayout(sectionList.get(0).getLabel()); verify(mFormDisplayPageView).attachSectionToView(sectionLayout); verify(mFormDisplayPageView).attachQuestionToSection(sectionLayout, questionLayout); }
Source:
public String getQualifiedName() { return StyleResolver.getQualifiedItemName(mySelectedValue.myValue); }

Target:
public String getQualifiedName() { return StyleResolver.getQualifiedItemName(getSelectedValue()); }
Source:
private void InitVdsBroker() { log.infoFormat("Initialize vdsBroker ({0},{1})", _vds.getHostName(), _vds.getPort()); int clientTimeOut = Config.<Integer> getValue(ConfigValues.vdsTimeout) * 1000; int connectionTimeOut = Config.<Integer> getValue(ConfigValues.vdsConnectionTimeout) * 1000; int clientRetries = Config.<Integer> getValue(ConfigValues.vdsRetries); if (_vds.getPort() == 4044) { _vdsProxy = new JsonRpcVdsServer(JsonRpcUtils.createClient(_vds.getHostName(), _vds.getPort(), connectionTimeOut, clientTimeOut, clientRetries, Config.<Boolean> getValue(ConfigValues.EncryptHostCommunication))); } else { Pair<VdsServerConnector, HttpClient> returnValue = XmlRpcUtils.getConnection(_vds.getHostName(), _vds.getPort(), clientTimeOut, connectionTimeOut, clientRetries, VdsServerConnector.class, Config.<Boolean> getValue(ConfigValues.EncryptHostCommunication)); _vdsProxy = new VdsServerWrapper(returnValue.getFirst(), returnValue.getSecond()); } }

Target:
private void InitVdsBroker() { log.infoFormat("Initialize vdsBroker ({0},{1})", _vds.getHostName(), _vds.getPort()); int clientTimeOut = Config.<Integer> getValue(ConfigValues.vdsTimeout) * 1000; int connectionTimeOut = Config.<Integer> getValue(ConfigValues.vdsConnectionTimeout) * 1000; int clientRetries = Config.<Integer> getValue(ConfigValues.vdsRetries); if (_vds.getPort() == JSONRPC_PORT) { _vdsProxy = new JsonRpcVdsServer(JsonRpcUtils.createClient(_vds.getHostName(), _vds.getPort(), connectionTimeOut, clientTimeOut, clientRetries, Config.<Boolean> getValue(ConfigValues.EncryptHostCommunication))); } else { Pair<VdsServerConnector, HttpClient> returnValue = XmlRpcUtils.getConnection(_vds.getHostName(), _vds.getPort(), clientTimeOut, connectionTimeOut, clientRetries, VdsServerConnector.class, Config.<Boolean> getValue(ConfigValues.EncryptHostCommunication)); _vdsProxy = new VdsServerWrapper(returnValue.getFirst(), returnValue.getSecond()); } }
Source:
public void add(SchemaObject obj) { if (SysProperties.CHECK && obj.getSchema() != this) { throw DbException.throwInternalError("wrong schema"); } String name = obj.getName(); Map<String, SchemaObject> map = getMap(obj.getType()); if (SysProperties.CHECK && map.get(name) != null) { throw DbException.throwInternalError("object already exists: " + name); } map.put(name, obj); freeUniqueName(name); }

Target:
public void add(SchemaObject obj) { if (SysProperties.CHECK && obj.getSchema() != this) { DbException.throwInternalError("wrong schema"); } String name = obj.getName(); Map<String, SchemaObject> map = getMap(obj.getType()); if (SysProperties.CHECK && map.get(name) != null) { DbException.throwInternalError("object already exists: " + name); } map.put(name, obj); freeUniqueName(name); }
Source:
public void handleDebugEvents(DebugEvent[] events) { for (DebugEvent event : events) { if (event.getKind() == DebugEvent.TERMINATE) { Object source = event.getSource(); if (source instanceof IProcess) { ILaunch launch = ((IProcess) source).getLaunch(); if (launch != null) { ILaunchConfiguration lc = launch.getLaunchConfiguration(); if (lc != null && lc.equals(nodeDebugLaunch)) { try { SessionStorage.get().remove(server); server.publish(IServer.PUBLISH_INCREMENTAL, new NullProgressMonitor()); } finally { DebugPlugin.getDefault().removeDebugEventListener(this); } } } } } } }

Target:
public void handleDebugEvents(DebugEvent[] events) { for (DebugEvent event : events) { if (event.getKind() == DebugEvent.TERMINATE) { ILaunchConfiguration lc = getLaunchConfiguration(event); if (lc != null && lc.equals(nodeDebugLaunch)) { try { SessionStorage.get().remove(server); if (server.getServerState() == IServer.STATE_STARTED) { server.publish(IServer.PUBLISH_INCREMENTAL, new NullProgressMonitor()); } } finally { DebugPlugin.getDefault().removeDebugEventListener(this); } } } } }
Source:
public static String sanitize(String s) { return s.replaceAll("[^A-Za-z0-9]+", "-"); }

Target:
public static String sanitize(String s) { return CharMatcher.inRange('A', 'Z') .or(CharMatcher.inRange('a', 'z')) .or(CharMatcher.inRange('0', '9')) .negate() .trimAndCollapseFrom(s, '-'); }
Source:
private static void playSound(final String filename) { try { Media media = new Media(Audio.class.getResource(filename).toString()); MediaPlayer mp = new MediaPlayer(media); mp.play(); mps.add(mp); } catch (MediaException e) { System.err.println("Could not instantiate Media Player"); } }

Target:
private static void playSound(final String filename) { try { Media media = new Media(Audio.class.getResource(filename).toString()); MediaPlayer mp = new MediaPlayer(media); mp.play(); mps.add(mp); } catch (MediaException e) { Logger.warning("Could not instantiate Media Player"); } }
Source:
private static File locateTestsArtifact(String version, File target, boolean enterprise) { File artifact = new File(LOCAL_M2_REPOSITORY_PREFIX + constructPathForTests(version, enterprise)); if (artifact.exists()) { return artifact; } else { return downloadMemberTests(version, target, enterprise); } }

Target:
private static File locateTestsArtifact(String version, File target, boolean enterprise) { File artifact = new File(LOCAL_M2_REPOSITORY_PREFIX + constructPathForTests(version, enterprise)); if (artifact.exists()) { return artifact; } else { return downloadTestsArtifact(version, target, enterprise); } }