diff options
author | Simon Brandhof <simon.brandhof@gmail.com> | 2013-05-17 17:31:56 +0200 |
---|---|---|
committer | Simon Brandhof <simon.brandhof@gmail.com> | 2013-05-17 17:31:56 +0200 |
commit | 30e3216e8b60b0b3baa591a84351f95fdcdb5882 (patch) | |
tree | a3a695e3706d0b49657f9bb0fad4c8912b2b983b /sonar-core | |
parent | b78804e0de65822f03a95f4ee2cd00d0b68a8fff (diff) | |
download | sonarqube-30e3216e8b60b0b3baa591a84351f95fdcdb5882.tar.gz sonarqube-30e3216e8b60b0b3baa591a84351f95fdcdb5882.zip |
SONAR-3755 do not filter non-READY rules in the WS /api/issues/search
Diffstat (limited to 'sonar-core')
-rw-r--r-- | sonar-core/src/main/java/org/sonar/core/rule/DefaultRuleFinder.java | 6 | ||||
-rw-r--r-- | sonar-core/src/test/java/org/sonar/core/rule/DefaultRuleFinderTest.java | 4 |
2 files changed, 4 insertions, 6 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/rule/DefaultRuleFinder.java b/sonar-core/src/main/java/org/sonar/core/rule/DefaultRuleFinder.java index c7399c00b9c..ab82ec70fde 100644 --- a/sonar-core/src/main/java/org/sonar/core/rule/DefaultRuleFinder.java +++ b/sonar-core/src/main/java/org/sonar/core/rule/DefaultRuleFinder.java @@ -63,10 +63,8 @@ public class DefaultRuleFinder implements RuleFinder { return Collections.emptyList(); } DatabaseSession session = sessionFactory.getSession(); - StringBuilder hql = new StringBuilder().append("from ").append(Rule.class.getSimpleName()).append(" r where r.id in (:ids) and status<>:status "); - Query hqlQuery = session.createQuery(hql.toString()) - .setParameter("status", Rule.STATUS_REMOVED) - .setParameter("ids", ruleIds); + StringBuilder hql = new StringBuilder().append("from ").append(Rule.class.getSimpleName()).append(" r where r.id in (:ids)"); + Query hqlQuery = session.createQuery(hql.toString()).setParameter("ids", ruleIds); return hqlQuery.getResultList(); } diff --git a/sonar-core/src/test/java/org/sonar/core/rule/DefaultRuleFinderTest.java b/sonar-core/src/test/java/org/sonar/core/rule/DefaultRuleFinderTest.java index f2bdccae419..ab42781963a 100644 --- a/sonar-core/src/test/java/org/sonar/core/rule/DefaultRuleFinderTest.java +++ b/sonar-core/src/test/java/org/sonar/core/rule/DefaultRuleFinderTest.java @@ -50,8 +50,8 @@ public class DefaultRuleFinderTest extends AbstractDbUnitTestCase { public void should_find_by_ids() { setupData("shared"); DefaultRuleFinder finder = new DefaultRuleFinder(getSessionFactory()); - // 2 is disabled - assertThat(finder.findByIds(newArrayList(2, 3))).hasSize(1); + // 2 is returned even its status is REMOVED + assertThat(finder.findByIds(newArrayList(2, 3))).hasSize(2); } @Test |