From 47c0e8ea0136c8acdf141b76d6d709ddb2ad55c3 Mon Sep 17 00:00:00 2001 From: izabel <izabel> Date: Tue, 29 Sep 2009 08:50:15 +0000 Subject: [PATCH] remove unused code SVN: 12753 --- .../generic/shared/basic/dto/Filter.java | 12 -------- .../shared/translator/FilterTranslator.java | 16 ----------- .../translator/FilterTranslatorTest.java | 28 ------------------- 3 files changed, 56 deletions(-) diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Filter.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Filter.java index 379d4c78bc7..3038286aa66 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Filter.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/basic/dto/Filter.java @@ -50,8 +50,6 @@ public class Filter extends AbstractRegistrationHolder implements IsSerializable private Set<String> parameters; - private Set<String> columns; - public Filter() { } @@ -136,14 +134,4 @@ public class Filter extends AbstractRegistrationHolder implements IsSerializable this.parameters = parameters; } - public Set<String> getColumns() - { - return columns; - } - - public void setColumns(Set<String> columns) - { - this.columns = columns; - } - } diff --git a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/FilterTranslator.java b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/FilterTranslator.java index 2132cbc4baa..9d9d456fb65 100644 --- a/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/FilterTranslator.java +++ b/openbis/source/java/ch/systemsx/cisd/openbis/generic/shared/translator/FilterTranslator.java @@ -38,8 +38,6 @@ public final class FilterTranslator { private static final String PARAMETER_PATTERN = "\\$\\{.*?\\}"; - private static final String COLUMN_PATTERN = "col\\(.*?\\)"; - private FilterTranslator() { // Can not be instantiated. @@ -73,23 +71,9 @@ public final class FilterTranslator .getDatabaseInstance())); result.setPublic(filter.isPublic()); result.setParameters(extractParameters(filter.getExpression())); - result.setColumns(extractColumns(filter.getExpression())); return result; } - static Set<String> extractColumns(String expression) - { - Pattern parameterPattern = Pattern.compile(COLUMN_PATTERN); - Set<String> list = new HashSet<String>(); - Matcher matcher = parameterPattern.matcher(expression); - while (matcher.find()) - { - String group = matcher.group(); - list.add(group.substring(4, group.length() - 1)); - } - return list; - } - static Set<String> extractParameters(String expression) { Pattern parameterPattern = Pattern.compile(PARAMETER_PATTERN); diff --git a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/translator/FilterTranslatorTest.java b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/translator/FilterTranslatorTest.java index 87e464dfc33..7203bb7df29 100644 --- a/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/translator/FilterTranslatorTest.java +++ b/openbis/sourceTest/java/ch/systemsx/cisd/openbis/generic/shared/translator/FilterTranslatorTest.java @@ -54,32 +54,4 @@ public class FilterTranslatorTest extends AssertJUnit assertEquals(3, FilterTranslator.extractParameters(expression).size()); } - @Test - public void testExtractColumnsNoParameters() throws Exception - { - String expression = ""; - assertEquals(0, FilterTranslator.extractColumns(expression).size()); - } - - @Test - public void testExtractColumnsOneParameter() throws Exception - { - String expression = "col(abc)"; - assertEquals(1, FilterTranslator.extractColumns(expression).size()); - } - - @Test - public void testExtractColumnOneDuplicatedParameter() throws Exception - { - String expression = "col(abc) col(abc) "; - assertEquals(1, FilterTranslator.extractColumns(expression).size()); - } - - @Test - public void testExtractColumnManyParameters() throws Exception - { - String expression = "col(abc) col(abc) col(def) col(ghi)"; - assertEquals(3, FilterTranslator.extractColumns(expression).size()); - } - } -- GitLab