]> source.dussan.org Git - sonarqube.git/commitdiff
Fix regression caused by SONAR-5349
authorJulien HENRY <julien.henry@sonarsource.com>
Wed, 27 Aug 2014 14:46:44 +0000 (16:46 +0200)
committerJulien HENRY <julien.henry@sonarsource.com>
Wed, 27 Aug 2014 14:47:14 +0000 (16:47 +0200)
sonar-batch/src/main/java/org/sonar/batch/scan/ProjectReactorValidator.java
sonar-core/src/main/java/org/sonar/core/resource/ResourceDao.java

index 67a226151d367879202dab26dbaffb04598790ce..7b53b884b94979a2ad0c8c0b80898a63128ddf49 100644 (file)
@@ -25,6 +25,7 @@ import org.sonar.api.CoreProperties;
 import org.sonar.api.batch.bootstrap.ProjectDefinition;
 import org.sonar.api.batch.bootstrap.ProjectReactor;
 import org.sonar.api.config.Settings;
+import org.sonar.api.resources.Qualifiers;
 import org.sonar.api.utils.SonarException;
 import org.sonar.core.component.ComponentKeys;
 import org.sonar.core.resource.ResourceDao;
@@ -88,8 +89,8 @@ public class ProjectReactorValidator {
       // SONAR-4692 Validate root project is the same than previous analysis to avoid module with same key in different projects
       String moduleKey = ComponentKeys.createKey(moduleDef.getKey(), branch);
       ResourceDto rootInDB = resourceDao.getRootProjectByComponentKey(moduleKey);
-      if (rootInDB == null) {
-        // This is a new module so OK
+      if (rootInDB == null || Qualifiers.LIBRARY.equals(rootInDB.getQualifier())) {
+        // This is a new module or previously a library so OK
         return;
       }
       if (rootInDB.getKey().equals(moduleKey)) {
index dd1095d88bafaf0c1dbbd5312747f3c16698213b..94b54f042b65266c13b2898a113d6582d9960c17 100644 (file)
@@ -202,7 +202,7 @@ public class ResourceDao implements DaoComponent {
   /**
    * Return the root project of a component.
    * Will return the component itself if it's already the root project
-   * Can return null if the component that does exists.
+   * Can return null if the component does not exists.
    *
    * The implementation should rather use a new column already containing the root project, see https://jira.codehaus.org/browse/SONAR-5188.
    */