]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-3755 do not filter non-READY rules in the WS /api/issues/search
authorSimon Brandhof <simon.brandhof@gmail.com>
Fri, 17 May 2013 15:31:56 +0000 (17:31 +0200)
committerSimon Brandhof <simon.brandhof@gmail.com>
Fri, 17 May 2013 15:31:56 +0000 (17:31 +0200)
sonar-core/src/main/java/org/sonar/core/rule/DefaultRuleFinder.java
sonar-core/src/test/java/org/sonar/core/rule/DefaultRuleFinderTest.java

index c7399c00b9c2332d94f3cd1228a6701c8305f60c..ab82ec70fde05771a71267bcd8f3391930351e8d 100644 (file)
@@ -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();
   }
 
index f2bdccae419b2fffc36089f2687aff55ce1f1aa2..ab42781963ab2e6880fb6eac9956992b2c163128 100644 (file)
@@ -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