Search in sources :

Example 1 with DiskCache

use of org.sonar.server.util.cache.DiskCache in project sonarqube by SonarSource.

the class CloseIssuesOnRemovedComponentsVisitor method closeIssuesForDeletedComponentUuids.

private void closeIssuesForDeletedComponentUuids(Set<String> deletedComponentUuids) {
    DiskCache<DefaultIssue>.DiskAppender<DefaultIssue> cacheAppender = issueCache.newAppender();
    try {
        for (String deletedComponentUuid : deletedComponentUuids) {
            List<DefaultIssue> issues = baseIssuesLoader.loadForComponentUuid(deletedComponentUuid);
            for (DefaultIssue issue : issues) {
                issue.setBeingClosed(true);
                // TODO should be renamed
                issue.setOnDisabledRule(false);
                issueLifecycle.doAutomaticTransition(issue);
                cacheAppender.append(issue);
            }
        }
    } finally {
        cacheAppender.close();
    }
}
Also used : DefaultIssue(org.sonar.core.issue.DefaultIssue) DiskCache(org.sonar.server.util.cache.DiskCache)

Aggregations

DefaultIssue (org.sonar.core.issue.DefaultIssue)1 DiskCache (org.sonar.server.util.cache.DiskCache)1