]> source.dussan.org Git - sonarqube.git/commitdiff
Fix quality flaws
authorTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Fri, 29 Apr 2016 15:32:00 +0000 (17:32 +0200)
committerTeryk Bellahsene <teryk.bellahsene@sonarsource.com>
Fri, 29 Apr 2016 15:32:00 +0000 (17:32 +0200)
server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentAction.java
server/sonar-server/src/main/java/org/sonar/server/measure/ws/ComponentTreeSort.java
sonar-db/src/main/java/org/sonar/db/qualitygate/QualityGateConditionDao.java

index 4ee10da7ab69c9fbbb168b02abc97a0a73ee0da1..ffe497b57b669ccf275a49ade610477eb1f48995 100644 (file)
@@ -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;
     }
 
index 3f9cc3e042e5a5c00d1322c83ed53b4e239440a9..1f7141e72e5c56873a433054b9b07bb1a9999d4b 100644 (file)
@@ -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<ValueType> NUMERIC_VALUE_TYPES = ImmutableSet.of(BOOL, FLOAT, INT, MILLISEC, WORK_DUR, PERCENT, RATING);
-  private static final Set<ValueType> TEXTUAL_VALUE_TYPES = ImmutableSet.of(DATA, DISTRIB, LEVEL, STRING);
+  private static final Set<ValueType> NUMERIC_VALUE_TYPES = EnumSet.of(BOOL, FLOAT, INT, MILLISEC, WORK_DUR, PERCENT, RATING);
+  private static final Set<ValueType> TEXTUAL_VALUE_TYPES = EnumSet.of(DATA, DISTRIB, LEVEL, STRING);
 
   private ComponentTreeSort() {
     // static method only
index fa1693fee69e3fa5d75092d4dad24b5fa050013a..858bb9ef4b9d8cc6b6fce672c45584b4fcbcd61d 100644 (file)
@@ -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);
   }
 }