From 185587ea94f38ea729a0416ba029297ecb8da324 Mon Sep 17 00:00:00 2001 From: shalomb Date: Wed, 15 Nov 2017 09:22:34 +0200 Subject: Casandra data center and consistency level fix null check Change-Id: If1b541c3cacf0040cc13c6e1d57dd9fd854623e9 Issue-Id:SDC-656 Signed-off-by: shalomb --- .../java/org/openecomp/core/nosqldb/util/ConfigurationManager.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'openecomp-be/lib/openecomp-core-lib') diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java index 80adeb6e2a..fd7c1043e8 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java @@ -112,10 +112,13 @@ public class ConfigurationManager { public String[] getAddresses() { String addresses = System.getProperty(CASSANDRA_ADDRESSES); - if (Objects.isNull(addresses)) { + if (Objects.nonNull(addresses)) { return addresses.split(","); } List lsAddresses = (ArrayList) cassandraConfiguration.get(CASSANDRA_HOSTS_KEY); + if (Objects.isNull(addresses) || addresses.length() == 0) { + throw new RuntimeException("Missing Cassandra hose.Cassandra host missing is mandatory."); + } String[] addressesArray; addressesArray = (String[]) lsAddresses.toArray(new String[lsAddresses.size()]); return addressesArray; -- cgit 1.2.3-korg