aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2017-02-16 13:34:06 +0100
committerJulien Lancelot <julien.lancelot@sonarsource.com>2017-02-16 13:34:06 +0100
commit4397ca246c0c3ddf7bcc9ad35dc0d79a14237409 (patch)
treef8f2082daecf88c4bc216ac2fd78159c531c2993
parent5a4b7afd1a9a54f5cb4b98809747181a67b5ee75 (diff)
downloadsonarqube-4397ca246c0c3ddf7bcc9ad35dc0d79a14237409.tar.gz
sonarqube-4397ca246c0c3ddf7bcc9ad35dc0d79a14237409.zip
Fix quality flaws
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleDoc.java4
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleDoc.java12
-rw-r--r--server/sonar-server/src/main/java/org/sonar/server/user/index/UserDoc.java4
3 files changed, 10 insertions, 10 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleDoc.java b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleDoc.java
index ada2a44b933..1c5760bfa4f 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleDoc.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/qualityprofile/index/ActiveRuleDoc.java
@@ -41,7 +41,7 @@ public class ActiveRuleDoc extends BaseDoc {
private final ActiveRuleKey key;
public ActiveRuleDoc(ActiveRuleKey key) {
- super(Maps.<String, Object>newHashMapWithExpectedSize(8));
+ super(Maps.newHashMapWithExpectedSize(8));
checkNotNull(key, "ActiveRuleKey cannot be null");
this.key = key;
setField(FIELD_ACTIVE_RULE_KEY, key.toString());
@@ -70,7 +70,7 @@ public class ActiveRuleDoc extends BaseDoc {
}
String severity() {
- return (String) getNullableField(FIELD_ACTIVE_RULE_SEVERITY);
+ return getNullableField(FIELD_ACTIVE_RULE_SEVERITY);
}
public ActiveRuleDoc setSeverity(@Nullable String s) {
diff --git a/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleDoc.java b/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleDoc.java
index 5f11b5b3534..0c3edfe104d 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleDoc.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/rule/index/RuleDoc.java
@@ -40,7 +40,7 @@ public class RuleDoc extends BaseDoc {
}
public RuleDoc() {
- super(Maps.<String, Object>newHashMap());
+ super(Maps.newHashMap());
}
@Override
@@ -59,7 +59,7 @@ public class RuleDoc extends BaseDoc {
}
public RuleKey key() {
- return RuleKey.parse(this.<String>getField(RuleIndexDefinition.FIELD_RULE_KEY));
+ return RuleKey.parse(this.getField(RuleIndexDefinition.FIELD_RULE_KEY));
}
public RuleDoc setKey(@Nullable String s) {
@@ -128,7 +128,7 @@ public class RuleDoc extends BaseDoc {
@CheckForNull
public String severity() {
- return (String) getNullableField(RuleIndexDefinition.FIELD_RULE_SEVERITY);
+ return getNullableField(RuleIndexDefinition.FIELD_RULE_SEVERITY);
}
public RuleDoc setSeverity(@Nullable String s) {
@@ -138,7 +138,7 @@ public class RuleDoc extends BaseDoc {
@CheckForNull
public RuleStatus status() {
- return RuleStatus.valueOf((String) getField(RuleIndexDefinition.FIELD_RULE_STATUS));
+ return RuleStatus.valueOf(getField(RuleIndexDefinition.FIELD_RULE_STATUS));
}
public RuleDoc setStatus(@Nullable String s) {
@@ -167,7 +167,7 @@ public class RuleDoc extends BaseDoc {
}
public Collection<String> allTags() {
- return (Collection<String>) getField(RuleIndexDefinition.FIELD_RULE_ALL_TAGS);
+ return getField(RuleIndexDefinition.FIELD_RULE_ALL_TAGS);
}
public RuleDoc setAllTags(@Nullable Collection<String> l) {
@@ -176,7 +176,7 @@ public class RuleDoc extends BaseDoc {
}
public RuleType type() {
- return RuleType.valueOf((String) getField(RuleIndexDefinition.FIELD_RULE_TYPE));
+ return RuleType.valueOf(getField(RuleIndexDefinition.FIELD_RULE_TYPE));
}
public RuleDoc setType(RuleType ruleType) {
diff --git a/server/sonar-server/src/main/java/org/sonar/server/user/index/UserDoc.java b/server/sonar-server/src/main/java/org/sonar/server/user/index/UserDoc.java
index 16ea1c4f171..c1ad19d6322 100644
--- a/server/sonar-server/src/main/java/org/sonar/server/user/index/UserDoc.java
+++ b/server/sonar-server/src/main/java/org/sonar/server/user/index/UserDoc.java
@@ -34,7 +34,7 @@ public class UserDoc extends BaseDoc implements User {
}
public UserDoc() {
- this(Maps.<String, Object>newHashMap());
+ this(Maps.newHashMap());
}
@Override
@@ -74,7 +74,7 @@ public class UserDoc extends BaseDoc implements User {
}
public List<String> scmAccounts() {
- return (List<String>) getField(UserIndexDefinition.FIELD_SCM_ACCOUNTS);
+ return getField(UserIndexDefinition.FIELD_SCM_ACCOUNTS);
}
public long createdAt() {