aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@sonarsource.com>2014-10-07 15:51:47 +0200
committerSimon Brandhof <simon.brandhof@sonarsource.com>2014-10-07 15:53:36 +0200
commit2354a1598072700ef24fb5d41ab26d82f383fb6b (patch)
tree8e09b8eb4f5a87201aa1d3ec0c8c85d8564a5c15 /sonar-plugin-api
parent92e5bdd660471c84b8251e7f796f0243ba83e0c2 (diff)
downloadsonarqube-2354a1598072700ef24fb5d41ab26d82f383fb6b.tar.gz
sonarqube-2354a1598072700ef24fb5d41ab26d82f383fb6b.zip
Fix quality flaws
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/batch/maven/MavenPlugin.java10
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java20
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/profiles/RulesProfile.java47
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java55
4 files changed, 10 insertions, 122 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/batch/maven/MavenPlugin.java b/sonar-plugin-api/src/main/java/org/sonar/api/batch/maven/MavenPlugin.java
index 7df378027eb..a73c125ae8c 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/batch/maven/MavenPlugin.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/batch/maven/MavenPlugin.java
@@ -393,11 +393,13 @@ public class MavenPlugin {
if (pom.getPluginManagement() != null && pom.getPluginManagement().getPlugins() != null) {
unregisterPlugin(pom.getPluginManagement().getPlugins(), groupId, artifactId);
}
- if (pom.getBuildPlugins() != null && pom.getBuildPlugins() != null) {
- unregisterPlugin(pom.getBuildPlugins(), groupId, artifactId);
+ List plugins = pom.getBuildPlugins();
+ if (plugins != null) {
+ unregisterPlugin(plugins, groupId, artifactId);
}
- if (pom.getReportPlugins() != null) {
- unregisterReportPlugin(pom.getReportPlugins(), groupId, artifactId);
+ plugins = pom.getReportPlugins();
+ if (plugins != null) {
+ unregisterReportPlugin(plugins, groupId, artifactId);
}
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java b/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java
index e6c114e5b31..13f642867e3 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/measures/RuleMeasure.java
@@ -72,7 +72,7 @@ public class RuleMeasure extends Measure {
}
/**
- * @deprecated since 4.4 use {@link #setRuleKey()}
+ * @deprecated since 4.4 use {@link #setRuleKey(org.sonar.api.rule.RuleKey)}
*/
@Deprecated
public RuleMeasure setRule(Rule rule) {
@@ -112,28 +112,12 @@ public class RuleMeasure extends Measure {
return this;
}
- /**
- * @deprecated since 2.5. See SONAR-2007.
- */
- @Deprecated
- public Integer getRuleCategory() {
- return null;
- }
-
- /**
- * @deprecated since 2.5. See SONAR-2007.
- */
- @Deprecated
- public void setRuleCategory(Integer ruleCategory) {
- // nothing
- }
-
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
- if (!(obj.getClass().equals(RuleMeasure.class))) {// NOSONAR should be refactored but kept in the current state
+ if (!(obj.getClass().equals(RuleMeasure.class))) {
// for the moment.
return false;
}
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/RulesProfile.java b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/RulesProfile.java
index c3813ba404e..795eb19a465 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/RulesProfile.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/RulesProfile.java
@@ -205,45 +205,6 @@ public class RulesProfile implements Cloneable {
}
/**
- * @deprecated since 3.3 not replaced
- */
- @Deprecated
- public Boolean getProvided() {
- return false;
- }
-
- /**
- * @deprecated since 3.3 not replaced
- */
- @Deprecated
- public void setProvided(Boolean b) {
- }
-
- /**
- * @deprecated since 3.3. Always return true.
- */
- @Deprecated
- public Boolean getEnabled() {
- return Boolean.TRUE;
- }
-
- /**
- * @deprecated since 3.3. Always return true.
- */
- @Deprecated
- public boolean isEnabled() {
- return true;
- }
-
- /**
- * @deprecated since 3.3.
- */
- @Deprecated
- public RulesProfile setEnabled(Boolean b) {
- throw new UnsupportedOperationException("The field RulesProfile#enabled is not supported since 3.3.");
- }
-
- /**
* @return the profile language
*/
public String getLanguage() {
@@ -293,14 +254,6 @@ public class RulesProfile implements Cloneable {
}
/**
- * @deprecated since 2.3 use {@link #getActiveRulesByRepository(String)} instead.
- */
- @Deprecated
- public List<ActiveRule> getActiveRulesByPlugin(String repositoryKey) {
- return getActiveRulesByRepository(repositoryKey);
- }
-
- /**
* Get the active rules of a specific repository.
* Only enabled rules are selected. Disabled rules are excluded.
*/
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java
index 006eb0866cd..624002758e5 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Rule.java
@@ -220,23 +220,6 @@ public class Rule {
return this;
}
- /**
- * @deprecated since 2.5 use {@link #getRepositoryKey()} instead
- */
- @Deprecated
- public String getPluginName() {
- return pluginName;
- }
-
- /**
- * @deprecated since 2.5 use {@link #setRepositoryKey(String)} instead
- */
- @Deprecated
- public Rule setPluginName(String pluginName) {
- this.pluginName = pluginName;
- return this;
- }
-
public String getConfigKey() {
return configKey;
}
@@ -261,14 +244,6 @@ public class Rule {
return this;
}
- /**
- * @deprecated in 3.6. Replaced by {@link #setStatus(String status)}.
- */
- @Deprecated
- public Rule setEnabled(Boolean enabled) {
- throw new UnsupportedOperationException("No more supported since version 3.6.");
- }
-
public Boolean isEnabled() {
return !STATUS_REMOVED.equals(status);
}
@@ -314,14 +289,6 @@ public class Rule {
}
/**
- * @deprecated since 2.5. See http://jira.codehaus.org/browse/SONAR-2007
- */
- @Deprecated
- public Integer getCategoryId() {
- return null;
- }
-
- /**
* @since 2.5
*/
public RulePriority getSeverity() {
@@ -341,24 +308,6 @@ public class Rule {
return this;
}
- /**
- * @deprecated since 2.5 use {@link #getSeverity()} instead. See http://jira.codehaus.org/browse/SONAR-1829
- */
- @Deprecated
- public RulePriority getPriority() {
- return priority;
- }
-
- /**
- * Sets the rule priority. If null, uses the default priority
- *
- * @deprecated since 2.5 use {@link #setSeverity(RulePriority)} instead. See http://jira.codehaus.org/browse/SONAR-1829
- */
- @Deprecated
- public Rule setPriority(RulePriority priority) {
- return setSeverity(priority);
- }
-
public String getRepositoryKey() {
return pluginName;
}
@@ -531,7 +480,7 @@ public class Rule {
/**
* For internal use only.
*
- * @deprecated since 4.4, use {@link #setCharacteristicKey(@Nullable String characteristicKey)}
+ * @deprecated since 4.4, use {@link #setCharacteristicKey(String)}
* @since 4.3
*/
@Deprecated
@@ -555,7 +504,7 @@ public class Rule {
/**
* For internal use only.
*
- * @deprecated since 4.4, use {@link #setDefaultCharacteristicKey(@Nullable String defaultCharacteristicKey)}
+ * @deprecated since 4.4, use {@link #setDefaultCharacteristicKey(String)}
* @since 4.3
*/
@Deprecated