summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorPavel Aharoni <pa0916@att.com>2017-09-27 10:18:38 +0300
committerPavel Aharoni <pa0916@att.com>2017-09-27 10:21:52 +0300
commitf7cc6a3e9bf206b6500da5519f0abad8bf997fe7 (patch)
treed16ae6896df5cbf617f8586894c96b46c724a54f /src/main
parenteec33fb03652c0421e83052de60ec95e18e3382b (diff)
[SDC-402] TDP 335705 test fix
Change-Id: Ia9a72c70fe084bba250da316bc9d4d443c010c79 Signed-off-by: Pavel Aharoni <pa0916@att.com>
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetInput.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetInput.java b/src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetInput.java
index 14b0d4e..0c96b0f 100644
--- a/src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetInput.java
+++ b/src/main/java/org/openecomp/sdc/toscaparser/api/functions/GetInput.java
@@ -73,9 +73,14 @@ public class GetInput extends Function {
}
}
if(inputDef != null) {
- if (args.size() == 2 && args.get(1) instanceof Integer) {
- if (inputDef.getDefault() != null && inputDef.getDefault() instanceof ArrayList) {
+ if (args.size() == 2 && inputDef.getDefault() != null && inputDef.getDefault() instanceof ArrayList){
+ if ( args.get(1) instanceof Integer
+ && ((ArrayList) inputDef.getDefault()).size()> ((Integer)args.get(1)).intValue()) {
return ((ArrayList) inputDef.getDefault()).get(((Integer)args.get(1)).intValue());
+ }else{
+ ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE274",(String.format(
+ "GetInputError: cannot resolve input Def name \"%s\", the expected structure is an argument with a name of input type list and a second argument with an index in the list", args.get(0)))));
+ return null;
}
}
return inputDef.getDefault();