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 --- .../aaf/auth/service/AuthzCassServiceImpl.java | 34 +++++++++++----------- .../org/onap/aaf/auth/service/api/API_History.java | 2 +- .../onap/aaf/auth/service/mapper/Mapper_2_0.java | 4 +-- 3 files changed, 20 insertions(+), 20 deletions(-) (limited to 'auth/auth-service/src/main/java/org/onap') diff --git a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/AuthzCassServiceImpl.java b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/AuthzCassServiceImpl.java index f3207798..668d482c 100644 --- a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/AuthzCassServiceImpl.java +++ b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/AuthzCassServiceImpl.java @@ -568,8 +568,8 @@ public class AuthzCassServiceImpl lm = new HashMap(); - Map other = full || endsWith==null?null:new TreeMap(); + Map lm = new HashMap<>(); + Map other = full || endsWith==null?null:new TreeMap<>(); for(UserRoleDAO.Data urdd : urd.value) { if(full) { if(endsWith==null || urdd.role.endsWith(endsWith)) { @@ -604,8 +604,8 @@ public class AuthzCassServiceImpl (); - namespace.owner=new ArrayList(); + namespace.admin=new ArrayList<>(); + namespace.owner=new ArrayList<>(); } if(endsWith==null || urdd.role.endsWith(endsWith)) { lm.put(namespace.name,namespace); @@ -679,7 +679,7 @@ public class AuthzCassServiceImpl lm = new HashSet(); + Set lm = new HashSet<>(); Result> rlnd = ques.nsDAO.dao().getChildren(trans, parent); if(rlnd.isOK()) { if(rlnd.isEmpty()) { @@ -1301,7 +1301,7 @@ public class AuthzCassServiceImpl updtRoles = new HashSet(); + Set updtRoles = new HashSet<>(); Result nss; for(String role : updt.value.roles(false)) { nss = ques.deriveNsSplit(trans, role); @@ -3114,7 +3114,7 @@ public class AuthzCassServiceImpl userSet = new HashSet(); + HashSet userSet = new HashSet<>(); Result> rlurd = ques.userRoleDAO.readByRole(trans, role); if(rlurd.isOK()) { for(UserRoleDAO.Data data : rlurd.value) { @@ -3186,7 +3186,7 @@ public class AuthzCassServiceImpl content; if(mustFilter) { - content = new ArrayList(rlurd.value.size()); // avoid multi-memory redos + content = new ArrayList<>(rlurd.value.size()); // avoid multi-memory redos for(UserRoleDAO.Data data : rlurd.value) { ndd.name=data.ns; @@ -3231,7 +3231,7 @@ public class AuthzCassServiceImpl currRoles = new HashSet(); + Set currRoles = new HashSet<>(); Result> rlurd = ques.userRoleDAO.readByUser(trans, rurdd.value.user); if(rlurd.isOK()) { for(UserRoleDAO.Data data : rlurd.value) { @@ -3325,7 +3325,7 @@ public class AuthzCassServiceImpl currUsers = new HashSet(); + Set currUsers = new HashSet<>(); Result> rlurd = ques.userRoleDAO.readByRole(trans, rurdd.value.role); if(rlurd.isOK()) { for(UserRoleDAO.Data data : rlurd.value) { @@ -3541,7 +3541,7 @@ public class AuthzCassServiceImpl userSet = new HashSet(); + HashSet userSet = new HashSet<>(); Result> rlurd = ques.userRoleDAO.readUserInRole(trans, user, role); if(rlurd.isOK()) { for(UserRoleDAO.Data data : rlurd.value) { @@ -3593,7 +3593,7 @@ public class AuthzCassServiceImpl userSet = new HashSet(); + HashSet userSet = new HashSet<>(); Result> rlurd = ques.userRoleDAO.readByRole(trans, role); if(rlurd.isOK()) { for(UserRoleDAO.Data data : rlurd.value) { @@ -3657,8 +3657,8 @@ public class AuthzCassServiceImpl roleUsed = new HashSet(); - Set userSet = new HashSet(); + Set roleUsed = new HashSet<>(); + Set userSet = new HashSet<>(); if(!nss.isEmpty()) { Result> rlp = ques.permDAO.readByType(trans, nss.value.ns, nss.value.name); @@ -4025,8 +4025,8 @@ public class AuthzCassServiceImpl >> delegateCache = new HashMap>>(); - Map futureCache = new HashMap(); + Map>> delegateCache = new HashMap<>(); + Map futureCache = new HashMap<>(); FutureDAO.Data hasDeleted = new FutureDAO.Data(); for(ApprovalDAO.Data cd : curr.value) { @@ -4177,7 +4177,7 @@ public class AuthzCassServiceImpl listRapds = new ArrayList(); + List listRapds = new ArrayList<>(); Result> myRapd = ques.approvalDAO.readByApprover(trans, approver); if(myRapd.notOK()) { diff --git a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/api/API_History.java b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/api/API_History.java index 8c55e7dc..9044e177 100644 --- a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/api/API_History.java +++ b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/api/API_History.java @@ -185,7 +185,7 @@ public class API_History { // Sonar says threading issues. SimpleDateFormat FMT = new SimpleDateFormat("yyyyMM"); String yyyymm = req.getParameter("yyyymm"); - ArrayList ai= new ArrayList(); + ArrayList ai= new ArrayList<>(); if(yyyymm==null) { GregorianCalendar gc = new GregorianCalendar(); // three months is the default diff --git a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/mapper/Mapper_2_0.java b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/mapper/Mapper_2_0.java index 0fa58972..06278f92 100644 --- a/auth/auth-service/src/main/java/org/onap/aaf/auth/service/mapper/Mapper_2_0.java +++ b/auth/auth-service/src/main/java/org/onap/aaf/auth/service/mapper/Mapper_2_0.java @@ -292,7 +292,7 @@ public class Mapper_2_0 implements Mapper> perms(AuthzTrans trans, Perms perms) { - List lpd = new ArrayList(); + List lpd = new ArrayList<>(); for (Perm p : perms.getPerm()) { Result nss = q.deriveNsSplit(trans, p.getType()); PermDAO.Data pd = new PermDAO.Data(); @@ -790,7 +790,7 @@ public class Mapper_2_0 implements Mapper> approvals(Approvals apprs) { - List lappr = new ArrayList(); + List lappr = new ArrayList<>(); for(Approval a : apprs.getApprovals()) { ApprovalDAO.Data ad = new ApprovalDAO.Data(); String str = a.getId(); -- cgit 1.2.3-korg