aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-05-25 18:03:29 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2012-05-25 18:04:58 +0200
commit2a34a135a65c416f8703944b5713356802f9ab54 (patch)
treee78d94a42c0e81d810147d8694436b5d87360bc5 /sonar-server
parentfb2c1300ef4bfe5731fe0f6fc65bea1a44b25411 (diff)
downloadsonarqube-2a34a135a65c416f8703944b5713356802f9ab54.tar.gz
sonarqube-2a34a135a65c416f8703944b5713356802f9ab54.zip
Fix some quality flaws
Diffstat (limited to 'sonar-server')
-rw-r--r--sonar-server/src/main/java/org/sonar/server/filters/Filter.java4
-rw-r--r--sonar-server/src/main/webapp/WEB-INF/app/models/filters.rb4
-rw-r--r--sonar-server/src/test/java/org/sonar/server/filters/FilterExecutorTest.java4
3 files changed, 5 insertions, 7 deletions
diff --git a/sonar-server/src/main/java/org/sonar/server/filters/Filter.java b/sonar-server/src/main/java/org/sonar/server/filters/Filter.java
index 12ed8983d86..351477d93ed 100644
--- a/sonar-server/src/main/java/org/sonar/server/filters/Filter.java
+++ b/sonar-server/src/main/java/org/sonar/server/filters/Filter.java
@@ -46,7 +46,6 @@ public class Filter {
private String keyRegexp;
private String nameRegexp;
private boolean onDirectChildren = false;
- private boolean isViewContext = false;
// filters on measures
private List<MeasureCriterion> measureCriteria = Lists.newLinkedList();
@@ -63,7 +62,7 @@ public class Filter {
private boolean isNumericMetric = true;
private boolean ascendingSort = true;
- public Filter setPath(Integer rootSnapshotId, Integer snapshotId, String snapshotPath, boolean isViewContext) {
+ public Filter setPath(Integer rootSnapshotId, Integer snapshotId, String snapshotPath) {
this.baseSnapshotId = snapshotId;
if (rootSnapshotId == null) {
this.rootSnapshotId = snapshotId;
@@ -71,7 +70,6 @@ public class Filter {
this.rootSnapshotId = rootSnapshotId;
}
this.baseSnapshotPath = StringUtils.defaultString(snapshotPath, ""); //With Oracle the path can be null (see SONAR-2582)
- this.isViewContext = isViewContext;
return this;
}
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/models/filters.rb b/sonar-server/src/main/webapp/WEB-INF/app/models/filters.rb
index 1a4583cefd9..55551c9c884 100644
--- a/sonar-server/src/main/webapp/WEB-INF/app/models/filters.rb
+++ b/sonar-server/src/main/webapp/WEB-INF/app/models/filters.rb
@@ -27,9 +27,9 @@ class Filters
if filter.resource_id
snapshot=Snapshot.find(:first, :conditions => {:project_id => filter.resource_id, :islast => true})
if snapshot
- java_filter.setPath(snapshot.root_snapshot_id, snapshot.id, snapshot.path, (snapshot.view? || snapshot.subview?))
+ java_filter.setPath(snapshot.root_snapshot_id, snapshot.id, snapshot.path)
else
- java_filter.setPath(-1, -1, '', false)
+ java_filter.setPath(-1, -1, '')
end
end
diff --git a/sonar-server/src/test/java/org/sonar/server/filters/FilterExecutorTest.java b/sonar-server/src/test/java/org/sonar/server/filters/FilterExecutorTest.java
index 20b6ed429ae..22c8d9ade94 100644
--- a/sonar-server/src/test/java/org/sonar/server/filters/FilterExecutorTest.java
+++ b/sonar-server/src/test/java/org/sonar/server/filters/FilterExecutorTest.java
@@ -90,7 +90,7 @@ public class FilterExecutorTest extends AbstractDbUnitTestCase {
public void filterOnBaseSnapshot() {
setupData("shared");
FilterExecutor executor = new FilterExecutor(getSession(), new Derby());
- FilterResult result = executor.execute(Filter.createForAllQualifiers().setPath(2, 2, "", false));
+ FilterResult result = executor.execute(Filter.createForAllQualifiers().setPath(2, 2, ""));
assertSnapshotIds(result, 4);
}
@@ -321,7 +321,7 @@ public class FilterExecutorTest extends AbstractDbUnitTestCase {
setupData("views");
FilterExecutor executor = new FilterExecutor(getSession(), new Derby());
Filter filter = new Filter()
- .setPath(2, 2, "", true)
+ .setPath(2, 2, "")
.setQualifiers(Sets.newHashSet(Qualifiers.SUBVIEW, Qualifiers.PROJECT));
FilterResult result = executor.execute(filter);