Skip to content

Commit

Permalink
Remove useless parameter
Browse files Browse the repository at this point in the history
The class is a project service so it's already a field
  • Loading branch information
damien-urruty-sonarsource committed Sep 26, 2022
1 parent 0e77cd1 commit f54f34c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ class RefreshTaintVulnerabilitiesAction(text: String = "Refresh") : AbstractSona

override fun actionPerformed(e: AnActionEvent) {
val project = e.project ?: return
getService(project, TaintVulnerabilitiesPresenter::class.java).refreshTaintVulnerabilitiesForOpenFilesAsync(project)
getService(project, TaintVulnerabilitiesPresenter::class.java).refreshTaintVulnerabilitiesForOpenFilesAsync()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ const val TAINT_VULNERABILITIES_REFRESH_ERROR_MESSAGE = "Error refreshing taint
class TaintVulnerabilitiesPresenter(private val project: Project) {
var currentVulnerabilitiesByFile : Map<VirtualFile, Collection<LocalTaintVulnerability>> = emptyMap()

fun refreshTaintVulnerabilitiesForOpenFilesAsync(project: Project) {
fun refreshTaintVulnerabilitiesForOpenFilesAsync() {
ProgressManager.getInstance().run(object : Task.Backgroundable(project, "Refreshing taint vulnerabilities...", false, ALWAYS_BACKGROUND) {
override fun run(indicator: ProgressIndicator) {
refreshTaintVulnerabilitiesForOpenFiles(project)
refreshTaintVulnerabilitiesForOpenFiles()
}
})
}

fun refreshTaintVulnerabilitiesForOpenFiles(project: Project) {
fun refreshTaintVulnerabilitiesForOpenFiles() {
try {
project.getOpenFiles().forEach { refreshTaintVulnerabilitiesFor(project, it) }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,6 @@ class TaintVulnerabilitiesRefreshTrigger(private val project: Project) {
}

private fun triggerRefresh() {
getService(project, TaintVulnerabilitiesPresenter::class.java).refreshTaintVulnerabilitiesForOpenFilesAsync(project)
getService(project, TaintVulnerabilitiesPresenter::class.java).refreshTaintVulnerabilitiesForOpenFilesAsync()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ private static void updateAllProjectIssuesForCurrentBranch(ConnectedSonarLintEng
});

if (SonarLintUtils.isTaintVulnerabilitiesEnabled()) {
projectsToUpdate.forEach(project -> getService(project, TaintVulnerabilitiesPresenter.class).refreshTaintVulnerabilitiesForOpenFiles(project));
projectsToUpdate.forEach(project -> getService(project, TaintVulnerabilitiesPresenter.class).refreshTaintVulnerabilitiesForOpenFiles());
}
}

Expand Down

0 comments on commit f54f34c

Please sign in to comment.