From c87a3bf443d1d71389da4cda76adbddcac26e7a2 Mon Sep 17 00:00:00 2001 From: efiacor Date: Tue, 16 Jul 2019 09:49:13 +0000 Subject: Even more unit test and code cleanup Change-Id: Ide9477f5f8856e4ab35864bdc93d27a2d59afc83 Issue-ID: DMAAP-1226 Signed-off-by: efiacor --- .../src/main/java/org/onap/dmaap/datarouter/node/ProvData.java | 5 ++++- .../src/main/java/org/onap/dmaap/datarouter/node/TaskList.java | 10 +++++----- .../java/org/onap/dmaap/datarouter/node/eelf/AuditFilter.java | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'datarouter-node/src/main/java/org') diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/ProvData.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/ProvData.java index c436076f..03e952c1 100644 --- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/ProvData.java +++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/ProvData.java @@ -152,7 +152,7 @@ public class ProvData { } /** - * Get the raw node configuration entries + * Get the raw node configuration entries. */ public NodeConfig.ProvNode[] getNodes() { return (pn); @@ -333,6 +333,9 @@ public class ProvData { if (jnodes != null) { for (int nx = 0; nx < jnodes.length(); nx++) { String nn = gvas(jnodes, nx); + if (nn == null) { + continue; + } if (nn.indexOf('.') == -1) { nn = nn + "." + sfx; } diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/TaskList.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/TaskList.java index 7fa0dc4d..a77277f2 100644 --- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/TaskList.java +++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/TaskList.java @@ -38,7 +38,7 @@ import java.util.Iterator; * called. * */ -public class TaskList { +class TaskList { private Iterator runlist; private HashSet tasks = new HashSet<>(); @@ -50,7 +50,7 @@ public class TaskList { /** * Start executing the sequence of tasks. */ - public synchronized void startRun() { + synchronized void startRun() { sofar = new HashSet<>(); added = new HashSet<>(); removed = new HashSet<>(); @@ -61,7 +61,7 @@ public class TaskList { /** * Get the next task to execute. */ - public synchronized Runnable next() { + synchronized Runnable next() { while (runlist != null) { if (runlist.hasNext()) { Runnable task = runlist.next(); @@ -88,7 +88,7 @@ public class TaskList { /** * Add a task to the list of tasks to run whenever the event occurs. */ - public synchronized void addTask(Runnable task) { + synchronized void addTask(Runnable task) { if (runlist != null) { added.add(task); removed.remove(task); @@ -99,7 +99,7 @@ public class TaskList { /** * Remove a task from the list of tasks to run whenever the event occurs. */ - public synchronized void removeTask(Runnable task) { + synchronized void removeTask(Runnable task) { if (runlist != null) { removed.add(task); added.remove(task); diff --git a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/eelf/AuditFilter.java b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/eelf/AuditFilter.java index 33103db5..a278c2e3 100644 --- a/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/eelf/AuditFilter.java +++ b/datarouter-node/src/main/java/org/onap/dmaap/datarouter/node/eelf/AuditFilter.java @@ -17,9 +17,9 @@ * SPDX-License-Identifier: Apache-2.0 * ============LICENSE_END========================================================= */ + package org.onap.dmaap.datarouter.node.eelf; -import ch.qos.logback.classic.Level; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.filter.Filter; import ch.qos.logback.core.spi.FilterReply; -- cgit 1.2.3-korg