From cb0759cc004445bf511f17a9a177df2282d68849 Mon Sep 17 00:00:00 2001 From: Grahame Grieve Date: Fri, 18 Oct 2024 20:50:26 +0800 Subject: [PATCH] fix npe in server auth functionality --- .../org/hl7/fhir/utilities/Utilities.java | 21 +++++++++++++++++++ .../org/hl7/fhir/validation/ValidatorCli.java | 1 + 2 files changed, 22 insertions(+) diff --git a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java index 4042ee2f1..f348488ae 100644 --- a/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java +++ b/org.hl7.fhir.utilities/src/main/java/org/hl7/fhir/utilities/Utilities.java @@ -722,6 +722,27 @@ public class Utilities { return s.toString(); } + public static String javaTokenize(String cs, boolean capFirst) { + if (cs == null) + return ""; + StringBuilder s = new StringBuilder(); + boolean upcase = capFirst; + for (int i = 0; i < cs.length(); i++) { + char c = cs.charAt(i); + if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_') { + if (upcase) { + s.append(Character.toUpperCase(c)); + upcase = false; + } else { + s.append(c); + } + } else { + upcase = true; + } + } + return s.toString(); + } + public static boolean isToken(String tail) { if (tail == null || tail.length() == 0) diff --git a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java index 86b461fbe..3684923b3 100644 --- a/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java +++ b/org.hl7.fhir.validation/src/main/java/org/hl7/fhir/validation/ValidatorCli.java @@ -135,6 +135,7 @@ public class ValidatorCli { new TxTestsTask(), new TransformTask(), new VersionTask(), + new CodeGenTask(), defaultCliTask); }