summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorAdam Dudas2013-04-29 14:21:34 (EDT)
committer bergmann2013-04-30 07:53:24 (EDT)
commitc7f113c204d692b0ef1d8e576746f3be0d128c62 (patch)
treeb1423d43bb6898d176e1207cd1aa041d2bc343ec
parent22588add9e65e827b7c7d4584792700dbf33b4bb (diff)
downloadorg.eclipse.incquery-c7f113c204d692b0ef1d8e576746f3be0d128c62.zip
org.eclipse.incquery-c7f113c204d692b0ef1d8e576746f3be0d128c62.tar.gz
org.eclipse.incquery-c7f113c204d692b0ef1d8e576746f3be0d128c62.tar.bz2
fix logical operator (change || to &&)
The related error message describes the desired condition well. It says "Upper bound of feature %s should be -1 or larger than 1 for many 'kind'.", which translates to (upperBound == -1 || upperBound > 1) If this logical expression is false then we have an error. More formally if !(upperBound == -1 || upperBound > 1) then error, which is equivalent to if (upperBound != -1 && upperBound < 2) then error for integer values.
-rw-r--r--plugins/org.eclipse.incquery.querybasedfeatures.runtime/src/org/eclipse/incquery/querybasedfeatures/runtime/util/validation/QueryBasedFeaturePatternValidator.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/org.eclipse.incquery.querybasedfeatures.runtime/src/org/eclipse/incquery/querybasedfeatures/runtime/util/validation/QueryBasedFeaturePatternValidator.java b/plugins/org.eclipse.incquery.querybasedfeatures.runtime/src/org/eclipse/incquery/querybasedfeatures/runtime/util/validation/QueryBasedFeaturePatternValidator.java
index dba8eef..78baae8 100644
--- a/plugins/org.eclipse.incquery.querybasedfeatures.runtime/src/org/eclipse/incquery/querybasedfeatures/runtime/util/validation/QueryBasedFeaturePatternValidator.java
+++ b/plugins/org.eclipse.incquery.querybasedfeatures.runtime/src/org/eclipse/incquery/querybasedfeatures/runtime/util/validation/QueryBasedFeaturePatternValidator.java
@@ -186,7 +186,7 @@ public class QueryBasedFeaturePatternValidator implements IPatternAnnotationAddi
}
kind = QueryBasedFeatureKind.SINGLE_REFERENCE;
} else if (QueryBasedFeatureKind.getStringValue(QueryBasedFeatureKind.MANY_REFERENCE).equals(kindStr)) {
- if (feature.getUpperBound() != -1 || feature.getUpperBound() < 2) {
+ if (feature.getUpperBound() != -1 && feature.getUpperBound() < 2) {
validator.error(String
.format("Upper bound of feature %s should be -1 or larger than 1 for many 'kind'.",
featureName), ref, PatternLanguagePackage.Literals.STRING_VALUE__VALUE,