From: Teryk Bellahsene Date: Fri, 29 Apr 2016 15:32:00 +0000 (+0200) Subject: Fix quality flaws X-Git-Tag: 5.6-RC1~234 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8d6a28337cf53115c0f08accc7cfe404ff432108;p=sonarqube.git Fix quality flaws --- diff --git a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentAction.java b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentAction.java index 4ee10da7ab6..ffe497b57b6 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentAction.java +++ b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentAction.java @@ -148,7 +148,7 @@ public class ComponentAction implements MeasuresWsAction { @CheckForNull private Long searchDeveloperId(DbSession dbSession, ComponentWsRequest request) { - if ((request.getDeveloperId() == null && request.getDeveloperKey() == null)) { + if (request.getDeveloperId() == null && request.getDeveloperKey() == null) { return null; } diff --git a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeSort.java b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeSort.java index 3f9cc3e042e..1f7141e72e5 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeSort.java +++ b/server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeSort.java @@ -21,10 +21,10 @@ package org.sonar.server.measure.ws; import com.google.common.base.Function; import com.google.common.collect.ImmutableMap; -import com.google.common.collect.ImmutableSet; import com.google.common.collect.Maps; import com.google.common.collect.Ordering; import com.google.common.collect.Table; +import java.util.EnumSet; import java.util.List; import java.util.Map; import java.util.Set; @@ -59,8 +59,8 @@ import static org.sonar.server.measure.ws.ComponentTreeAction.QUALIFIER_SORT; class ComponentTreeSort { - private static final Set NUMERIC_VALUE_TYPES = ImmutableSet.of(BOOL, FLOAT, INT, MILLISEC, WORK_DUR, PERCENT, RATING); - private static final Set TEXTUAL_VALUE_TYPES = ImmutableSet.of(DATA, DISTRIB, LEVEL, STRING); + private static final Set NUMERIC_VALUE_TYPES = EnumSet.of(BOOL, FLOAT, INT, MILLISEC, WORK_DUR, PERCENT, RATING); + private static final Set TEXTUAL_VALUE_TYPES = EnumSet.of(DATA, DISTRIB, LEVEL, STRING); private ComponentTreeSort() { // static method only diff --git a/sonar-db/src/main/java/org/sonar/db/qualitygate/QualityGateConditionDao.java b/sonar-db/src/main/java/org/sonar/db/qualitygate/QualityGateConditionDao.java index fa1693fee69..858bb9ef4b9 100644 --- a/sonar-db/src/main/java/org/sonar/db/qualitygate/QualityGateConditionDao.java +++ b/sonar-db/src/main/java/org/sonar/db/qualitygate/QualityGateConditionDao.java @@ -118,7 +118,7 @@ public class QualityGateConditionDao implements Dao { mapper(session).deleteConditionsWithInvalidMetrics(); } - private QualityGateConditionMapper mapper(SqlSession session) { + private static QualityGateConditionMapper mapper(SqlSession session) { return session.getMapper(QualityGateConditionMapper.class); } }