From 4f44dd6904551dd79d6e5a3e5ecc6747bb6aad2e Mon Sep 17 00:00:00 2001 From: Arundathi Patil Date: Tue, 20 Nov 2018 16:15:34 +0530 Subject: Sonar Fix: Cmd.java Fixed sonar issues/code-smells across this file. Issue-ID: AAF-637 Change-Id: I5a4bd3954952335284095b09aeb2dac8e445e4ec Signed-off-by: Arundathi Patil --- .../src/main/java/org/onap/aaf/auth/cmd/Cmd.java | 36 ++++++++++++---------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'auth/auth-cmd/src') diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/Cmd.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/Cmd.java index 3a0c869b..0597640f 100644 --- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/Cmd.java +++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/Cmd.java @@ -63,7 +63,7 @@ public abstract class Cmd { protected static final int lineLength = 80; - private final static String hformat = "%-23s %-5s %-20s %-35s\n"; + private static final String hformat = "%-23s %-5s %-20s %-35s\n"; public static final String STARTDATE = "startdate"; public static final String ENDDATE = "enddate"; @@ -73,7 +73,7 @@ public abstract class Cmd { private int required; protected final Cmd parent; protected final List children; - private final static ConcurrentHashMap,RosettaDF> dfs = new ConcurrentHashMap<>(); + private static final ConcurrentHashMap,RosettaDF> dfs = new ConcurrentHashMap<>(); public final AAFcli aafcli; protected Access access; private AuthzEnv env; @@ -156,8 +156,12 @@ public abstract class Cmd { protected void multiChar(StringBuilder sb, int length, char c, int indent) { sb.append('\n'); - for (int i=0;i stack = new Stack(); + Stack stack = new Stack<>(); for (Cmd c = child.parent;c!=null;c=c.parent) { if (c.name!=null) { stack.push(c.name); @@ -341,11 +345,15 @@ public abstract class Cmd { } } else { pw().println(header); - for (int i=0;i