summaryrefslogtreecommitdiffstats
path: root/catalog-model/src/main/java
diff options
context:
space:
mode:
authorJvD_Ericsson <jeff.van.dam@est.tech>2023-01-17 11:13:45 +0000
committerMichael Morris <michael.morris@est.tech>2023-01-24 10:05:41 +0000
commitbd98d1022cac4cd0aaa6827b8eb4b7772b2fc033 (patch)
treeeeb8ae7239ca81ddbb4b56485f9090fc51657b3d /catalog-model/src/main/java
parentf6b1fff5f297765305c17b1c6bdf540132232233 (diff)
Error creating in_range constraint for non integer properties
Issue-ID: SDC-4334 Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech> Change-Id: I5474eb29e1a8100aeb85bd96b5f6752331aa11f2
Diffstat (limited to 'catalog-model/src/main/java')
-rw-r--r--catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java
index f6bcf1bc8e..d5f7ccbcbb 100644
--- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java
+++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/operations/impl/PropertyOperation.java
@@ -2197,8 +2197,8 @@ public class PropertyOperation extends AbstractOperation implements IPropertyOpe
Object minValue = rangeArray.get(0);
Object maxValue = rangeArray.get(1);
InRangeConstraint rangeConstraint = new InRangeConstraint(Lists.newArrayList(minValue, maxValue));
- rangeConstraint.setMin(convertToComparable(ToscaType.RANGE, String.valueOf(minValue)));
- rangeConstraint.setMax(convertToComparable(ToscaType.RANGE, String.valueOf(maxValue)));
+ rangeConstraint.setMin(String.valueOf(minValue));
+ rangeConstraint.setMax(String.valueOf(maxValue));
propertyConstraint = rangeConstraint;
}
} else {
@@ -2318,9 +2318,6 @@ public class PropertyOperation extends AbstractOperation implements IPropertyOpe
if (je.isBoolean()) {
return je.getAsBoolean();
}
- if (je.isString()) {
- return je.getAsString();
- }
if (je.isNumber()) {
double number = je.getAsNumber().floatValue();
if ((number % 1) == 0) {
@@ -2328,6 +2325,9 @@ public class PropertyOperation extends AbstractOperation implements IPropertyOpe
}
return number;
}
+ if (je.isString()) {
+ return je.getAsString();
+ }
return null;
}
}
@@ -2442,8 +2442,8 @@ public class PropertyOperation extends AbstractOperation implements IPropertyOpe
String minValue = rangeArray.get(0).asText();
String maxValue = rangeArray.get(1).asText();
InRangeConstraint rangeConstraint = new InRangeConstraint(Lists.newArrayList(minValue, maxValue));
- rangeConstraint.setMin(convertToComparable(ToscaType.RANGE, minValue));
- rangeConstraint.setMax(convertToComparable(ToscaType.RANGE, maxValue));
+ rangeConstraint.setMin(minValue);
+ rangeConstraint.setMax(maxValue);
return rangeConstraint;
}
}