diff options
author | Arundathi Patil <arundpil@in.ibm.com> | 2018-11-20 16:15:34 +0530 |
---|---|---|
committer | IBM602-PC0F1E3C\Arundathi <arundpil@in.ibm.com> | 2018-11-20 16:15:47 +0530 |
commit | 4f44dd6904551dd79d6e5a3e5ecc6747bb6aad2e (patch) | |
tree | b827f4a0d7b6a82b0c0c90230b65bd3067a2ad4e /auth/auth-cmd/src/main | |
parent | 5ecadc6efb0c37f7d73b43bf57706200635aadf9 (diff) |
Sonar Fix: Cmd.java
Fixed sonar issues/code-smells across this file.
Issue-ID: AAF-637
Change-Id: I5a4bd3954952335284095b09aeb2dac8e445e4ec
Signed-off-by: Arundathi Patil <arundpil@in.ibm.com>
Diffstat (limited to 'auth/auth-cmd/src/main')
-rw-r--r-- | auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/Cmd.java | 36 |
1 files changed, 19 insertions, 17 deletions
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<Cmd> children; - private final static ConcurrentHashMap<Class<?>,RosettaDF<?>> dfs = new ConcurrentHashMap<>(); + private static final ConcurrentHashMap<Class<?>,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<indent;++i)sb.append(' '); - for (int i=indent;i<length;++i)sb.append(c); + for (int i=0;i<indent;++i) { + sb.append(' '); + } + for (int i=indent;i<length;++i) { + sb.append(c); + } } public StringBuilder build(StringBuilder sb, StringBuilder detail) { @@ -185,7 +189,7 @@ public abstract class Cmd { multiChar(sb,indent,' ',0); } else { // Write parents for Detailed Report - Stack<String> stack = new Stack<String>(); + Stack<String> 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<lineLength;++i)pw().print('-'); + for (int i=0;i<lineLength;++i) { + pw().print('-'); + } pw().println(); pw().format(hformat,"Date","Table","User","Memo"); - for (int i=0;i<lineLength;++i)pw().print('-'); + for (int i=0;i<lineLength;++i) { + pw().print('-'); + } pw().println(); // Save Server time by Sorting locally @@ -406,10 +414,6 @@ public abstract class Cmd { throw new CadiException(build(new StringBuilder("Invalid Option: "),null).toString()); } -// protected RosettaEnv env() { -// return aafcli.env; -// } - protected HMangr hman() { return aafcli.hman; } @@ -475,7 +479,9 @@ public abstract class Cmd { } public void reportLine() { - for (int i=0;i<lineLength;++i)pw().print('-'); + for (int i=0;i<lineLength;++i) { + pw().print('-'); + } pw().println(); } @@ -520,11 +526,7 @@ public abstract class Cmd { return parent.toString(); } } - -// private String getOrgRealm() { -// return ; -// } -// + /** * Appends shortID with Realm, but only when allowed by Organization * @throws OrganizationException |