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 379d4c78bc7bbe1d787fd4964ac3870dc5408f29..3038286aa66ea0e4e6cf674c87ff1dd88dd361ff 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 2132cbc4baa8d865f3704b95a01d4482957b2aeb..9d9d456fb65d9e5fe52888624201c89b94ac4ec0 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 87e464dfc33c326aef5b91456e808a1756d20acd..7203bb7df29ccb351a22425893f0cb2efd785677 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()); - } - }