aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2015-04-24 11:22:17 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2015-04-24 11:22:17 +0200
commit3612afdc027b0d4052e053f1e47de286d8d7d1a5 (patch)
tree2bf2a561446e8c79cdd21fa166831ad4bbe34510
parent5b0b77ac366811d1aa67e15adc10b09eb6351548 (diff)
downloadsonarqube-3612afdc027b0d4052e053f1e47de286d8d7d1a5.tar.gz
sonarqube-3612afdc027b0d4052e053f1e47de286d8d7d1a5.zip
Fix quality flaws
-rw-r--r--server/sonar-process/src/main/java/org/sonar/process/Lifecycle.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/activity/Activity.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/permission/InternalPermissionService.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleChange.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/rule/ws/SearchAction.java2
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/search/IndexField.java2
-rw-r--r--server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Server.java2
-rw-r--r--sonar-application/src/main/java/org/sonar/application/JdbcSettings.java2
-rw-r--r--sonar-core/src/main/java/org/sonar/core/graph/graphson/ElementPropertyConfig.java2
-rw-r--r--sonar-duplications/src/main/java/org/sonar/duplications/detector/original/BlocksGroup.java4
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java1
12 files changed, 12 insertions, 13 deletions
diff --git a/server/sonar-process/src/main/java/org/sonar/process/Lifecycle.java b/server/sonar-process/src/main/java/org/sonar/process/Lifecycle.java
index a28d7032410..f4bd42b57f5 100644
--- a/server/sonar-process/src/main/java/org/sonar/process/Lifecycle.java
+++ b/server/sonar-process/src/main/java/org/sonar/process/Lifecycle.java
@@ -21,7 +21,7 @@ package org.sonar.process;
public class Lifecycle {
- public static enum State {
+ public enum State {
INIT, STARTING, STARTED, STOPPING, STOPPED
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/activity/Activity.java b/server/sonar-server/src/main/java/org/sonar/server/activity/Activity.java
index ff9a5a2d145..b7a3ad0d96e 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/activity/Activity.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/activity/Activity.java
@@ -27,7 +27,7 @@ import java.util.Map;
public class Activity {
- public static enum Type {
+ public enum Type {
QPROFILE, SERVER, ANALYSIS_REPORT
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/permission/InternalPermissionService.java b/server/sonar-server/src/main/java/org/sonar/server/permission/InternalPermissionService.java
index f28de356546..98511305b2c 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/permission/InternalPermissionService.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/permission/InternalPermissionService.java
@@ -47,7 +47,7 @@ import java.util.Map;
*/
public class InternalPermissionService implements ServerComponent {
- private static enum Operation {
+ private enum Operation {
ADD, REMOVE
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleChange.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleChange.java
index ae29ee90da5..8ad045dc6fb 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleChange.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/ActiveRuleChange.java
@@ -32,7 +32,7 @@ import java.util.Map;
public class ActiveRuleChange {
- public static enum Type {
+ public enum Type {
ACTIVATED, DEACTIVATED, UPDATED
}
diff --git a/server/sonar-server/src/main/java/org/sonar/server/rule/ws/SearchAction.java b/server/sonar-server/src/main/java/org/sonar/server/rule/ws/SearchAction.java
index 7fa9841aad6..48a9813f940 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/rule/ws/SearchAction.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/rule/ws/SearchAction.java
@@ -68,8 +68,6 @@ public class SearchAction extends SearchRequestHandler<RuleQuery, Rule> implemen
public static final String PARAM_ACTIVE_SEVERITIES = "active_severities";
public static final String PARAM_IS_TEMPLATE = "is_template";
public static final String PARAM_TEMPLATE_KEY = "template_key";
- public static final String PARAM_FACETS = "facets";
-
public static final String SEARCH_ACTION = "search";
private static final Collection<String> DEFAULT_FACETS = ImmutableSet.of(PARAM_LANGUAGES, PARAM_REPOSITORIES, "tags");
diff --git a/server/sonar-server/src/main/java/org/sonar/server/search/IndexField.java b/server/sonar-server/src/main/java/org/sonar/server/search/IndexField.java
index ef171748b3a..6c378e17e76 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/search/IndexField.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/search/IndexField.java
@@ -27,7 +27,7 @@ import java.util.Collections;
public class IndexField {
- public static enum Type {
+ public enum Type {
STRING, TEXT, DATE, BOOLEAN, INTEGER, LONG, DOUBLE, OBJECT, UUID_PATH
}
diff --git a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Server.java b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Server.java
index ac3304fc69d..3748ab1e0d3 100644
--- a/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Server.java
+++ b/server/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Server.java
@@ -27,7 +27,7 @@ import javax.annotation.Nullable;
*/
public class Server extends Model {
- public static enum Status {
+ public enum Status {
SETUP,
UP,
DOWN,
diff --git a/sonar-application/src/main/java/org/sonar/application/JdbcSettings.java b/sonar-application/src/main/java/org/sonar/application/JdbcSettings.java
index ea867c74b6a..d9f35910a2c 100644
--- a/sonar-application/src/main/java/org/sonar/application/JdbcSettings.java
+++ b/sonar-application/src/main/java/org/sonar/application/JdbcSettings.java
@@ -34,7 +34,7 @@ import java.util.regex.Pattern;
public class JdbcSettings {
- static enum Provider {
+ enum Provider {
H2("lib/jdbc/h2"), JTDS("lib/jdbc/jtds"), MYSQL("lib/jdbc/mysql"), ORACLE("extensions/jdbc-driver/oracle"),
POSTGRESQL("lib/jdbc/postgresql");
diff --git a/sonar-core/src/main/java/org/sonar/core/graph/graphson/ElementPropertyConfig.java b/sonar-core/src/main/java/org/sonar/core/graph/graphson/ElementPropertyConfig.java
index 9f6fc8f097a..7dfc3ea0049 100644
--- a/sonar-core/src/main/java/org/sonar/core/graph/graphson/ElementPropertyConfig.java
+++ b/sonar-core/src/main/java/org/sonar/core/graph/graphson/ElementPropertyConfig.java
@@ -28,7 +28,7 @@ import java.util.Set;
*/
class ElementPropertyConfig {
- static enum ElementPropertiesRule {
+ enum ElementPropertiesRule {
INCLUDE, EXCLUDE
}
diff --git a/sonar-duplications/src/main/java/org/sonar/duplications/detector/original/BlocksGroup.java b/sonar-duplications/src/main/java/org/sonar/duplications/detector/original/BlocksGroup.java
index 6cdd4c0cbcf..063d98891ac 100644
--- a/sonar-duplications/src/main/java/org/sonar/duplications/detector/original/BlocksGroup.java
+++ b/sonar-duplications/src/main/java/org/sonar/duplications/detector/original/BlocksGroup.java
@@ -148,9 +148,7 @@ final class BlocksGroup {
j++;
continue;
}
- if (c == 0) {
- c = block1.getIndexInFile() - indexCorrection - block2.getIndexInFile();
- }
+ c = block1.getIndexInFile() - indexCorrection - block2.getIndexInFile();
if (c < 0) {
// list1[i] < list2[j]
break;
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java b/sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java
index 7725d50ce49..8346966c5e4 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/database/model/MeasureModel.java
@@ -211,6 +211,7 @@ public class MeasureModel implements Cloneable {
* @return null
*/
@CheckForNull
+ @Deprecated
public Integer getTendency() {
return null;
}
@@ -219,6 +220,7 @@ public class MeasureModel implements Cloneable {
* Concept of measure trend is dropped. This method does nothing.
* @deprecated since 5.2. See https://jira.codehaus.org/browse/SONAR-6392
*/
+ @Deprecated
public MeasureModel setTendency(Integer tendency) {
return this;
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java
index 260efe3be55..0d041a25890 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/Measure.java
@@ -452,6 +452,7 @@ public class Measure<G extends Serializable> implements Serializable {
* @deprecated since 5.2. See https://jira.codehaus.org/browse/SONAR-6392
* @return the measure object instance
*/
+ @Deprecated
public Measure setTendency(@Nullable Integer tendency) {
return this;
}