From f85f0889b3b0e5e9694afab4dd01a4a97a155188 Mon Sep 17 00:00:00 2001 From: Instrumental Date: Tue, 3 Jul 2018 07:51:17 -0500 Subject: Collection syntax change because of Sonar Issue-ID: AAF-386 Change-Id: I8ba8d8561d03e680ddc90a81b8db0339814c65fa Signed-off-by: Instrumental --- auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java | 6 +++--- auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/BaseCmd.java | 4 ++-- auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/Cmd.java | 4 ++-- .../src/main/java/org/onap/aaf/auth/cmd/ns/ListUsersContact.java | 2 +- .../src/main/java/org/onap/aaf/auth/cmd/ns/ListUsersInRole.java | 2 +- .../src/main/java/org/onap/aaf/auth/cmd/ns/ListUsersWithPerm.java | 2 +- .../src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_List.java | 8 ++++---- .../src/test/java/org/onap/aaf/auth/cmd/test/role/JU_List.java | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) (limited to 'auth/auth-cmd') diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java index 7e25084d..1a60f68b 100644 --- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java +++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/AAFcli.java @@ -69,7 +69,7 @@ public class AAFcli { private List cmds; // Lex State - private ArrayList expect = new ArrayList(); + private ArrayList expect = new ArrayList<>(); private boolean verbose = true; private int delay; private SecurityInfoC si; @@ -113,7 +113,7 @@ public class AAFcli { /* * Create Cmd Tree */ - cmds = new ArrayList(); + cmds = new ArrayList<>(); Role role = new Role(this); cmds.add(new Help(this, cmds)); @@ -358,7 +358,7 @@ public class AAFcli { private String[] argEval(String line) { StringBuilder sb = new StringBuilder(); - ArrayList arr = new ArrayList(); + ArrayList arr = new ArrayList<>(); boolean start = true; char quote = 0; char last = 0; diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/BaseCmd.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/BaseCmd.java index 0bfefd21..7079fed7 100644 --- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/BaseCmd.java +++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/BaseCmd.java @@ -34,12 +34,12 @@ public class BaseCmd extends Cmd { public BaseCmd(AAFcli aafcli, String name, Param ... params) { super(aafcli, null, name, params); - cmds = new ArrayList(); + cmds = new ArrayList<>(); } public BaseCmd(CMD parent, String name, Param ... params) { super(parent.aafcli, parent, name, params); - cmds = new ArrayList(); + cmds = new ArrayList<>(); } 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 7f41650d..71643cd0 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 @@ -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,RosettaDF>(); + private final static ConcurrentHashMap,RosettaDF> dfs = new ConcurrentHashMap<>(); public final AAFcli aafcli; protected Access access; private AuthzEnv env; @@ -95,7 +95,7 @@ public abstract class Cmd { if(parent!=null) { parent.children.add(this); } - children = new ArrayList(); + children = new ArrayList<>(); this.params = params; this.name = name; required=0; diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListUsersContact.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListUsersContact.java index 1c988e30..01017e03 100644 --- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListUsersContact.java +++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListUsersContact.java @@ -67,7 +67,7 @@ public class ListUsersContact extends Cmd { Future fn = client.read("/authz/nss/"+ns,getDF(Nss.class)); if(fn.get(AAFcli.timeout())) { if(fn.value!=null) { - Set uset = detail?null:new HashSet(); + Set uset = detail?null:new HashSet<>(); for(Ns n : fn.value.getNs()) { Future fr = client.read("/authz/roles/ns/"+n.getName(), getDF(Roles.class)); if(fr.get(AAFcli.timeout())) { diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListUsersInRole.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListUsersInRole.java index 2ee8bd2c..e49a6e97 100644 --- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListUsersInRole.java +++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListUsersInRole.java @@ -67,7 +67,7 @@ public class ListUsersInRole extends Cmd { Future fn = client.read("/authz/nss/"+ns,getDF(Nss.class)); if(fn.get(AAFcli.timeout())) { if(fn.value!=null) { - Set uset = detail?null:new HashSet(); + Set uset = detail?null:new HashSet<>(); for(Ns n : fn.value.getNs()) { Future fr = client.read("/authz/roles/ns/"+n.getName(), getDF(Roles.class)); if(fr.get(AAFcli.timeout())) { diff --git a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListUsersWithPerm.java b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListUsersWithPerm.java index 97ccf569..1a4ed7a7 100644 --- a/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListUsersWithPerm.java +++ b/auth/auth-cmd/src/main/java/org/onap/aaf/auth/cmd/ns/ListUsersWithPerm.java @@ -67,7 +67,7 @@ public class ListUsersWithPerm extends Cmd { Future fn = client.read("/authz/nss/"+ns,getDF(Nss.class)); if(fn.get(AAFcli.timeout())) { if(fn.value!=null) { - Set uset = detail?null:new HashSet(); + Set uset = detail?null:new HashSet<>(); for(Ns n : fn.value.getNs()) { Future fp = client.read("/authz/perms/ns/"+n.getName()+(aafcli.isDetailed()?"?ns":"") diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_List.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_List.java index 3edce8de..a6d2130f 100644 --- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_List.java +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/ns/JU_List.java @@ -61,7 +61,7 @@ public class JU_List { private class NssStub extends Nss { public void addNs(Nss.Ns ns) { if (this.ns == null) { - this.ns = new ArrayList(); + this.ns = new ArrayList<>(); } this.ns.add(ns); } @@ -69,21 +69,21 @@ public class JU_List { private class NsStub extends Ns{ public void addAttrib(Nss.Ns.Attrib attrib) { if ( this.attrib == null) { - this.attrib = new ArrayList(); + this.attrib = new ArrayList<>(); } this.attrib.add(attrib); } public void addResponsible(String str) { if (this.responsible == null) { - this.responsible = new ArrayList(); + this.responsible = new ArrayList<>(); } this.responsible.add(str); } public void addAdmin(String str) { if (this.admin == null) { - this.admin = new ArrayList(); + this.admin = new ArrayList<>(); } this.admin.add(str); } diff --git a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_List.java b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_List.java index 0c85fc3c..84b3caa9 100644 --- a/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_List.java +++ b/auth/auth-cmd/src/test/java/org/onap/aaf/auth/cmd/test/role/JU_List.java @@ -87,7 +87,7 @@ public class JU_List { private class RolesStub extends Roles { public void addRole(aaf.v2_0.Role role) { if (this.role == null) { - this.role = new ArrayList(); + this.role = new ArrayList<>(); } this.role.add(role); } @@ -97,7 +97,7 @@ public class JU_List { public void addPerms(Pkey perms) { if (this.perms == null) { - this.perms = new ArrayList(); + this.perms = new ArrayList<>(); } this.perms.add(perms); } -- cgit 1.2.3-korg