aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJulien HENRY <henryju@yahoo.fr>2016-12-15 16:31:58 +0100
committerJulien HENRY <henryju@yahoo.fr>2016-12-16 09:49:58 +0100
commitbd28d90a20a021855fe2754faa1b59272ed4970b (patch)
tree8c41bcbf37e13e3201065018f5507e4dc4272355 /server
parent4f52af2f86bb05145e9cfe95b7fe4871581f4810 (diff)
downloadsonarqube-bd28d90a20a021855fe2754faa1b59272ed4970b.tar.gz
sonarqube-bd28d90a20a021855fe2754faa1b59272ed4970b.zip
Fix quality flaws
Diffstat (limited to 'server')
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/issue/SetSeverityAction.java8
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/notification/DefaultNotificationManager.java10
2 files changed, 3 insertions, 15 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/issue/SetSeverityAction.java b/server/sonar-server/src/main/java/org/sonar/server/issue/SetSeverityAction.java
index 8a521e5f097..5bb3c9fc8a6 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/issue/SetSeverityAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/issue/SetSeverityAction.java
@@ -23,7 +23,6 @@ import com.google.common.base.Strings;
import java.util.Collection;
import java.util.Map;
import org.sonar.api.issue.Issue;
-import org.sonar.api.issue.condition.Condition;
import org.sonar.api.issue.condition.IsUnResolved;
import org.sonar.api.server.ServerSide;
import org.sonar.api.web.UserRole;
@@ -42,12 +41,7 @@ public class SetSeverityAction extends Action {
super(SET_SEVERITY_KEY);
this.issueUpdater = issueUpdater;
this.userSession = userSession;
- super.setConditions(new IsUnResolved(), new Condition() {
- @Override
- public boolean matches(Issue issue) {
- return isCurrentUserIssueAdmin(issue.projectKey());
- }
- });
+ super.setConditions(new IsUnResolved(), issue -> isCurrentUserIssueAdmin(issue.projectKey()));
}
private boolean isCurrentUserIssueAdmin(String projectKey) {
diff --git a/server/sonar-server/src/main/java/org/sonar/server/notification/DefaultNotificationManager.java b/server/sonar-server/src/main/java/org/sonar/server/notification/DefaultNotificationManager.java
index bceb9aa8c4a..83548fbd631 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/notification/DefaultNotificationManager.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/notification/DefaultNotificationManager.java
@@ -20,7 +20,6 @@
package org.sonar.server.notification;
import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Function;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Lists;
import com.google.common.collect.Multimap;
@@ -78,12 +77,7 @@ public class DefaultNotificationManager implements NotificationManager {
@Override
public void scheduleForSending(List<Notification> notification) {
- notificationQueueDao.insert(Lists.transform(notification, new Function<Notification, NotificationQueueDto>() {
- @Override
- public NotificationQueueDto apply(Notification notification) {
- return NotificationQueueDto.toNotificationQueueDto(notification);
- }
- }));
+ notificationQueueDao.insert(Lists.transform(notification, NotificationQueueDto::toNotificationQueueDto));
}
/**
@@ -130,7 +124,7 @@ public class DefaultNotificationManager implements NotificationManager {
*/
@Override
public Multimap<String, NotificationChannel> findSubscribedRecipientsForDispatcher(NotificationDispatcher dispatcher,
- @Nullable String projectUuid) {
+ @Nullable String projectUuid) {
String dispatcherKey = dispatcher.getKey();
SetMultimap<String, NotificationChannel> recipients = HashMultimap.create();