From 0331ddb1fd35a2259b042b704522610195951488 Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Wed, 19 Feb 2014 11:15:55 +0100 Subject: [PATCH] Add missing @CheckForNull on RulesProfile --- .../src/main/java/org/sonar/api/profiles/RulesProfile.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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()); } -- 2.39.5