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-gui/src/main/java/org/onap/aaf/auth/gui/Page.java | 4 ++-- .../src/main/java/org/onap/aaf/auth/gui/pages/ApiDocs.java | 12 ++++++------ .../java/org/onap/aaf/auth/gui/pages/CMArtifactShow.java | 2 +- .../main/java/org/onap/aaf/auth/gui/pages/CredDetail.java | 12 ++++++------ .../src/main/java/org/onap/aaf/auth/gui/pages/NsDetail.java | 6 +++--- .../src/main/java/org/onap/aaf/auth/gui/pages/NsHistory.java | 2 +- .../src/main/java/org/onap/aaf/auth/gui/pages/NssShow.java | 2 +- .../org/onap/aaf/auth/gui/pages/PendingRequestsShow.java | 2 +- .../main/java/org/onap/aaf/auth/gui/pages/PermDetail.java | 2 +- .../main/java/org/onap/aaf/auth/gui/pages/PermGrantForm.java | 2 +- .../main/java/org/onap/aaf/auth/gui/pages/PermHistory.java | 2 +- .../src/main/java/org/onap/aaf/auth/gui/pages/PermsShow.java | 2 +- .../main/java/org/onap/aaf/auth/gui/pages/RequestDetail.java | 2 +- .../main/java/org/onap/aaf/auth/gui/pages/RoleDetail.java | 2 +- .../java/org/onap/aaf/auth/gui/pages/RoleDetailAction.java | 2 +- .../main/java/org/onap/aaf/auth/gui/pages/RoleHistory.java | 2 +- 16 files changed, 29 insertions(+), 29 deletions(-) (limited to 'auth/auth-gui/src/main/java') diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Page.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Page.java index 436b37a0..346c8ae2 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Page.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/Page.java @@ -83,7 +83,7 @@ public class Page extends HTMLCacheGen { public final boolean no_cache; // Note: Only access is synchronized in "getPerm" - private final static Map> perms = new HashMap>(); + private final static Map> perms = new HashMap<>(); public String name() { return bcName; @@ -379,7 +379,7 @@ public class Page extends HTMLCacheGen { Map msp = perms.get(instance); Permission p; if(msp==null) { - msp = new HashMap(); + msp = new HashMap<>(); perms.put(instance, msp); p=null; } else { diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApiDocs.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApiDocs.java index 40d57c95..95aa0525 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApiDocs.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/ApiDocs.java @@ -161,12 +161,12 @@ public class ApiDocs extends Page { @Override public Cells get(final AuthzTrans trans, final AAF_GUI gui) { - final ArrayList ns = new ArrayList(); - final ArrayList perms = new ArrayList(); - final ArrayList roles = new ArrayList(); - final ArrayList user = new ArrayList(); - final ArrayList aafOnly = new ArrayList(); - final ArrayList rv = new ArrayList(); + final ArrayList ns = new ArrayList<>(); + final ArrayList perms = new ArrayList<>(); + final ArrayList roles = new ArrayList<>(); + final ArrayList user = new ArrayList<>(); + final ArrayList aafOnly = new ArrayList<>(); + final ArrayList rv = new ArrayList<>(); final TimeTaken tt = trans.start("AAF APIs",Env.REMOTE); diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CMArtifactShow.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CMArtifactShow.java index 296e41e1..d423731a 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CMArtifactShow.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CMArtifactShow.java @@ -159,7 +159,7 @@ public class CMArtifactShow extends Page { return Cells.EMPTY; } final String id = str.indexOf('@')>=0?str:str + '@' + FQI.reverseDomain(sc.get(trans,Params.ns, "")); - final ArrayList rv = new ArrayList(); + final ArrayList rv = new ArrayList<>(); final TimeTaken tt = trans.start("AAF X509 Details",Env.REMOTE); try { gui.cmClientAsUser(trans.getUserPrincipal(),new Retryable() { diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CredDetail.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CredDetail.java index 8c7c8763..208c750e 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CredDetail.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/CredDetail.java @@ -148,7 +148,7 @@ public class CredDetail extends Page { if(ns==null) { return Cells.EMPTY; } - final ArrayList rv = new ArrayList(); + final ArrayList rv = new ArrayList<>(); final TimeTaken tt = trans.start("AAF Cred Details",Env.REMOTE); List la; try { @@ -164,7 +164,7 @@ public class CredDetail extends Page { } }); - final Set lns = new HashSet(); + final Set lns = new HashSet<>(); if(la!=null) { for(Artifact a : la){ lns.add(a.getMechid()); @@ -176,7 +176,7 @@ public class CredDetail extends Page { Future fu = client.read("/authn/creds/ns/"+ns,gui.getDF(Users.class)); if(fu.get(AAFcli.timeout())) { // Organize User entries - Map>>> users = new HashMap>>>(); + Map>>> users = new HashMap<>(); List>> lmu=null; Map> mu = null; @@ -188,7 +188,7 @@ public class CredDetail extends Page { } lmu = users.get(u.getId()); if(lmu==null) { - users.put(u.getId(),lmu=new ArrayList>>()); + users.put(u.getId(),lmu=new ArrayList<>()); } mu=null; for(Map> xmu : lmu) { @@ -198,12 +198,12 @@ public class CredDetail extends Page { } if(mu==null) { - lmu.add(mu=new HashMap>()); + lmu.add(mu=new HashMap<>()); } lu = mu.get(u.getType()); if(lu==null) { - mu.put(u.getType(),lu = new ArrayList()); + mu.put(u.getType(),lu = new ArrayList<>()); } lu.add(u); } diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsDetail.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsDetail.java index 8c442dd7..0a74d607 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsDetail.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsDetail.java @@ -109,7 +109,7 @@ public class NsDetail extends Page { if(nsName==null) { return Cells.EMPTY; } - final ArrayList rv = new ArrayList(); + final ArrayList rv = new ArrayList<>(); rv.add(new AbsCell[]{new TextCell("Name:"),new TextCell(nsName)}); final TimeTaken tt = trans.start("AAF Namespace Details",Env.REMOTE); @@ -144,7 +144,7 @@ public class NsDetail extends Page { "/authz/roles/ns/"+nsName, gui.getDF(Roles.class) ); - List roles = new ArrayList(); + List roles = new ArrayList<>(); if(fr.get(AAFcli.timeout())) { for (Role r : fr.value.getRole()) { roles.add(r.getName()); @@ -157,7 +157,7 @@ public class NsDetail extends Page { "/authz/perms/ns/"+nsName, gui.getDF(Perms.class) ); - List perms = new ArrayList(); + List perms = new ArrayList<>(); if(fp.get(AAFcli.timeout())) { for (Perm p : fp.value.getPerm()) { diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsHistory.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsHistory.java index 96ec002e..6d55858b 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsHistory.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NsHistory.java @@ -168,7 +168,7 @@ public class NsHistory extends Page { return Cells.EMPTY; } - final ArrayList rv = new ArrayList(); + final ArrayList rv = new ArrayList<>(); String msg = null; final TimeTaken tt = trans.start("AAF Get History for Namespace ["+oName+"]",Env.REMOTE); try { diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NssShow.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NssShow.java index 02aedc5a..fecd2326 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NssShow.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/NssShow.java @@ -83,7 +83,7 @@ public class NssShow extends Page { @Override public Cells get(final AuthzTrans trans, final AAF_GUI gui) { - ArrayList rv = new ArrayList(); + ArrayList rv = new ArrayList<>(); List nss = trans.get(sNssByUser, null); if(nss==null) { TimeTaken tt = trans.start("AAF Nss by User for " + privilege,Env.REMOTE); diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PendingRequestsShow.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PendingRequestsShow.java index 9d2b2cb0..6e7081bc 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PendingRequestsShow.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PendingRequestsShow.java @@ -117,7 +117,7 @@ public class PendingRequestsShow extends Page { @Override public Cells get(final AuthzTrans trans, final AAF_GUI gui) { - final ArrayList rv = new ArrayList(); + final ArrayList rv = new ArrayList<>(); try { gui.clientAsUser(trans.getUserPrincipal(), new Retryable() { @Override diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermDetail.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermDetail.java index 822d0bf4..01c96a62 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermDetail.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermDetail.java @@ -96,7 +96,7 @@ public class PermDetail extends Page { trans.warn().printf("Error in PermDetail Request: %s", v.errs()); return Cells.EMPTY; } - final ArrayList rv = new ArrayList(); + final ArrayList rv = new ArrayList<>(); rv.add(new AbsCell[]{new TextCell("Type:"),new TextCell(pType)}); rv.add(new AbsCell[]{new TextCell("Instance:"),new TextCell(pInstance)}); rv.add(new AbsCell[]{new TextCell("Action:"),new TextCell(pAction)}); diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermGrantForm.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermGrantForm.java index 1c5bc4c1..db3d741b 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermGrantForm.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermGrantForm.java @@ -125,7 +125,7 @@ public class PermGrantForm extends Page { } private static List getMyRoles(final AAF_GUI gui, final AuthzTrans trans) { - final List myRoles = new ArrayList(); + final List myRoles = new ArrayList<>(); try { gui.clientAsUser(trans.getUserPrincipal(), new Retryable() { @Override diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermHistory.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermHistory.java index b7a9960c..37a2c22d 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermHistory.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermHistory.java @@ -175,7 +175,7 @@ public class PermHistory extends Page { return Cells.EMPTY; } - final ArrayList rv = new ArrayList(); + final ArrayList rv = new ArrayList<>(); String msg = null; try { gui.clientAsUser(trans.getUserPrincipal(), new Retryable() { diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermsShow.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermsShow.java index 5f5c2874..9b39945d 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermsShow.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/PermsShow.java @@ -77,7 +77,7 @@ public class PermsShow extends Page { @Override public Cells get(final AuthzTrans trans, final AAF_GUI gui) { - final ArrayList rv = new ArrayList(); + final ArrayList rv = new ArrayList<>(); TimeTaken tt = trans.start("AAF Perms by User",Env.REMOTE); try { gui.clientAsUser(trans.getUserPrincipal(), new Retryable() { diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RequestDetail.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RequestDetail.java index 626b7da5..3e959ef5 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RequestDetail.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RequestDetail.java @@ -86,7 +86,7 @@ public class RequestDetail extends Page { @Override public Cells code(Rcli client) throws CadiException, ConnectException, APIException { TimeTaken tt = trans.start("AAF Approval Details",Env.REMOTE); - ArrayList rv = new ArrayList(); + ArrayList rv = new ArrayList<>(); try { Future fa = client.read( "/authz/approval/ticket/"+ticket, diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleDetail.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleDetail.java index a4d8bed3..a39bf822 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleDetail.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleDetail.java @@ -181,7 +181,7 @@ public class RoleDetail extends Page { public Cells get(final AuthzTrans trans, final AAF_GUI gui) { final String pRole = trans.get(sRoleName, null); final Role role = trans.get(sRole,null); - ArrayList rv = new ArrayList(); + ArrayList rv = new ArrayList<>(); if(role!=null) { boolean mayWrite = trans.get(sMayWrite, false); diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleDetailAction.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleDetailAction.java index f2d2c01f..f9f919a2 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleDetailAction.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleDetailAction.java @@ -76,7 +76,7 @@ public class RoleDetailAction extends Page { /*fail =*/ gui.clientAsUser(trans.getUserPrincipal(), new Retryable() { @Override public Boolean code(Rcli client) throws CadiException, ConnectException, APIException { - List ltf = new ArrayList(); + List ltf = new ArrayList<>(); String text; Map pm = (Map)req.getParameterMap(); for(final Entry es : pm.entrySet()) { diff --git a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleHistory.java b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleHistory.java index 5f7625aa..4a9bd362 100644 --- a/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleHistory.java +++ b/auth/auth-gui/src/main/java/org/onap/aaf/auth/gui/pages/RoleHistory.java @@ -171,7 +171,7 @@ public class RoleHistory extends Page { rv = gui.clientAsUser(trans.getUserPrincipal(), new Retryable() { @Override public Cells code(Rcli client) throws CadiException, ConnectException, APIException { - ArrayList rv = new ArrayList(); + ArrayList rv = new ArrayList<>(); TimeTaken tt = trans.start("AAF Get History for Namespace ["+oName+"]",Env.REMOTE); String msg = null; try { -- cgit 1.2.3-korg