Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan D. Brooks2019-06-08 04:50:58 +0000
committerRyan D. Brooks2020-12-15 21:41:05 +0000
commit3b50235dfa4ae6ed01f419b3a548e482733655d5 (patch)
tree6d90f62f47180f85358d08fd30e8437a59473e29
parent8a27bdf31b2fc95a8c151061fddd28f93a63493c (diff)
downloadorg.eclipse.osee-3b50235dfa4ae6ed01f419b3a548e482733655d5.tar.gz
org.eclipse.osee-3b50235dfa4ae6ed01f419b3a548e482733655d5.tar.xz
org.eclipse.osee-3b50235dfa4ae6ed01f419b3a548e482733655d5.zip
refinement: Gracefully handle invalid query criteria
-rw-r--r--plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/resource/AtsActionUiEndpointTest.java2
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/Criteria.java10
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/QueryData.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationTypeCriteria.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaArtifactGuids.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaArtifactIds.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaArtifactType.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAssociatedArtId.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeKeywords.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeRaw.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeTypeExists.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeTypeNotExists.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchAncestorOf.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchChildOf.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchName.java8
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaDateRange.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaMainTableField.java3
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaMergeBranchFor.java7
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaRelatedTo.java1
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaRelationTypeNotExists.java1
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxComment.java6
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxGetPrior.java4
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryBuilderImpl.java5
-rw-r--r--plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TxQueryBuilderImpl.java5
24 files changed, 67 insertions, 58 deletions
diff --git a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/resource/AtsActionUiEndpointTest.java b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/resource/AtsActionUiEndpointTest.java
index f862c97e59a..b712d20050b 100644
--- a/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/resource/AtsActionUiEndpointTest.java
+++ b/plugins/org.eclipse.osee.ats.ide.integration.tests/src/org/eclipse/osee/ats/ide/integration/tests/ats/resource/AtsActionUiEndpointTest.java
@@ -76,7 +76,7 @@ public class AtsActionUiEndpointTest extends AbstractRestTest {
@Test
public void getActionDetailsError() throws Exception {
- String html = getHtml("/ats/ui/action/" + DemoUtil.getSawAtsIdsStr() + "/details");
+ String html = getHtml("/ats/ui/action/badId/details");
Assert.assertTrue(html.contains("can not be found"));
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/Criteria.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/Criteria.java
index 675dd37f979..57dc72d0fe5 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/Criteria.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/Criteria.java
@@ -18,12 +18,16 @@ package org.eclipse.osee.orcs.core.ds;
*/
public class Criteria {
- public void checkValid(Options options) {
- // For subclasses to implement
+ /**
+ * subclasses must return true if the criteria is valid, return false if the criteria is invalid but should be
+ * gracefully ignored; and throw an exception if invalid and should not be ignored
+ */
+ public boolean checkValid(Options options) {
+ return true;
}
@Override
public String toString() {
return getClass().getSimpleName();
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/QueryData.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/QueryData.java
index 9b906f36dcb..37637954668 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/QueryData.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/QueryData.java
@@ -542,8 +542,9 @@ public final class QueryData implements QueryBuilder, HasOptions, HasBranch {
}
private QueryBuilder addAndCheck(Criteria criteria) {
- criteria.checkValid(getOptions());
- addCriteria(criteria);
+ if (criteria.checkValid(getOptions())) {
+ addCriteria(criteria);
+ }
return this;
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationTypeCriteria.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationTypeCriteria.java
index 059c99289f7..bb7ef72b426 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationTypeCriteria.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/RelationTypeCriteria.java
@@ -32,8 +32,9 @@ public class RelationTypeCriteria<R extends RelationTypeToken> extends Criteria
}
@Override
- public void checkValid(Options options) {
+ public boolean checkValid(Options options) {
Conditions.checkValid(relationType, "relation type");
+ return true;
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaArtifactGuids.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaArtifactGuids.java
index b2685004777..d63a19898e1 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaArtifactGuids.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaArtifactGuids.java
@@ -25,16 +25,14 @@ import org.eclipse.osee.orcs.core.ds.Options;
* @author Roberto E. Escobar
*/
public class CriteriaArtifactGuids extends Criteria {
-
private final Collection<String> artifactGuids;
public CriteriaArtifactGuids(Collection<String> artifactGuids) {
- super();
this.artifactGuids = artifactGuids;
}
@Override
- public void checkValid(Options options) {
+ public boolean checkValid(Options options) {
Conditions.checkNotNullOrEmpty(artifactGuids, "artifact guids");
List<String> invalids = new ArrayList<>();
for (String guid : artifactGuids) {
@@ -43,6 +41,7 @@ public class CriteriaArtifactGuids extends Criteria {
}
}
Conditions.checkExpressionFailOnTrue(!invalids.isEmpty(), "Invalid Guids - %s", invalids);
+ return true;
}
public Collection<String> getIds() {
@@ -53,5 +52,4 @@ public class CriteriaArtifactGuids extends Criteria {
public String toString() {
return "CriteriaArtifactGuids [artifactGuids=" + artifactGuids + "]";
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaArtifactIds.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaArtifactIds.java
index 6498e9555ab..f7d2def4e1e 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaArtifactIds.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaArtifactIds.java
@@ -16,6 +16,7 @@ package org.eclipse.osee.orcs.core.ds.criteria;
import java.util.Collection;
import org.eclipse.osee.framework.core.data.ArtifactId;
import org.eclipse.osee.orcs.core.ds.Criteria;
+import org.eclipse.osee.orcs.core.ds.Options;
/**
* @author Roberto E. Escobar
@@ -54,6 +55,11 @@ public class CriteriaArtifactIds extends Criteria {
}
@Override
+ public boolean checkValid(Options options) {
+ return !(hasMultipleIds() && ids.isEmpty());
+ }
+
+ @Override
public String toString() {
return "CriteriaArtifactIds [ids=" + ids + "]";
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaArtifactType.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaArtifactType.java
index d2133ff493c..bcec3923660 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaArtifactType.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaArtifactType.java
@@ -35,8 +35,9 @@ public class CriteriaArtifactType extends Criteria {
}
@Override
- public void checkValid(Options options) {
+ public boolean checkValid(Options options) {
Conditions.checkNotNullOrEmpty(artifactTypes, "artifact types");
+ return true;
}
public Collection<ArtifactTypeToken> getOriginalTypes() {
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAssociatedArtId.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAssociatedArtId.java
index d62e1e1a8c9..74a87559a60 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAssociatedArtId.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAssociatedArtId.java
@@ -22,7 +22,6 @@ import org.eclipse.osee.orcs.core.ds.Options;
* @author John Misinco
*/
public class CriteriaAssociatedArtId extends Criteria implements BranchCriteria {
-
private final ArtifactId associatedArtId;
public CriteriaAssociatedArtId(ArtifactId associatedArtId) {
@@ -34,12 +33,13 @@ public class CriteriaAssociatedArtId extends Criteria implements BranchCriteria
}
@Override
- public void checkValid(Options options) {
+ public boolean checkValid(Options options) {
Conditions.checkExpressionFailOnTrue(associatedArtId.isInvalid(), "Associated artifact id cannot be null");
+ return true;
}
@Override
public String toString() {
return "CriteriaAssociatedArtId [associatedArtId=" + associatedArtId + "]";
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeKeywords.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeKeywords.java
index 2fe49f1ea3b..55beae0d8be 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeKeywords.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeKeywords.java
@@ -29,7 +29,6 @@ import org.eclipse.osee.orcs.core.ds.Options;
* @author Roberto E. Escobar
*/
public class CriteriaAttributeKeywords extends Criteria {
-
private final OrcsTokenService tokenService;
private final Collection<AttributeTypeId> attributeTypes;
private final Collection<String> values;
@@ -37,7 +36,6 @@ public class CriteriaAttributeKeywords extends Criteria {
private final boolean includeAllTypes;
public CriteriaAttributeKeywords(boolean includeAllTypes, Collection<AttributeTypeId> attributeTypes, OrcsTokenService tokenService, Collection<String> values, QueryOption... options) {
- super();
this.includeAllTypes = includeAllTypes;
this.tokenService = tokenService;
this.attributeTypes = attributeTypes;
@@ -66,11 +64,12 @@ public class CriteriaAttributeKeywords extends Criteria {
}
@Override
- public void checkValid(Options options) {
+ public boolean checkValid(Options options) {
Conditions.checkNotNullOrEmpty(getValues(), "search value");
Conditions.checkNotNullOrEmpty(getTypes(), "attribute types");
checkMultipleValues();
checkNotTaggable();
+ return true;
}
@Override
@@ -100,4 +99,4 @@ public class CriteriaAttributeKeywords extends Criteria {
}
}
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeRaw.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeRaw.java
index 70a572f6295..8a3b6414f67 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeRaw.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeRaw.java
@@ -67,7 +67,7 @@ public class CriteriaAttributeRaw extends Criteria {
}
@Override
- public void checkValid(Options options) {
+ public boolean checkValid(Options options) {
Conditions.checkNotNullOrEmptyOrContainNull(getAttributeTypes(), "attributeType");
Conditions.checkExpressionFailOnTrue(getAttributeTypes().equals(QueryBuilder.ANY_ATTRIBUTE_TYPE),
"Any attribute type is not allowed");
@@ -77,6 +77,7 @@ public class CriteriaAttributeRaw extends Criteria {
throw new OseeArgumentException("Invalid QueryOptions present: [%s]",
Collections.toString(",", unsupportedOptions));
}
+ return true;
}
private List<QueryOption> getUnsupportedOptions() {
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeTypeExists.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeTypeExists.java
index b70848274a9..9634ac60bb7 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeTypeExists.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeTypeExists.java
@@ -23,7 +23,6 @@ import org.eclipse.osee.orcs.core.ds.Options;
* @author Roberto E. Escobar
*/
public class CriteriaAttributeTypeExists extends Criteria {
-
private final Collection<AttributeTypeId> attributeTypes;
public CriteriaAttributeTypeExists(Collection<AttributeTypeId> attributeTypes) {
@@ -35,12 +34,13 @@ public class CriteriaAttributeTypeExists extends Criteria {
}
@Override
- public void checkValid(Options options) {
+ public boolean checkValid(Options options) {
Conditions.checkNotNullOrEmpty(getTypes(), "attribute types");
+ return true;
}
@Override
public String toString() {
return "CriteriaAttributeTypeExists [attributeTypes=" + attributeTypes + "]";
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeTypeNotExists.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeTypeNotExists.java
index 14f64b83a73..5249e168ad6 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeTypeNotExists.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaAttributeTypeNotExists.java
@@ -51,8 +51,9 @@ public class CriteriaAttributeTypeNotExists extends Criteria {
}
@Override
- public void checkValid(Options options) {
+ public boolean checkValid(Options options) {
Conditions.checkNotNull(getTypes(), "attribute types");
+ return true;
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchAncestorOf.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchAncestorOf.java
index 8f4d3a9b3bf..aa5c51f9760 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchAncestorOf.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchAncestorOf.java
@@ -22,11 +22,9 @@ import org.eclipse.osee.orcs.core.ds.Options;
* @author Roberto E. Escobar
*/
public class CriteriaBranchAncestorOf extends Criteria implements BranchCriteria {
-
private final BranchId child;
public CriteriaBranchAncestorOf(BranchId child) {
- super();
this.child = child;
}
@@ -35,13 +33,13 @@ public class CriteriaBranchAncestorOf extends Criteria implements BranchCriteria
}
@Override
- public void checkValid(Options options) {
+ public boolean checkValid(Options options) {
Conditions.checkNotNull(getChild(), "Child branch");
+ return true;
}
@Override
public String toString() {
return "CriteriaBranchAncestorOf [child=" + child + "]";
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchChildOf.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchChildOf.java
index 7b12d50bfa1..8c989107dbb 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchChildOf.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchChildOf.java
@@ -22,11 +22,9 @@ import org.eclipse.osee.orcs.core.ds.Options;
* @author Roberto E. Escobar
*/
public class CriteriaBranchChildOf extends Criteria implements BranchCriteria {
-
private final BranchId parent;
public CriteriaBranchChildOf(BranchId parent) {
- super();
this.parent = parent;
}
@@ -35,13 +33,13 @@ public class CriteriaBranchChildOf extends Criteria implements BranchCriteria {
}
@Override
- public void checkValid(Options options) {
+ public boolean checkValid(Options options) {
Conditions.checkNotNull(getParent(), "Parent branch");
+ return true;
}
@Override
public String toString() {
return "CriteriaBranchChildOf [parent=" + parent + "]";
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchName.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchName.java
index 6ee4f0980b4..7949224667b 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchName.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaBranchName.java
@@ -21,13 +21,11 @@ import org.eclipse.osee.orcs.core.ds.Options;
* @author Roberto E. Escobar
*/
public class CriteriaBranchName extends Criteria implements BranchCriteria {
-
private final boolean isPattern;
private final boolean isPatternIgnoreCase;
private final String value;
public CriteriaBranchName(String value, boolean isPattern, boolean isPatternIgnoreCase) {
- super();
this.value = value;
this.isPattern = isPattern;
this.isPatternIgnoreCase = isPatternIgnoreCase;
@@ -42,8 +40,9 @@ public class CriteriaBranchName extends Criteria implements BranchCriteria {
}
@Override
- public void checkValid(Options options) {
+ public boolean checkValid(Options options) {
Conditions.checkNotNullOrEmpty(getValue(), "branch name value");
+ return true;
}
@Override
@@ -54,5 +53,4 @@ public class CriteriaBranchName extends Criteria implements BranchCriteria {
public boolean isPatternIgnoreCase() {
return isPatternIgnoreCase;
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaDateRange.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaDateRange.java
index bb400aea87a..dd943f2fbdc 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaDateRange.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaDateRange.java
@@ -22,20 +22,19 @@ import org.eclipse.osee.orcs.core.ds.Options;
* @author Roberto E. Escobar
*/
public class CriteriaDateRange extends Criteria implements TxCriteria {
-
private final Timestamp from, to;
public CriteriaDateRange(Timestamp from, Timestamp to) {
- super();
this.from = from;
this.to = to;
}
@Override
- public void checkValid(Options options) {
+ public boolean checkValid(Options options) {
if (from.after(to)) {
throw new OseeArgumentException("from date must be less than to date");
}
+ return true;
}
public Timestamp getTo() {
@@ -50,4 +49,4 @@ public class CriteriaDateRange extends Criteria implements TxCriteria {
public String toString() {
return "CriteriaDateRange [from=" + from + " to=" + to + "]";
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaMainTableField.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaMainTableField.java
index 2bef5d14784..39807d599ef 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaMainTableField.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaMainTableField.java
@@ -39,8 +39,9 @@ public class CriteriaMainTableField extends Criteria {
}
@Override
- public void checkValid(Options options) {
+ public boolean checkValid(Options options) {
Conditions.checkNotNullOrEmpty(values, "main table field values");
+ return true;
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaMergeBranchFor.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaMergeBranchFor.java
index 8aab66346aa..d998c416e38 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaMergeBranchFor.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaMergeBranchFor.java
@@ -22,12 +22,10 @@ import org.eclipse.osee.orcs.core.ds.Options;
* @author John Misinco
*/
public class CriteriaMergeBranchFor extends Criteria implements BranchCriteria {
-
private final BranchId source;
private final BranchId destination;
public CriteriaMergeBranchFor(BranchId source, BranchId destination) {
- super();
this.source = source;
this.destination = destination;
}
@@ -41,13 +39,14 @@ public class CriteriaMergeBranchFor extends Criteria implements BranchCriteria {
}
@Override
- public void checkValid(Options options) {
+ public boolean checkValid(Options options) {
Conditions.checkExpressionFailOnTrue(source == null, "Source Uuid cannot be null");
Conditions.checkExpressionFailOnTrue(destination == null, "Destination Uuid cannot be null");
+ return true;
}
@Override
public String toString() {
return "CriteriaMergeBranchFor [source=" + source + ", destination=" + destination + "]";
}
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaRelatedTo.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaRelatedTo.java
index d0ef3131868..8876179f1b1 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaRelatedTo.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaRelatedTo.java
@@ -50,6 +50,7 @@ public class CriteriaRelatedTo extends RelationTypeCriteria<RelationTypeSide> {
}
@Override
+ return true;
public String toString() {
return "CriteriaRelatedTo [relationTypeSide=" + getType() + ", artifactIds=" + artifactIds + "]";
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaRelationTypeNotExists.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaRelationTypeNotExists.java
index ee440848ed0..85e69d934a5 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaRelationTypeNotExists.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaRelationTypeNotExists.java
@@ -24,4 +24,5 @@ public final class CriteriaRelationTypeNotExists extends RelationTypeCriteria<Re
public CriteriaRelationTypeNotExists(RelationTypeToken relationType) {
super(relationType);
}
+ return true;
} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxComment.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxComment.java
index 3f858f2d618..78ee754debd 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxComment.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxComment.java
@@ -40,13 +40,13 @@ public class CriteriaTxComment extends Criteria implements TxCriteria {
}
@Override
- public void checkValid(Options options) {
+ public boolean checkValid(Options options) {
Conditions.checkNotNullOrEmpty(getValue(), "comment value");
+ return true;
}
@Override
public String toString() {
return "CriteriaTxComment [isPattern=" + isPattern + ", value=" + value + "]";
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxGetPrior.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxGetPrior.java
index 61286f162fe..0fcc8ee8b3f 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxGetPrior.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/ds/criteria/CriteriaTxGetPrior.java
@@ -34,9 +34,9 @@ public class CriteriaTxGetPrior extends Criteria implements TxCriteria {
}
@Override
- public void checkValid(Options options) {
- super.checkValid(options);
+ public boolean checkValid(Options options) {
Conditions.checkExpressionFailOnTrue(txId.isInvalid(), "TxId [%s] is invalid. Must be >= 0", txId);
+ return true;
}
@Override
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryBuilderImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryBuilderImpl.java
index 0127925a8ae..802cb1f6b9a 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryBuilderImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/BranchQueryBuilderImpl.java
@@ -167,8 +167,9 @@ public class BranchQueryBuilderImpl<T> implements BranchQueryBuilder<T> {
@SuppressWarnings("unchecked")
private T addAndCheck(QueryData queryData, Criteria criteria) {
- criteria.checkValid(getOptions());
- queryData.addCriteria(criteria);
+ if (criteria.checkValid(getOptions())) {
+ queryData.addCriteria(criteria);
+ }
return (T) this;
}
diff --git a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TxQueryBuilderImpl.java b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TxQueryBuilderImpl.java
index 1af62f8bd7b..19cf86635a2 100644
--- a/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TxQueryBuilderImpl.java
+++ b/plugins/org.eclipse.osee.orcs.core/src/org/eclipse/osee/orcs/core/internal/search/TxQueryBuilderImpl.java
@@ -155,8 +155,9 @@ public class TxQueryBuilderImpl<T> implements TxQueryBuilder<T> {
@SuppressWarnings("unchecked")
private T addAndCheck(QueryData queryData, Criteria criteria) {
- criteria.checkValid(getOptions());
- queryData.addCriteria(criteria);
+ if (criteria.checkValid(getOptions())) {
+ queryData.addCriteria(criteria);
+ }
return (T) this;
}

Back to the top