aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/indexer/DefaultSonarIndex.java4
-rw-r--r--sonar-batch/src/test/java/org/sonar/batch/indexer/DefaultSonarIndexTest.java2
2 files changed, 4 insertions, 2 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/indexer/DefaultSonarIndex.java b/sonar-batch/src/main/java/org/sonar/batch/indexer/DefaultSonarIndex.java
index e6c2c21cd7b..14b6f015d4a 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/indexer/DefaultSonarIndex.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/indexer/DefaultSonarIndex.java
@@ -177,8 +177,8 @@ public class DefaultSonarIndex extends SonarIndex {
return bucket;
}
- if (mustExist && lock.isLocked() && !ResourceUtils.isLibrary(resource)) {
- throw new SonarException("The following resource has not been registered before saving violation/measure/event: " + resource);
+ if (mustExist && lock.isLocked() && !ResourceUtils.isLibrary(resource)) {
+ LOG.warn("The following resource has not been registered before saving violation/measure/event: " + resource);
}
prepareResource(resource);
diff --git a/sonar-batch/src/test/java/org/sonar/batch/indexer/DefaultSonarIndexTest.java b/sonar-batch/src/test/java/org/sonar/batch/indexer/DefaultSonarIndexTest.java
index c818de86ad5..4e2387319d0 100644
--- a/sonar-batch/src/test/java/org/sonar/batch/indexer/DefaultSonarIndexTest.java
+++ b/sonar-batch/src/test/java/org/sonar/batch/indexer/DefaultSonarIndexTest.java
@@ -19,6 +19,7 @@
*/
package org.sonar.batch.indexer;
+import org.junit.Ignore;
import org.junit.Test;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.measures.Measure;
@@ -60,6 +61,7 @@ public class DefaultSonarIndexTest extends AbstractDbUnitTestCase {
}
@Test(expected = SonarException.class)
+ @Ignore("Temporarily log warnings instead of throwing an exception")
public void failIfLockedAndAddingMeasureOnUnknownResource() {
DefaultResourceCreationLock lock = new DefaultResourceCreationLock();
lock.lock();