From c060284812fbbc18fcf22eb628c47c251505fe50 Mon Sep 17 00:00:00 2001 From: Instrumental Date: Mon, 2 Jul 2018 09:40:49 -0500 Subject: Update CM to us Local Intermediate Certs Issue-ID: AAF-384 Change-Id: Iefd36c5b9ab8011ac696cb85e74c54edb63cb40a Signed-off-by: Instrumental --- .../env/src/main/java/org/onap/aaf/misc/env/util/Split.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'misc') diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/util/Split.java b/misc/env/src/main/java/org/onap/aaf/misc/env/util/Split.java index 57e60091..efb68120 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/util/Split.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/util/Split.java @@ -30,7 +30,13 @@ package org.onap.aaf.misc.env.util; */ public class Split { + private static final String[] BLANK = new String[0]; + public static String[] split(char c, String value) { + if(value==null) { + return BLANK; + } + // Count items to preallocate Array (memory alloc is more expensive than counting twice) int count,idx; for(count=1,idx=value.indexOf(c);idx>=0;idx=value.indexOf(c,++idx),++count); @@ -50,6 +56,9 @@ public class Split { } public static String[] splitTrim(char c, String value) { + if(value==null) { + return BLANK; + } // Count items to preallocate Array (memory alloc is more expensive than counting twice) int count,idx; for(count=1,idx=value.indexOf(c);idx>=0;idx=value.indexOf(c,++idx),++count); @@ -69,6 +78,10 @@ public class Split { } public static String[] splitTrim(char c, String value, int size) { + if(value==null) { + return BLANK; + } + int idx; String[] rv = new String[size]; if(size==1) { -- cgit 1.2.3-korg