]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-2582 The Filter Path field is not working with Oracle DB
authorFreddy Mallet <freddy.mallet@gmail.com>
Thu, 28 Jul 2011 15:20:10 +0000 (17:20 +0200)
committerFreddy Mallet <freddy.mallet@gmail.com>
Thu, 28 Jul 2011 15:20:10 +0000 (17:20 +0200)
sonar-server/src/main/java/org/sonar/server/filters/Filter.java

index 542a58b6fa70e954d999969c2ffabd81c8601335..cc7722acad8a7bd1b401bf7c9f754c0082530de6 100644 (file)
@@ -21,6 +21,8 @@ package org.sonar.server.filters;
 
 import com.google.common.collect.Lists;
 import com.google.common.collect.Sets;
+
+import org.apache.commons.lang.StringUtils;
 import org.apache.commons.lang.builder.ReflectionToStringBuilder;
 import org.apache.commons.lang.builder.ToStringStyle;
 import org.sonar.api.resources.Qualifiers;
@@ -67,7 +69,7 @@ public class Filter {
     } else {
       this.rootSnapshotId = rootSnapshotId;
     }
-    this.baseSnapshotPath = snapshotPath;
+    this.baseSnapshotPath = StringUtils.defaultString(snapshotPath, ""); //With Oracle the path can be null (see SONAR-2582)
     this.isViewContext = isViewContext;
     return this;
   }
@@ -77,7 +79,7 @@ public class Filter {
   }
 
   public boolean hasBaseSnapshot() {
-    return rootSnapshotId != null && baseSnapshotId != null && baseSnapshotPath != null;
+    return baseSnapshotId != null;
   }
 
   public Integer getBaseSnapshotId() {