From f53bd707d8583122bd3d57fad022bfa564d390cb Mon Sep 17 00:00:00 2001 From: markiantorno Date: Wed, 22 Apr 2020 10:02:56 -0400 Subject: [PATCH] Fix for array index out of bounds exception on adding profile for validation. --- .../main/java/org/hl7/fhir/validation/cli/Params.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/Params.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/Params.java index db38fe50f..115b51397 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/Params.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/cli/Params.java @@ -92,18 +92,19 @@ public class Params { i++; // ignore next parameter } else if (args[i].equals(PROFILE)) { String p = null; - if (i + 1 == args.length) + if (i + 1 == args.length) { throw new Error("Specified -profile without indicating profile source"); - else { + } else { p = args[++i]; - cliContext.addProfile(args[++i]); + cliContext.addProfile(args[i++]); } if (p != null && i + 1 < args.length && args[i + 1].equals("@")) { i++; - if (i + 1 == args.length) + if (i + 1 == args.length) { throw new Error("Specified -profile with @ without indicating profile location"); - else + } else { cliContext.addLocation(p, args[++i]); + } } } else if (args[i].equals(QUESTIONNAIRE)) { if (i + 1 == args.length)