]> source.dussan.org Git - sonarqube.git/commitdiff
Remove unused method ComponentDao#existsById()
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 27 Jun 2016 16:18:05 +0000 (18:18 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Mon, 27 Jun 2016 16:19:46 +0000 (18:19 +0200)
sonar-db/src/main/java/org/sonar/db/component/ComponentDao.java
sonar-db/src/test/java/org/sonar/db/component/ComponentDaoTest.java

index 256e03ec2ce8a0ffde2f5116f3b2034119656630..6742bec2cc04481f0a150c1a3628a173c63602bd 100644 (file)
@@ -85,10 +85,6 @@ public class ComponentDao implements Dao {
     return mapper(session).countByQuery(query);
   }
 
-  public boolean existsById(Long id, DbSession session) {
-    return mapper(session).countById(id) > 0;
-  }
-
   public List<ComponentDto> selectSubProjectsByComponentUuids(DbSession session, Collection<String> keys) {
     if (keys.isEmpty()) {
       return emptyList();
@@ -157,7 +153,8 @@ public class ComponentDao implements Dao {
 
   /**
    * List of ancestors, ordered from root to parent. The list is empty
-   * if the component is a tree root.
+   * if the component is a tree root. Disabled components are excluded by design
+   * as tree represents the more recent analysis.
    */
   public List<ComponentDto> selectAncestors(DbSession dbSession, ComponentDto component) {
     if (component.isRoot()) {
index 2dd1d5d229b23a1c99c3a7848c27774b418edf9d..ce4f17e78ea0141ac283e32bb70acb47c2e74963 100644 (file)
@@ -321,14 +321,6 @@ public class ComponentDaoTest {
     assertThat(underTest.selectById(dbSession, 111L)).isAbsent();
   }
 
-  @Test
-  public void count_by_id() {
-    db.prepareDbUnit(getClass(), "shared.xml");
-
-    assertThat(underTest.existsById(4L, dbSession)).isTrue();
-    assertThat(underTest.existsById(111L, dbSession)).isFalse();
-  }
-
   @Test
   public void select_component_keys_by_qualifiers() {
     db.prepareDbUnit(getClass(), "shared.xml");