From: Simon Brandhof Date: Wed, 19 Feb 2014 10:15:55 +0000 (+0100) Subject: Add missing @CheckForNull on RulesProfile X-Git-Tag: 4.2~93 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0331ddb1fd35a2259b042b704522610195951488;p=sonarqube.git Add missing @CheckForNull on RulesProfile --- 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 04fea5cee06..7836f493b89 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 @@ -29,6 +29,7 @@ import org.sonar.api.rules.ActiveRule; import org.sonar.api.rules.Rule; import org.sonar.api.rules.RulePriority; +import javax.annotation.CheckForNull; import javax.persistence.*; import java.util.ArrayList; import java.util.List; @@ -262,6 +263,7 @@ public class RulesProfile implements Cloneable { * * @since 2.5 */ + @CheckForNull public String getParentName() { return parentName; } @@ -331,6 +333,7 @@ public class RulesProfile implements Cloneable { * * @return an active rule from a plugin key and a rule key if the rule is activated, null otherwise */ + @CheckForNull public ActiveRule getActiveRule(String repositoryKey, String ruleKey) { for (ActiveRule activeRule : activeRules) { if (StringUtils.equals(activeRule.getRepositoryKey(), repositoryKey) && StringUtils.equals(activeRule.getRuleKey(), ruleKey) && activeRule.isEnabled()) { @@ -343,6 +346,7 @@ public class RulesProfile implements Cloneable { /** * Note: disabled rules are excluded. */ + @CheckForNull public ActiveRule getActiveRuleByConfigKey(String repositoryKey, String configKey) { for (ActiveRule activeRule : activeRules) { if (StringUtils.equals(activeRule.getRepositoryKey(), repositoryKey) && StringUtils.equals(activeRule.getConfigKey(), configKey) && activeRule.isEnabled()) { @@ -355,7 +359,7 @@ public class RulesProfile implements Cloneable { /** * Note: disabled rules are excluded. */ - + @CheckForNull public ActiveRule getActiveRule(Rule rule) { return getActiveRule(rule.getRepositoryKey(), rule.getKey()); }