summaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorInstrumental <jonathan.gathman@att.com>2018-07-02 09:40:49 -0500
committerInstrumental <jonathan.gathman@att.com>2018-07-02 09:41:03 -0500
commitc060284812fbbc18fcf22eb628c47c251505fe50 (patch)
tree6f8b8bc7d58667fd711dc913c2fa4a9d111a75ba /misc
parent2c0dd5c5136e249f63f1d3296063795cde30c399 (diff)
Update CM to us Local Intermediate Certs
Issue-ID: AAF-384 Change-Id: Iefd36c5b9ab8011ac696cb85e74c54edb63cb40a Signed-off-by: Instrumental <jonathan.gathman@att.com>
Diffstat (limited to 'misc')
-rw-r--r--misc/env/src/main/java/org/onap/aaf/misc/env/util/Split.java13
1 files changed, 13 insertions, 0 deletions
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) {