From 27dbb408e9ddeb6145c99d7df1b42712afc62de6 Mon Sep 17 00:00:00 2001 From: Stephane Gamard Date: Mon, 30 Jun 2014 17:43:27 +0200 Subject: [PATCH] SONAR-5007 - Fixed error in Issues when rule is REMOVED --- .../main/java/org/sonar/server/rule/DefaultRuleFinder.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sonar-server/src/main/java/org/sonar/server/rule/DefaultRuleFinder.java b/sonar-server/src/main/java/org/sonar/server/rule/DefaultRuleFinder.java index d916cb13145..395822f832d 100644 --- a/sonar-server/src/main/java/org/sonar/server/rule/DefaultRuleFinder.java +++ b/sonar-server/src/main/java/org/sonar/server/rule/DefaultRuleFinder.java @@ -66,7 +66,9 @@ public class DefaultRuleFinder implements RuleFinder { return rules; } for (Rule rule : index.getByIds(ruleIds)) { - rules.add(toRule(rule)); + if (rule.status() != RuleStatus.REMOVED) { + rules.add(toRule(rule)); + } } return rules; } @@ -97,7 +99,7 @@ public class DefaultRuleFinder implements RuleFinder { public final Collection findAll(org.sonar.api.rules.RuleQuery query) { List rules = newArrayList(); - for(Rule rule:index.search(toQuery(query), new QueryOptions()).getHits()){ + for (Rule rule : index.search(toQuery(query), new QueryOptions()).getHits()) { rules.add(toRule(rule)); } return rules; -- 2.39.5