auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testField01() { SWTBotView viewBot = fBot.viewById(FilterView.ID); viewBot.setFocus(); SWTBot filterBot = viewBot.bot(); SWTBotTree treeBot = filterBot.tree(); viewBot.toolbarButton("Add new filter").click(); treeBot.getTreeItem("FILTER <name>").select(); SWTBotText textBot = filterBot.text(); textBot.setFocus(); String filterName = "field"; textBot.setText(filterName); SWTBotTreeItem filterNodeBot = treeBot.getTreeItem(FILTER_TEST + filterName); filterNodeBot.click(); filterNodeBot.contextMenu("TRACETYPE").click(); filterNodeBot.expand(); SWTBotCombo comboBot = filterBot.comboBox(); comboBot.setSelection(TRACETYPE); filterNodeBot.getNode(WITH_TRACETYPE).expand(); filterNodeBot.getNode(WITH_TRACETYPE).contextMenu(COMPARE).click(); SWTBotTreeItem contentNode = filterNodeBot.getNode(WITH_TRACETYPE).getNode("<select aspect> " + "=" + " <value>"); contentNode.expand(); comboBot = selectCombo(filterBot); comboBot.setSelection(comboBot.itemCount() - 1); textBot = filterBot.text(0); textBot.setFocus(); textBot.setText(filterName); textBot = filterBot.text(1); textBot.setFocus(); textBot.setText("1.5"); filterBot.radio(2).click(); viewBot.toolbarButton("Save filters").click(); String ret = applyFilter(fBot, filterName); assertEquals("50/100", ret); }

Target:
public void testField01() { SWTBotView viewBot = fBot.viewById(FilterView.ID); viewBot.setFocus(); SWTBot filterBot = viewBot.bot(); SWTBotTree treeBot = filterBot.tree(); viewBot.toolbarButton("Add new filter").click(); treeBot.getTreeItem("FILTER <name>").select(); SWTBotText textBot = filterBot.text(); textBot.setFocus(); String filterName = "field"; textBot.setText(filterName); SWTBotTreeItem filterNodeBot = treeBot.getTreeItem(FILTER_TEST + filterName); filterNodeBot.click(); filterNodeBot.contextMenu("TRACETYPE").click(); filterNodeBot.expand(); SWTBotCombo comboBot = filterBot.comboBox(); comboBot.setSelection(TRACETYPE); filterNodeBot.getNode(WITH_TRACETYPE).expand(); filterNodeBot.getNode(WITH_TRACETYPE).contextMenu(COMPARE).click(); SWTBotTreeItem contentNode = filterNodeBot.getNode(WITH_TRACETYPE).getNode("<select aspect> " + "=" + " <value>"); contentNode.expand(); comboBot = filterBot.comboBox(); comboBot.setSelection(comboBot.itemCount() - 1); textBot = filterBot.text(0); textBot.setFocus(); textBot.setText(filterName); textBot = filterBot.text(1); textBot.setFocus(); textBot.setText("1.5"); filterBot.radio(2).click(); viewBot.toolbarButton("Save filters").click(); String ret = applyFilter(fBot, filterName); assertEquals("50/100", ret); }
Source:
public void run() { final long start = System.nanoTime(); final Map<String, String> tags = MetricsConstants.newSuccessTagsMap(); try { this.jobSubmitterService.submitJob( this.jobRequest, this.cluster, this.command, this.applications, this.memory ); } catch (final GenieException e) { log.error("Unable to submit job due to exception: {}", e.getMessage(), e); MetricsConstants.addFailureTagsWithException(tags, e); } catch (Throwable t) { MetricsConstants.addFailureTagsWithException(tags, t); throw t; } finally { final long finish = System.nanoTime(); this.registry.timer( submitTimerId.withTags(tags) ).record(finish - start, TimeUnit.NANOSECONDS); } }

Target:
public void run() { final long start = System.nanoTime(); final Map<String, String> tags = MetricsUtils.newSuccessTagsMap(); try { this.jobSubmitterService.submitJob( this.jobRequest, this.cluster, this.command, this.applications, this.memory ); } catch (final GenieException e) { log.error("Unable to submit job due to exception: {}", e.getMessage(), e); MetricsUtils.addFailureTagsWithException(tags, e); } catch (Throwable t) { MetricsUtils.addFailureTagsWithException(tags, t); throw t; } finally { final long finish = System.nanoTime(); this.registry.timer( submitTimerId.withTags(tags) ).record(finish - start, TimeUnit.NANOSECONDS); } }
Source:
public void serverAboutToStart(GameAboutToStartServerEvent event) { if (this.platform != null) { logger.warning("FMLServerStartingEvent occurred when FMLServerStoppingEvent hasn't"); WorldEdit.getInstance().getPlatformManager().unregister(platform); } this.platform = new SpongePlatform(this); this.provider = new SpongePermissionsProvider(); WorldEdit.getInstance().getPlatformManager().register(platform); }

Target:
public void serverAboutToStart(GameAboutToStartServerEvent event) { if (this.platform != null) { logger.warn("GameAboutToStartServerEvent occurred when GameStoppingServerEvent hasn't"); WorldEdit.getInstance().getPlatformManager().unregister(platform); } this.platform = new SpongePlatform(this); this.provider = new SpongePermissionsProvider(); WorldEdit.getInstance().getPlatformManager().register(platform); }
Source:
private long grabLocksAndRun(SweepLocks locks) throws InterruptedException { boolean sweptSuccessfully = false; try { locks.lockOrRefresh(); if (locks.haveLocks()) { sweptSuccessfully = runOnce(); } else { log.debug("Skipping sweep because sweep is running elsewhere."); } } catch (InsufficientConsistencyException e) { log.warn("Could not sweep because not all nodes of the database are online.", e); } catch (RuntimeException e) { specificTableSweeper.getSweepMetrics().sweepError(); if (checkAndRepairTableDrop()) { log.info("The table being swept by the background sweeper was dropped, moving on..."); } else { SweepBatchConfig lastBatchConfig = getAdjustedBatchConfig(); log.warn("The background sweep job failed unexpectedly with batch config {}." + " Attempting to continue with a lower batch size...", SafeArg.of("candidateBatchSize", lastBatchConfig.candidateBatchSize()), SafeArg.of("deleteBatchSize", lastBatchConfig.deleteBatchSize()), SafeArg.of("maxCellTsPairsToExamine", lastBatchConfig.maxCellTsPairsToExamine()), e); batchSizeMultiplier = Math.max(batchSizeMultiplier / 2, 1.5 / lastBatchConfig.candidateBatchSize()); } } if (sweptSuccessfully) { batchSizeMultiplier = Math.min(1.0, batchSizeMultiplier * 1.01); return sweepPauseMillis.get(); } else { return getBackoffTimeWhenSweepHasNotRun(); } }

Target:
private long grabLocksAndRun(SweepLocks locks) throws InterruptedException { boolean sweptSuccessfully = false; try { locks.lockOrRefresh(); if (locks.haveLocks()) { sweptSuccessfully = runOnce(); } else { log.debug("Skipping sweep because sweep is running elsewhere."); } } catch (InsufficientConsistencyException e) { log.warn("Could not sweep because not all nodes of the database are online.", e); } catch (RuntimeException e) { specificTableSweeper.getSweepMetrics().sweepError(); if (checkAndRepairTableDrop()) { log.info("The table being swept by the background sweeper was dropped, moving on..."); } else { SweepBatchConfig lastBatchConfig = getAdjustedBatchConfig(); log.warn("The background sweep job failed unexpectedly with batch config {}." + " Attempting to continue with a lower batch size...", SafeArg.of("sweepBatchConfig", lastBatchConfig.toString()), e); batchSizeMultiplier = Math.max(batchSizeMultiplier / 2, 1.5 / lastBatchConfig.candidateBatchSize()); } } if (sweptSuccessfully) { batchSizeMultiplier = Math.min(1.0, batchSizeMultiplier * 1.01); return sweepPauseMillis.get(); } else { return getBackoffTimeWhenSweepHasNotRun(); } }
Source:
private void checkAssignmentExpression(SubscriptionContext ctx) { AssignmentExpression assignmentExpression = (AssignmentExpression) ctx.syntaxNode(); if (shouldReportIssue(assignmentExpression.lhsName(), assignmentExpression.lhsName())) { ctx.addIssue(assignmentExpression.lhsName(), String.format(MESSAGE, VRBL_ISSUE_TYPE)); } }

Target:
private void checkAssignmentExpression(SubscriptionContext ctx) { AssignmentExpression assignmentExpression = (AssignmentExpression) ctx.syntaxNode(); Name lhsName = assignmentExpression.lhsName(); if (shouldReportIssue(lhsName)) { ctx.addIssue(lhsName, String.format(MESSAGE, VRBL_ISSUE_TYPE)); } }
Source:
private static boolean findColumnName(String tableName, String columnName, Connection connection) throws SQLException { Statement statement = connection.createStatement(); ResultSet results = statement.executeQuery("SELECT * FROM " + tableName + " LIMIT 0"); ResultSetMetaData metadata = results.getMetaData(); int columnCount = metadata.getColumnCount(); for (int i = 1; i <= columnCount; i++) { if (columnName.equalsIgnoreCase(metadata.getColumnName(i))) { return true; } } return false; }

Target:
private static boolean findColumnName(String tableName, String columnName, Connection connection) throws SQLException { Statement statement = connection.createStatement(); ResultSet results = statement.executeQuery("SELECT * FROM " + tableName + " LIMIT 0"); ResultSetMetaData metadata = results.getMetaData(); int columnCount = metadata.getColumnCount(); for (int i = 0; i < columnCount; i++) { if (columnName.equalsIgnoreCase(metadata.getColumnName(i + 1))) { return true; } } return false; }
Source:
private DefaultInputFile inputFile(String relativePath) { DefaultInputFile inputFile = new DefaultInputFile("moduleKey", relativePath) .setModuleBaseDir(baseDir.toPath()) .setType(Type.MAIN) .setLanguage(JavaScriptLanguage.KEY); context.fileSystem().add(inputFile); return inputFile.initMetadata(new FileMetadata().readMetadata(inputFile.file(), Charset.defaultCharset())); }

Target:
private DefaultInputFile inputFile(String relativePath) { DefaultInputFile inputFile = new DefaultInputFile("moduleKey", relativePath) .setModuleBaseDir(baseDir.toPath()) .setType(Type.MAIN) .setLanguage(JavaScriptLanguage.KEY); context.fileSystem().add(inputFile); return inputFile.initMetadata(new FileMetadata().readMetadata(inputFile.file(), Charsets.UTF_8)); }
Source:
public VisualEditorReviewChangesDialog clickReviewYourChanges() { waitForElementVisibleByElement(reviewChangesButton); waitForElementClickableByElement(reviewChangesButton); reviewChangesButton.click(); PageObjectLogging.log("clickReviewYourChanges", "Review Your Changes Button is clicked", true); return new VisualEditorReviewChangesDialog(driver); }

Target:
public VisualEditorReviewChangesDialog clickReviewYourChanges() { waitForElementVisibleByElement(reviewChangesButton); waitForElementClickableByElement(reviewChangesButton); reviewChangesButton.click(); return new VisualEditorReviewChangesDialog(driver); }
Source:
public List<EmailWrapper> generateFeedbackSessionReminderEmails( FeedbackSessionAttributes session, List<StudentAttributes> students, List<InstructorAttributes> instructorsToRemind, List<InstructorAttributes> instructorsToNotify) { CourseAttributes course = coursesLogic.getCourse(session.getCourseId()); String template = EmailTemplates.USER_FEEDBACK_SESSION; List<EmailWrapper> emails = generateFeedbackSessionEmailBasesForInstructorReminders(course, session, instructorsToRemind, template, EmailType.FEEDBACK_SESSION_REMINDER.getSubject()); emails.addAll(generateFeedbackSessionEmailBases(course, session, students, instructorsToNotify, template, EmailType.FEEDBACK_SESSION_REMINDER.getSubject())); for (EmailWrapper email : emails) { email.setContent(email.getContent().replace("${status}", "is still open for submissions")); } return emails; }

Target:
public List<EmailWrapper> generateFeedbackSessionReminderEmails( FeedbackSessionAttributes session, List<StudentAttributes> students, List<InstructorAttributes> instructorsToRemind, List<InstructorAttributes> instructorsToNotify) { CourseAttributes course = coursesLogic.getCourse(session.getCourseId()); String template = EmailTemplates.USER_FEEDBACK_SESSION.replace("${status}", FEEDBACK_STATUS_SESSION_OPEN); List<EmailWrapper> emails = generateFeedbackSessionEmailBasesForInstructorReminders(course, session, instructorsToRemind, template, EmailType.FEEDBACK_SESSION_REMINDER.getSubject()); emails.addAll(generateFeedbackSessionEmailBases(course, session, students, instructorsToNotify, template, EmailType.FEEDBACK_SESSION_REMINDER.getSubject())); return emails; }
Source:
public void serialize(ServiceItemLease lease, JsonGenerator writer, SerializerProvider serializerProvider) { try { writer.writeStartObject(); writer.writeStringField(Constants.Properties.ID, lease.getId()); writer.writeStringField(Constants.Properties.E_TAG, lease.getETag()); writer.writeStringField("LeaseToken", lease.getLeaseToken()); writer.writeStringField("ContinuationToken", lease.getContinuationToken()); writer.writeStringField("timestamp", lease.getTimestamp()); writer.writeStringField("Owner", lease.getOwner()); writer.writeEndObject(); } catch (IOException e) { throw new IllegalStateException(e); } }

Target:
public void serialize(ServiceItemLease lease, JsonGenerator writer, SerializerProvider serializerProvider) { try { writer.writeStartObject(); writer.writeStringField(Constants.Properties.ID, lease.getId()); writer.writeStringField(Constants.Properties.E_TAG, lease.getETag()); writer.writeStringField(PROPERTY_NAME_LEASE_TOKEN, lease.getLeaseToken()); writer.writeStringField(PROPERTY_NAME_CONTINUATION_TOKEN, lease.getContinuationToken()); writer.writeStringField(PROPERTY_NAME_TIMESTAMP, lease.getTimestamp()); writer.writeStringField(PROPERTY_NAME_OWNER, lease.getOwner()); writer.writeEndObject(); } catch (IOException e) { throw new IllegalStateException(e); } }
Source:
protected String getVersion(KieServerMode mode) { return mode.equals(KieServerMode.DEVELOPMENT) ? DEVELOPMENT_MODE_VERSION : REGULAR_MODE_VERSION; }

Target:
protected String getVersion(KieServerMode mode) { return mode.equals(KieServerMode.DEVELOPMENT) ? DEVELOPMENT_MODE_VERSION : PRODUCTION_MODE_VERSION; }
Source:
protected boolean togglePauseMenu(boolean pauseScreenOpened, Input input) { if ((currentGame.isPaused() && pauseScreenOpened) || !(currentGame.isPaused() || pauseScreenOpened)) { Game.LOGGER.log(LogSeverity.DEBUG, "Game", "Player " + (currentGame.isPaused() ? "resumed" : "paused") + " the game"); input.disableKeyRepeat(); currentGame.setPaused(!currentGame.isPaused()); pauseScreenOpened = !pauseScreenOpened; } return pauseScreenOpened; }

Target:
protected boolean togglePauseMenu(boolean pauseScreenOpened, Input input) { if (currentGame.isPaused() && pauseScreenOpened || !(currentGame.isPaused() || pauseScreenOpened)) { Game.LOGGER.log(LogSeverity.DEBUG, "Game", "Player " + (currentGame.isPaused() ? "resumed" : "paused") + " the game"); input.disableKeyRepeat(); currentGame.setPaused(!currentGame.isPaused()); pauseScreenOpened = !pauseScreenOpened; } return pauseScreenOpened; }
Source:
private void updateHigherWaterMark(long msgId) { if (msgId < higerWaterMark.get()) { return; } while(true) { long old = higerWaterMark.get(); if (higerWaterMark.compareAndSet(old, msgId)) { break; } } }

Target:
private void updateHigherWaterMark(long msgId) { while(true) { long old = higherWaterMark.get(); if (msgId < old) { return; } if (higherWaterMark.compareAndSet(old, msgId)) { break; } } }
Source:
protected void initialize(String fileName) { if (fileSystemPersistenceProvider == null) { fileSystemPersistenceProvider = new FileSystemPersistenceProvider(getClass().getSimpleName()); } if (jsonSerializer == null) { jsonSerializer = new JsonPersistantStore(getClass().getSimpleName()); } if (observer == null && fileName != null) { observer = AsyncFileAlterationObserver.load(new File(fileName), jsonSerializer); if (observer == null && isOldVersion(fileName)) { observer = backwardsCompatibility(fileName); } else { observer = new AsyncFileAlterationObserver(new File(fileName), jsonSerializer); } } }

Target:
protected void initialize(String fileName) { if (fileSystemPersistenceProvider == null) { fileSystemPersistenceProvider = new FileSystemPersistenceProvider(getClass().getSimpleName()); } if (jsonSerializer == null) { jsonSerializer = new JsonPersistantStore(getClass().getSimpleName()); } if (observer == null && fileName != null) { observer = AsyncFileAlterationObserver.load(new File(fileName), jsonSerializer); if (observer == null && isOldVersion(fileName)) { observer = backwardsCompatibility(fileName); } else if (observer == null) { observer = new AsyncFileAlterationObserver(new File(fileName), jsonSerializer); } } }
Source:
private Configuration getConfigurationWithContext(String pidWithContext) throws IOException, InvalidSyntaxException { if (!pidWithContext.contains(ConfigConstants.SERVICE_CONTEXT_MARKER)) { throw new IllegalArgumentException("Given PID should be followed by a context"); } String pid = pidWithContext.split(ConfigConstants.SERVICE_CONTEXT_MARKER)[0]; String context = pidWithContext.split(ConfigConstants.SERVICE_CONTEXT_MARKER)[1]; Configuration[] configs = configAdmin.listConfigurations( "(&(service.factoryPid=" + pid + ")(" + ConfigConstants.SERVICE_CONTEXT + "=" + context + "))"); if (configs == null || configs.length == 0) { return null; } Configuration configuration = configs[0]; if (configs.length > 1) { logger.error("More than one configuration with PID '{}' exists, using entry '{}'.", pidWithContext, configuration.getProperties().get(Constants.SERVICE_PID)); } return configuration; }

Target:
private Configuration getConfigurationWithContext(String pidWithContext) throws IOException, InvalidSyntaxException { if (!pidWithContext.contains(ConfigConstants.SERVICE_CONTEXT_MARKER)) { throw new IllegalArgumentException("Given PID should be followed by a context"); } String pid = pidWithContext.split(ConfigConstants.SERVICE_CONTEXT_MARKER)[0]; String context = pidWithContext.split(ConfigConstants.SERVICE_CONTEXT_MARKER)[1]; Configuration[] configs = configAdmin.listConfigurations("(&(" + ConfigurationAdmin.SERVICE_FACTORYPID + "=" + pid + ")(" + ConfigConstants.SERVICE_CONTEXT + "=" + context + "))"); if (configs == null || configs.length == 0) { return null; } Configuration configuration = configs[0]; if (configs.length > 1) { logger.error("More than one configuration with PID '{}' exists, using entry '{}'.", pidWithContext, configuration.getProperties().get(Constants.SERVICE_PID)); } return configuration; }
Source:
public void testStoreAndQueryCorrelationsInclude() { Trace trace1 = new Trace(); trace1.setId("1"); trace1.setStartTime(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis()) - 4000); CorrelationIdentifier cid = new CorrelationIdentifier(); cid.setScope(Scope.ControlFlow); cid.setValue("myid"); Consumer c1 = new Consumer(); c1.getCorrelationIds().add(cid); trace1.getNodes().add(c1); List<Trace> traces = new ArrayList<Trace>(); traces.add(trace1); try { tracePublisher.publish(null, traces); } catch (Exception e1) { fail("Failed to store: " + e1); } Criteria criteria = new Criteria(); criteria.getCorrelationIds().add(new CorrelationIdentifier(Scope.ControlFlow, "myid")); Wait.until(() -> traceService.searchFragments(null, criteria).size() == 1); List<Trace> result = traceService.searchFragments(null, criteria); assertEquals(1, result.size()); assertEquals("1", result.get(0).getId()); }

Target:
public void testStoreAndQueryCorrelationsInclude() { Trace trace1 = new Trace(); trace1.setId("1"); trace1.setStartTime(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis()) - FOUR_MS_IN_MICRO_SEC); CorrelationIdentifier cid = new CorrelationIdentifier(); cid.setScope(Scope.ControlFlow); cid.setValue("myid"); Consumer c1 = new Consumer(); c1.getCorrelationIds().add(cid); trace1.getNodes().add(c1); List<Trace> traces = new ArrayList<Trace>(); traces.add(trace1); try { tracePublisher.publish(null, traces); } catch (Exception e1) { fail("Failed to store: " + e1); } Criteria criteria = new Criteria(); criteria.getCorrelationIds().add(new CorrelationIdentifier(Scope.ControlFlow, "myid")); Wait.until(() -> traceService.searchFragments(null, criteria).size() == 1); List<Trace> result = traceService.searchFragments(null, criteria); assertEquals(1, result.size()); assertEquals("1", result.get(0).getId()); }
Source:
public void startApp() { try { platformRequest("x-contacts:add?number=+393333333333"); } catch (ConnectionNotFoundException e) { System.out.println("Error while adding contact"); } }

Target:
public void startApp() { try { platformRequest("x-contacts:add?number=+393333333333"); System.out.println("Success"); } catch (ConnectionNotFoundException e) { System.out.println("Error while adding contact"); } }
Source:
@Override protected Void doInBackground(Integer... params) { if (params.length != 2) throw new IllegalArgumentException("MKCollectorResubmitTask require 2 nullable params: result_id, measurement_id"); List<Measurement> measurements = MeasurementDao.queryList(params[0], params[1], false, false); for (int i = 0; i < measurements.size() && getActivity() != null; i++) { publishProgress(getActivity().getString(R.string.Modal_ResultsNotUploaded_Uploading, getActivity().getString(R.string.paramOfParam, Integer.toString(i + 1), Integer.toString(measurements.size())))); Measurement m = measurements.get(i); m.result.load(); try { perform(getActivity(), m); } catch (IOException e) { e.printStackTrace(); } } return null; }

Target:
@Override protected Void doInBackground(Integer... params) { if (params.length != 2) throw new IllegalArgumentException("MKCollectorResubmitTask requires 2 nullable params: result_id, measurement_id"); Where<Measurement> msmQuery = SQLite.select().from(Measurement.class) .where(Measurement_Table.is_failed.eq(false)) .and(OperatorGroup.clause() .or(Measurement_Table.is_uploaded.eq(false)) .or(Measurement_Table.report_id.isNull())); if (params[0] != null) { msmQuery.and(Measurement_Table.result_id.eq(params[0])); } if (params[1] != null) { msmQuery.and(Measurement_Table.id.eq(params[1])); } List<Measurement> measurements = msmQuery.queryList(); for (int i = 0; i < measurements.size(); i++) { A activity = getActivity(); if (activity == null) break; String paramOfParam = activity.getString(R.string.paramOfParam, Integer.toString(i + 1), Integer.toString(measurements.size())); publishProgress(activity.getString(R.string.Modal_ResultsNotUploaded_Uploading, paramOfParam)); Measurement m = measurements.get(i); m.result.load(); try { perform(activity, m); } catch (IOException e) { e.printStackTrace(); } } return null; }
Source:
public String getXRegistryAuthHeaderValue(@Nullable String registry, @Nullable AuthConfigs paramAuthConfigs) { if (DEFAULT_REGISTRY_SYNONYMS.contains(registry)) { registry = DEFAULT_REGISTRY; } AuthConfig authConfig = null; if (paramAuthConfigs != null && paramAuthConfigs.getConfigs() != null) { normalizeDockerHubRegistryUrl(paramAuthConfigs.getConfigs()); authConfig = paramAuthConfigs.getConfigs().get(registry); } if (authConfig == null) { normalizeDockerHubRegistryUrl(initialAuthConfig.getAuthConfigs().getConfigs()); authConfig = initialAuthConfig.getAuthConfigs().getConfigs().get(registry); } String authConfigJson; if (authConfig == null) { authConfigJson = "{}"; } else { authConfigJson = JsonHelper.toJson(authConfig); } return Base64.getEncoder().encodeToString(authConfigJson.getBytes()); }

Target:
public String getXRegistryAuthHeaderValue(@Nullable String registry, @Nullable AuthConfigs paramAuthConfigs) { String normalizedRegistry = DEFAULT_REGISTRY_SYNONYMS.contains(registry) ? DEFAULT_REGISTRY : registry; AuthConfig authConfig = null; if (paramAuthConfigs != null && paramAuthConfigs.getConfigs() != null) { authConfig = normalizeDockerHubRegistryUrl(paramAuthConfigs.getConfigs()).get(normalizedRegistry); } if (authConfig == null) { authConfig = normalizeDockerHubRegistryUrl(initialAuthConfig.getAuthConfigs().getConfigs()).get(normalizedRegistry); } String authConfigJson; if (authConfig == null) { authConfigJson = "{}"; } else { authConfigJson = JsonHelper.toJson(authConfig); } return Base64.getEncoder().encodeToString(authConfigJson.getBytes()); }
Source:
public ProjectQualityGate getQualityGateMeasures() throws Exception { String url = serverUrl + API_MEASURES + "?componentKey=" + projectKey + "&metricKeys=alert_status"; String text = client.getHttp(url, username, password); JSONObject json = (JSONObject) JSONSerializer.toJSON(text); if (json.containsKey("errors")) { throw new MessageException(parseError(json)); } JSONObject component = json.getJSONObject("component"); String projectName = component.getString("name"); JSONArray measuresArray = component.getJSONArray("measures"); for (Object o : measuresArray) { JSONObject jsonObj = (JSONObject) o; String metric = jsonObj.getString("metric"); if ("alert_status".equals(metric)) { return new ProjectQualityGate(projectName, jsonObj.getString("value")); } } return null; }

Target:
public ProjectQualityGate getQualityGateMeasures() throws Exception { String url = serverUrl + API_MEASURES + encode(projectKey); String text = client.getHttp(url, username, password); JSONObject json = (JSONObject) JSONSerializer.toJSON(text); if (json.containsKey("errors")) { throw new MessageException(parseError(json)); } JSONObject component = json.getJSONObject("component"); String projectName = component.getString("name"); JSONArray measuresArray = component.getJSONArray("measures"); for (Object o : measuresArray) { JSONObject jsonObj = (JSONObject) o; String metric = jsonObj.getString("metric"); if ("alert_status".equals(metric)) { return new ProjectQualityGate(projectName, jsonObj.getString("value")); } } return null; }
Source:
public Node visitSpecialDateTimeFunction(SqlBaseParser.SpecialDateTimeFunctionContext context) { CurrentTime.Operation operation = getDateTimeFunctionType(context.name); if (context.precision != null) { return new CurrentTime(getLocation(context), operation, Integer.parseInt(context.precision.getText())); } return new CurrentTime(getLocation(context), operation); }

Target:
public Node visitSpecialDateTimeFunction(SqlBaseParser.SpecialDateTimeFunctionContext context) { CurrentTime.Function function = getDateTimeFunctionType(context.name); if (context.precision != null) { return new CurrentTime(getLocation(context), function, Integer.parseInt(context.precision.getText())); } return new CurrentTime(getLocation(context), function); }
Source:
public Condition getCondition(String uuid) { List<String> errors = new ArrayList<>(); org.openmrs.Condition condition = Context.getService(ConditionService.class).getConditionByUuid(uuid); if (condition == null) { errors.add("Condition with given uuid doesn't exits"); return null; } FHIRUtils.checkGeneratorErrorList(errors); return this.generateFHIRCondition(condition); }

Target:
public Condition getCondition(String uuid) { org.openmrs.Condition condition = Context.getService(ConditionService.class).getConditionByUuid(uuid); if (condition == null) { return null; } return this.generateFHIRCondition(condition); }
Source:
protected void onResume() { super.onResume(); try { if (CommCareApplication._().getSession().isActive() && CommCareApplication._().getSession().getLoggedInUser() != null) { Intent i = new Intent(); i.putExtra(ALREADY_LOGGED_IN, true); setResult(RESULT_OK, i); CommCareApplication._().clearNotifications(NOTIFICATION_MESSAGE_LOGIN); finish(); return; } } catch (SessionUnavailableException sue) { } if (CommCareApplication._().getReadyAppRecords().size() == 0) { Intent i = new Intent(this, CommCareHomeActivity.class); startActivity(i); } refreshView(); }

Target:
protected void onResume() { super.onResume(); try { if (CommCareApplication._().getSession().isActive() && CommCareApplication._().getSession().getLoggedInUser() != null) { Intent i = new Intent(); i.putExtra(ALREADY_LOGGED_IN, true); setResult(RESULT_OK, i); CommCareApplication._().clearNotifications(NOTIFICATION_MESSAGE_LOGIN); finish(); return; } } catch (SessionUnavailableException sue) { } CommCareApp currentApp = CommCareApplication._().getCurrentApp(); if (currentApp == null || !currentApp.getAppRecord().isUsable()) { Intent i = new Intent(this, CommCareHomeActivity.class); startActivity(i); return; } refreshView(); }
Source:
private synchronized FileSessionCredentialsProvider getUnderlyingProvider() { if (provider == null) { provider = new FileSessionCredentialsProvider(config.getFileSessionCredentials()); } return provider; }

Target:
private FileSessionCredentialsProvider getUnderlyingProvider() { FileSessionCredentialsProvider syncedProvider = provider; if (syncedProvider == null) { synchronized (config) { syncedProvider = provider; if (syncedProvider == null) { syncedProvider = new FileSessionCredentialsProvider(config.getFileSessionCredentials()); provider = syncedProvider; } } } return syncedProvider; }
Source:
public Task getMySchritt() { try { loadStepByParameter(); } catch (DAOException | NumberFormatException e) { Helper.setErrorMessage(e.getLocalizedMessage(), logger, e); } return this.mySchritt; }

Target:
public Task getMySchritt() { try { loadTaskByParameter(); } catch (DAOException | NumberFormatException e) { Helper.setErrorMessage(e.getLocalizedMessage(), logger, e); } return this.mySchritt; }
Source:
protected ContainerDelegate initializeProxy(Object delegate) { if (this.getAdviceChain().length == 0) { return null; } ProxyFactory factory = new ProxyFactory(); for (Advice advice : getAdviceChain()) { factory.addAdvisor(new DefaultPointcutAdvisor(Pointcut.TRUE, advice)); } factory.setProxyTargetClass(false); factory.addInterface(ContainerDelegate.class); factory.setTarget(delegate); return (ContainerDelegate) factory.getProxy(ContainerDelegate.class.getClassLoader()); }

Target:
protected void initializeProxy(Object delegate) { if (this.getAdviceChain().length == 0) { return; } ProxyFactory factory = new ProxyFactory(); for (Advice advice : getAdviceChain()) { factory.addAdvisor(new DefaultPointcutAdvisor(advice)); } factory.addInterface(ContainerDelegate.class); factory.setTarget(delegate); this.proxy = (ContainerDelegate) factory.getProxy(ContainerDelegate.class.getClassLoader()); }
Source:
public Map<String, Set<ExecutableElement>> setters() { return Maps.transformValues(setters.asMap(), Sets::newHashSet); }

Target:
public Map<String, Set<ExecutableElement>> setters() { return setters; }
Source:
private static void addPropertyVariableToResult(Collection<Pair<Object, String>> result, String element) { if (element.length() > 0) { List<String> list = Arrays.asList(element.split(",")); list.forEach(s1 -> { String value = s1.split(":")[0]; result.add(new Pair<>(value, value)); }); } }

Target:
private void addPropertyVariableToResult(Collection<Pair<Object, String>> result, String element) { if (element.length() > 0) { List<String> list = Arrays.asList(element.split(",")); list.forEach(s1 -> { String value = s1.split(":")[0]; result.add(new Pair<>(value, value)); }); } }
Source:
public void loadCentersInOffice(int id, Map<String, Object> params) { checkViewAttached(); getMvpView().showProgressbar(true); mSubscription.add(mDataManager.getCentersInOffice(id, params) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<List<Center>>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); try { if (e instanceof HttpException) { String errorMessage = ((HttpException) e).response().errorBody() .string(); getMvpView().showError(MFErrorParser.parseError(errorMessage) .getErrors().get(0).getDefaultUserMessage()); } } catch (Throwable throwable) { RxJavaPlugins.getInstance().getErrorHandler().handleError(e); } } @Override public void onNext(List<Center> centers) { getMvpView().showProgressbar(false); getMvpView().showCentersInOffice(centers); } })); }

Target:
public void loadCentersInOffice(int id, Map<String, Object> params) { checkViewAttached(); getMvpView().showProgressbar(true); mSubscription.add(mDataManager.getCentersInOffice(id, params) .observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()) .subscribe(new Subscriber<List<Center>>() { @Override public void onCompleted() { } @Override public void onError(Throwable e) { getMvpView().showProgressbar(false); getMvpView().showError(MFErrorParser.errorMessage(e)); } @Override public void onNext(List<Center> centers) { getMvpView().showProgressbar(false); getMvpView().showCentersInOffice(centers); } })); }
Source:
public void deleteWireConfiguration(final WireConfiguration wireConfiguration) { requireNonNull(wireConfiguration, message.wireConfigurationNonNull()); logger.info(message.removingWires()); try { final Wire[] wiresList = this.wireAdmin.getWires(null); if (wiresList != null) { for (final Wire wire : wiresList) { final Dictionary<?, ?> props = wire.getProperties(); final String producerPid = props.get(WIREADMIN_PRODUCER_PID).toString(); final String consumerPid = props.get(WIREADMIN_CONSUMER_PID).toString(); final String emitterFactoryPid = this.wireHelperService .getServicePid(wireConfiguration.getEmitterPid()); final String receiverFactoryPid = this.wireHelperService .getServicePid(wireConfiguration.getReceiverPid()); if (emitterFactoryPid != null && receiverFactoryPid != null && producerPid.equals(emitterFactoryPid) && consumerPid.equals(receiverFactoryPid)) { synchronized (this.wireConfigs) { for (final Iterator<WireConfiguration> iter = this.wireConfigs.iterator(); iter .hasNext();) { final WireConfiguration configuration = iter.next(); if (configuration.equals(wireConfiguration)) { iter.remove(); this.wireAdmin.deleteWire(wire); break; } } } } } } } catch (final InvalidSyntaxException e) { final StringWriter sw = new StringWriter(); final PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); throw new KuraRuntimeException(KuraErrorCode.INTERNAL_ERROR, sw.toString()); } logger.info(message.removingWiresDone()); }

Target:
public void deleteWireConfiguration(final WireConfiguration wireConfiguration) { requireNonNull(wireConfiguration, message.wireConfigurationNonNull()); logger.info(message.removingWires()); try { final Wire[] wiresList = this.wireAdmin.getWires(wireConfiguration.getFilter()); if (wiresList != null) { for (final Wire wire : wiresList) { final Dictionary<?, ?> props = wire.getProperties(); final String producerPid = props.get(WIREADMIN_PRODUCER_PID).toString(); final String consumerPid = props.get(WIREADMIN_CONSUMER_PID).toString(); final String emitterFactoryPid = this.wireHelperService .getServicePid(wireConfiguration.getEmitterPid()); final String receiverFactoryPid = this.wireHelperService .getServicePid(wireConfiguration.getReceiverPid()); if (emitterFactoryPid != null && receiverFactoryPid != null && producerPid.equals(emitterFactoryPid) && consumerPid.equals(receiverFactoryPid)) { synchronized (this.wireConfigs) { for (final Iterator<WireConfiguration> iter = this.wireConfigs.iterator(); iter .hasNext();) { final WireConfiguration configuration = iter.next(); if (configuration.equals(wireConfiguration)) { iter.remove(); this.wireAdmin.deleteWire(wire); break; } } } } } } } catch (final InvalidSyntaxException e) { throw new IllegalArgumentException(e); } logger.info(message.removingWiresDone()); }
Source:
protected CollectionRest createAndReturn(Context context) throws AuthorizeException { throw new DSpaceBadRequestException("Missing parent parameter."); }

Target:
protected CollectionRest createAndReturn(Context context) throws AuthorizeException { throw new DSpaceBadRequestException("Cannot create a Collection without providing a parent Community."); }
Source:
public void shouldGetDivOfLogicalStructMapFromExistingFile() throws DatatypeConfigurationException, IOException, JAXBException, TransformerException { MetsKitodoWrapper metsKitodoWrapper = new MetsKitodoWrapper(xmlfile, xsltFile); DivType rootDiv = metsKitodoWrapper.getLogicalStructMap().getDiv(); DivType rootDivFromMets = metsKitodoWrapper.getMets().getStructMap().get(1).getDiv(); MetsKitodoWriter writer = new MetsKitodoWriter(); System.out.println(writer.writeSerializedToString(metsKitodoWrapper.getMets())); Assert.assertEquals("Div elements from getter and directly from mets objects were not the same", rootDiv, rootDivFromMets); }

Target:
public void shouldGetDivOfLogicalStructMapFromExistingFile() throws DatatypeConfigurationException, IOException, JAXBException, TransformerException { MetsKitodoWrapper metsKitodoWrapper = new MetsKitodoWrapper(xmlfile, xsltFile); DivType rootDiv = metsKitodoWrapper.getLogicalStructMap().getDiv(); DivType rootDivFromMets = metsKitodoWrapper.getMets().getStructMap().get(1).getDiv(); Assert.assertEquals("Div elements from getter and directly from mets objects were not the same", rootDiv, rootDivFromMets); }
Source:
public void onTrainingStart(SyncTrainingEvent event) { try { dataManager.writeInfo(event.getLearning()); } catch (Exception e) { log.error("Training failed.", e); e.printStackTrace(); event.setCanContinue(false); } }

Target:
public ListenerResponse onTrainingStart(SyncTrainingEvent event) { try { dataManager.writeInfo(event.getLearning()); } catch (Exception e) { log.error("Training failed.", e); return ListenerResponse.STOP; } return ListenerResponse.CONTINUE; }
Source:
protected <T extends LoginAPI> T getLoginAPI(Class<T> apiClass) { try { final ServerAPI serverAPI = getServerAPI(); final ClientInterceptor interceptor = new ClientInterceptor(LoginAPI.class.getName(), serverAPI); T result = (T) Proxy.newProxyInstance(APIAccessor.class.getClassLoader(), new Class[]{apiClass}, interceptor); return result; } catch (BonitaHomeNotSetException | ServerAPIException | UnknownAPITypeException e) { throw new IllegalStateException(e.getMessage(), e); } }

Target:
protected <T extends LoginAPI> T getLoginAPI(Class<T> apiClass) { try { final ClientInterceptor interceptor = new ClientInterceptor(apiClass.getName(), getServerAPI()); @SuppressWarnings("unchecked") final T api = (T) Proxy.newProxyInstance(APIAccessor.class.getClassLoader(), new Class[] { apiClass }, interceptor); return api; } catch (BonitaHomeNotSetException | ServerAPIException | UnknownAPITypeException e) { throw new IllegalStateException(e.getMessage(), e); } }
Source:
public void initialize() { logger.debug("Initializing thing {}", getThing().getUID()); String thingUid = getThing().getUID().toString(); thingConfig = getConfigAs(AstroThingConfig.class); thingConfig.setThingUid(thingUid); boolean validConfig = true; logger.debug("Initializing Scheduler for thing {}", getThing().getUID()); if (StringUtils.trimToNull(thingConfig.getGeolocation()) == null) { logger.error("Astro parameter geolocation is mandatory and must be configured, disabling thing '{}'", thingUid); validConfig = false; } else { thingConfig.parseGeoLocation(); } if (thingConfig.getLatitude() == null || thingConfig.getLongitude() == null) { logger.error( "Astro parameters geolocation could not be split into latitude and longitude, disabling thing '{}'", thingUid); validConfig = false; } if (thingConfig.getInterval() == null || thingConfig.getInterval() < 1 || thingConfig.getInterval() > 86400) { logger.error("Astro parameter interval must be in the range of 1-86400, disabling thing '{}'", thingUid); validConfig = false; } if (validConfig) { logger.debug("{}", thingConfig); updateStatus(ONLINE); restartJobs(); } else { updateStatus(OFFLINE); } logger.debug("Thing initialized {}", getThing().getUID(), getThing().getStatus()); }

Target:
public void initialize() { logger.debug("Initializing thing {}", getThing().getUID()); String thingUid = getThing().getUID().toString(); thingConfig = getConfigAs(AstroThingConfig.class); thingConfig.setThingUid(thingUid); boolean validConfig = true; if (StringUtils.trimToNull(thingConfig.getGeolocation()) == null) { logger.error("Astro parameter geolocation is mandatory and must be configured, disabling thing '{}'", thingUid); validConfig = false; } else { thingConfig.parseGeoLocation(); } if (thingConfig.getLatitude() == null || thingConfig.getLongitude() == null) { logger.error( "Astro parameters geolocation could not be split into latitude and longitude, disabling thing '{}'", thingUid); validConfig = false; } if (thingConfig.getInterval() == null || thingConfig.getInterval() < 1 || thingConfig.getInterval() > 86400) { logger.error("Astro parameter interval must be in the range of 1-86400, disabling thing '{}'", thingUid); validConfig = false; } if (validConfig) { logger.debug("{}", thingConfig); updateStatus(ONLINE); restartJobs(); } else { updateStatus(OFFLINE); } logger.debug("Thing initialized {}", getThing().getUID(), getThing().getStatus()); }
Source:
public void testTimestamp() { final Intent intent = new Intent(); intent.putExtra("mp_message", "MESSAGE"); intent.putExtra("mp_time", "2014-10-02T15:01:23.045123456Z"); Notification notification = mpPushSpy.createNotification(intent); Instant instant = Instant.parse( "2011-05-03T11:58:01Z" ); verify(builderSpy).setWhen(instant.toEpochMilli()); }

Target:
public void testTimestamp() { final Intent intent = new Intent(); intent.putExtra("mp_message", "MESSAGE"); intent.putExtra("mp_time", "2014-10-02T15:01:23.045123456Z"); Notification notification = mpPushSpy.createNotification(intent); Instant instant = Instant.parse( "2014-10-02T15:01:23.045123456Z" ); verify(builderSpy).setShowWhen(true); verify(builderSpy).setWhen(instant.toEpochMilli()); }
Source:
protected final String retrievePasswordUsingProxyTicket(final String proxyTicket) { try { final String url = this.clearPassUrl + (this.clearPassUrl.contains("?") ? "&" : "?") + "ticket=" + proxyTicket; final String response = retrieveResponseFromServer(url, "UTF-8"); final String password = XmlUtils.getTextForElement(response, "credentials"); if (log.isTraceEnabled()) { log.trace(String.format("ClearPass Response was:\n %s", response)); } if (CommonUtils.isNotBlank(password)) { return password; } log.error("Unable to Retrieve Password. If you see a [403] HTTP response code returned from" +" CommonUtils then it most likely means the proxy configuration on the CAS server is not" + " correct.\n\nFull Response from ClearPass was [" + response + "]."); return null; } catch (Exception e) { if (log.isWarnEnabled()) { log.warn("Unable to retrieve the credential from the ClearPass " + "service for proxy ticket: " + proxyTicket, e); } return null; } }

Target:
protected final String retrievePasswordUsingProxyTicket(final String proxyTicket) { try { final String url = this.clearPassUrl + (this.clearPassUrl.contains("?") ? "&" : "?") + "ticket=" + proxyTicket; final String response = retrieveResponseFromServer(url, "UTF-8"); final String password = XmlUtils.getTextForElement(response, "credentials"); if (CommonUtils.isNotBlank(password)) { return password; } log.error("Unable to Retrieve Password using url {}. If you see a [403] HTTP response code returned from" +" CommonUtils then it most likely means the proxy configuration on the CAS server is not" + " correct.\n\nFull Response from ClearPass was [{}]", url, response); return null; } catch (Exception e) { if (log.isWarnEnabled()) { log.warn("Unable to retrieve the credential from the ClearPass " + "service for proxy ticket {}", proxyTicket, e); } return null; } }
Source:
protected static void validatePageIfNotNull(String pageNumber, List<String> validationErrors) { if (isNotBlank(pageNumber) && (!StringUtils.isNumeric(pageNumber) || Integer.valueOf(pageNumber) < 1)) { validationErrors.add("page"); } }

Target:
protected static void validatePageIfNotNull(String pageNumber, List<String> validationErrors) { if (isNotBlank(pageNumber) && (!NumericValidator.isValid(pageNumber) || Integer.valueOf(pageNumber) < 1)) { validationErrors.add("page"); } }
Source:
public void dragCentered(final String label, final Class<? extends EditPart> editPartClass, final int toXPosition, final int toYPosition) { final SWTBotGefEditPart selectedEP = getEditPart(label, editPartClass); if (selectedEP == null) { throw new WidgetNotFoundException(String.format(SWTBotSiriusDiagramEditor.EXPECTED_TO_FIND_WIDGET_S, label)); } final Rectangle bounds = ((GraphicalEditPart) selectedEP.part()).getFigure().getBounds(); drag(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2, toXPosition, toYPosition); }

Target:
public void dragCentered(final String label, final Class<? extends EditPart> editPartClass, final int toXPosition, final int toYPosition) { final SWTBotGefEditPart selectedEP; if(editPartClass != null) { selectedEP = getEditPart(label, editPartClass); } else { selectedEP = getEditPart(label); } if (selectedEP == null) { throw new WidgetNotFoundException(String.format(SWTBotSiriusDiagramEditor.EXPECTED_TO_FIND_WIDGET_S, label)); } final Rectangle bounds = ((GraphicalEditPart) selectedEP.part()).getFigure().getBounds(); drag(bounds.x + bounds.width / 2, bounds.y + bounds.height / 2, toXPosition, toYPosition); }
Source:
public boolean discoverPatient(final PatientSearchBean patientQuerySearch) { final gov.hhs.fha.nhinc.patientdiscovery.model.Patient patientBean = new gov.hhs.fha.nhinc.patientdiscovery.model.Patient(); patientBean.setOrganization(patientQuerySearch.getOrganization()); final DateFormat df = new SimpleDateFormat(UTCDateUtil.DATE_ONLY_FORMAT); patientBean.setBirthDate(df.format(patientQuerySearch.getDateOfBirth())); patientBean.setFirstName(patientQuerySearch.getFirstName()); patientBean.setLastName(patientQuerySearch.getLastName()); patientBean.setGender(patientQuerySearch.getGender()); try { final PatientSearchResults patientDiscoveryResults = patientService.queryPatient(patientBean, assertion); LOG.debug("Patient Discovery call successful. Total number of patients found: {}", patientDiscoveryResults.getPatientList().size()); if (patientDiscoveryResults.getPatientList().isEmpty()) { return false; } localCorrelation = correlationService.getLocalPatient(patientDiscoveryResults); if(localCorrelation == null) { correlationService.queryForCorrelations(patientDiscoveryResults, assertion); localCorrelation = correlationService.getLocalPatient(patientDiscoveryResults.getPatientList().get(0).getCorrelations()); } if(localCorrelation == null) { localCorrelation = correlationService.addCorrelation(patientDiscoveryResults, assertion); } populatePatientBean(patientDiscoveryResults, patientQuerySearch); return true; } catch (final PatientSearchException ex) { LOG.error("Failed to Retrieve Patient Data: {}", ex.getLocalizedMessage(), ex); return false; } }

Target:
public boolean discoverPatient(final PatientSearchBean patientQuerySearch) { final gov.hhs.fha.nhinc.patientdiscovery.model.Patient patientBean = new gov.hhs.fha.nhinc.patientdiscovery.model.Patient(); patientBean.setOrganization(patientQuerySearch.getOrganization()); final DateFormat df = new SimpleDateFormat(UTCDateUtil.DATE_ONLY_FORMAT); patientBean.setBirthDate(df.format(patientQuerySearch.getDateOfBirth())); patientBean.setFirstName(patientQuerySearch.getFirstName()); patientBean.setLastName(patientQuerySearch.getLastName()); patientBean.setGender(patientQuerySearch.getGender()); try { final PatientSearchResults patientDiscoveryResults = patientService.queryPatient(patientBean, assertion); LOG.debug("Patient Discovery call successful. Total number of patients found: {}", patientDiscoveryResults.getPatientList().size()); if (patientDiscoveryResults.getPatientList().isEmpty()) { return false; } localCorrelation = correlationService.retrieveOrGenerateCorrelation(patientDiscoveryResults, assertion); populatePatientBean(patientDiscoveryResults, patientQuerySearch); return true; } catch (final PatientSearchException ex) { LOG.error("Failed to Retrieve Patient Data: {}", ex.getLocalizedMessage(), ex); return false; } }
Source:
public void killQuery(String queryHash) { lock.lock(); try { runningQueries.get(queryHash).getSecond().interrupt(); } finally { lock.unlock(); } }

Target:
public void killQuery(String queryHash) { lock.lock(); try { if (runningQueries.get(queryHash) != null) { runningQueries.get(queryHash).getSecond().interrupt(); } } finally { lock.unlock(); } }
Source:
public Collection<?> getStructuredContentProviderElements(EObject self) { IStructuredItemContentProvider scp = getStructuredItemContentProvider(self); if (scp != null) { return scp.getElements(self); } else { return null; } }

Target:
public Collection<?> getStructuredContentProviderElements(EObject self) { IStructuredItemContentProvider scp = getStructuredItemContentProviderElements(self); if (scp != null) { return scp.getElements(self); } else { return null; } }