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 --- .../java/org/onap/aaf/auth/helpers/Approval.java | 6 ++-- .../java/org/onap/aaf/auth/helpers/Approver.java | 2 +- .../org/onap/aaf/auth/helpers/CacheChange.java | 2 +- .../main/java/org/onap/aaf/auth/helpers/Cred.java | 10 +++---- .../java/org/onap/aaf/auth/helpers/MiscID.java | 2 +- .../java/org/onap/aaf/auth/helpers/MonthData.java | 5 ++-- .../main/java/org/onap/aaf/auth/helpers/NS.java | 2 +- .../org/onap/aaf/auth/helpers/Notification.java | 4 +-- .../main/java/org/onap/aaf/auth/helpers/Perm.java | 6 ++-- .../main/java/org/onap/aaf/auth/helpers/Role.java | 10 +++---- .../java/org/onap/aaf/auth/helpers/UserRole.java | 12 ++++---- .../org/onap/aaf/auth/reports/ExpiringNext.java | 2 +- .../java/org/onap/aaf/auth/update/ExpiringP2.java | 2 +- .../org/onap/aaf/auth/update/NotifyApprovals.java | 2 +- .../onap/aaf/auth/update/NotifyCredExpiring.java | 8 ++--- .../java/org/onap/aaf/auth/dao/AbsCassDAO.java | 8 ++--- .../main/java/org/onap/aaf/auth/dao/CachedDAO.java | 2 +- .../java/org/onap/aaf/auth/dao/CassAccess.java | 4 +-- .../main/java/org/onap/aaf/auth/dao/Loader.java | 6 ++-- .../aaf/auth/dao/cached/CachedUserRoleDAO.java | 2 +- .../java/org/onap/aaf/auth/dao/cass/ArtiDAO.java | 12 ++++---- .../org/onap/aaf/auth/dao/cass/CacheInfoDAO.java | 6 ++-- .../org/onap/aaf/auth/dao/cass/HistoryDAO.java | 8 ----- .../java/org/onap/aaf/auth/dao/cass/LocateDAO.java | 6 ++-- .../java/org/onap/aaf/auth/dao/cass/Namespace.java | 4 +-- .../java/org/onap/aaf/auth/dao/cass/NsDAO.java | 10 +++---- .../org/onap/aaf/auth/dao/cass/OAuthTokenDAO.java | 4 +-- .../java/org/onap/aaf/auth/dao/cass/PermDAO.java | 4 +-- .../java/org/onap/aaf/auth/dao/cass/RoleDAO.java | 4 +-- .../java/org/onap/aaf/auth/dao/hl/Function.java | 24 +++++++-------- .../java/org/onap/aaf/auth/dao/hl/PermLookup.java | 10 +++---- .../java/org/onap/aaf/auth/dao/hl/Question.java | 12 ++++---- .../org/onap/aaf/auth/direct/DirectAAFLocator.java | 2 +- .../test/java/org/onap/aaf/auth/dao/JU_Cached.java | 2 +- .../java/org/onap/aaf/auth/dao/JU_CassAccess.java | 2 +- .../src/main/java/org/onap/aaf/auth/cm/AAF_CM.java | 2 +- .../src/main/java/org/onap/aaf/auth/cm/ca/CA.java | 2 +- .../main/java/org/onap/aaf/auth/cm/cert/RDN.java | 2 +- .../org/onap/aaf/auth/cm/facade/FacadeImpl.java | 2 +- .../org/onap/aaf/auth/cm/mapper/Mapper2_0.java | 2 +- .../org/onap/aaf/auth/cm/service/CMService.java | 6 ++-- .../java/org/onap/aaf/auth/cm/ca/JU_AppCA.java | 2 +- .../main/java/org/onap/aaf/auth/cmd/AAFcli.java | 6 ++-- .../main/java/org/onap/aaf/auth/cmd/BaseCmd.java | 4 +-- .../src/main/java/org/onap/aaf/auth/cmd/Cmd.java | 4 +-- .../org/onap/aaf/auth/cmd/ns/ListUsersContact.java | 2 +- .../org/onap/aaf/auth/cmd/ns/ListUsersInRole.java | 2 +- .../onap/aaf/auth/cmd/ns/ListUsersWithPerm.java | 2 +- .../org/onap/aaf/auth/cmd/test/ns/JU_List.java | 8 ++--- .../org/onap/aaf/auth/cmd/test/role/JU_List.java | 4 +-- .../java/org/onap/aaf/auth/local/TextIndex.java | 4 +-- .../java/org/onap/aaf/auth/org/Organization.java | 6 ++-- .../org/onap/aaf/auth/org/OrganizationFactory.java | 2 +- .../java/org/onap/aaf/auth/rserv/Acceptor.java | 4 +-- .../org/onap/aaf/auth/rserv/CachingFileAccess.java | 8 ++--- .../main/java/org/onap/aaf/auth/rserv/Match.java | 2 +- .../java/org/onap/aaf/auth/rserv/RouteReport.java | 2 +- .../main/java/org/onap/aaf/auth/rserv/Routes.java | 2 +- .../java/org/onap/aaf/auth/rserv/TypedCode.java | 6 ++-- .../org/onap/aaf/auth/validation/Validator.java | 2 +- .../org/onap/aaf/auth/layer/test/JU_Result.java | 2 +- .../org/onap/aaf/auth/local/test/JU_DataFile.java | 2 +- .../aaf/auth/rserv/test/JU_CachingFileAccess.java | 4 +-- .../src/main/java/org/onap/aaf/org/DefaultOrg.java | 18 ++++++------ .../src/main/java/org/onap/aaf/auth/gui/Page.java | 4 +-- .../java/org/onap/aaf/auth/gui/pages/ApiDocs.java | 12 ++++---- .../onap/aaf/auth/gui/pages/CMArtifactShow.java | 2 +- .../org/onap/aaf/auth/gui/pages/CredDetail.java | 12 ++++---- .../java/org/onap/aaf/auth/gui/pages/NsDetail.java | 6 ++-- .../org/onap/aaf/auth/gui/pages/NsHistory.java | 2 +- .../java/org/onap/aaf/auth/gui/pages/NssShow.java | 2 +- .../aaf/auth/gui/pages/PendingRequestsShow.java | 2 +- .../org/onap/aaf/auth/gui/pages/PermDetail.java | 2 +- .../org/onap/aaf/auth/gui/pages/PermGrantForm.java | 2 +- .../org/onap/aaf/auth/gui/pages/PermHistory.java | 2 +- .../org/onap/aaf/auth/gui/pages/PermsShow.java | 2 +- .../org/onap/aaf/auth/gui/pages/RequestDetail.java | 2 +- .../org/onap/aaf/auth/gui/pages/RoleDetail.java | 2 +- .../onap/aaf/auth/gui/pages/RoleDetailAction.java | 2 +- .../org/onap/aaf/auth/gui/pages/RoleHistory.java | 2 +- .../aaf/auth/locate/facade/LocateFacadeImpl.java | 2 +- .../locate/service/JU_LocateServiceImplTest.java | 2 +- .../locate/validation/JU_LocateValidatorTest.java | 16 +++++----- .../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 +-- .../validation/test/JU_ServiceValidator.java | 2 +- .../java/org/onap/aaf/cadi/aaf/AAFPermission.java | 2 +- .../org/onap/aaf/cadi/aaf/TestConnectivity.java | 2 +- .../aaf/cadi/aaf/cert/AAFListedCertIdentity.java | 8 ++--- .../java/org/onap/aaf/cadi/aaf/v2_0/AAFCon.java | 2 +- .../org/onap/aaf/cadi/aaf/v2_0/AAFLocator.java | 2 +- .../org/onap/aaf/cadi/aaf/v2_0/AbsAAFLocator.java | 4 +-- .../java/org/onap/aaf/cadi/aaf/v2_0/AbsAAFLur.java | 2 +- .../java/org/onap/aaf/cadi/configure/Agent.java | 2 +- .../org/onap/aaf/cadi/configure/ArtifactDir.java | 4 +-- .../cadi/configure/PlaceArtifactInKeystore.java | 6 ++-- .../java/org/onap/aaf/cadi/oauth/TokenClient.java | 6 ++-- .../onap/aaf/cadi/oauth/TokenClientFactory.java | 2 +- .../java/org/onap/aaf/cadi/oauth/TokenMgr.java | 6 ++-- .../java/org/onap/aaf/cadi/oauth/TokenPerm.java | 4 +-- .../java/org/onap/aaf/cadi/persist/Persist.java | 2 +- .../main/java/org/onap/aaf/cadi/sso/AAFSSO.java | 2 +- .../onap/aaf/cadi/aaf/test/JU_AAFPermission.java | 2 +- .../onap/aaf/cadi/aaf/v2_0/test/JU_AAFLocator.java | 2 +- .../java/org/onap/aaf/cadi/cm/test/JU_Factory.java | 4 +-- .../org/onap/aaf/cadi/oauth/test/JU_OAuthTest.java | 2 +- .../java/org/onap/aaf/client/sample/Sample.java | 2 +- .../main/java/org/onap/aaf/cadi/http/HClient.java | 2 +- .../org/onap/aaf/cadi/locator/PropertyLocator.java | 4 +-- .../main/java/org/onap/aaf/cadi/AbsUserCache.java | 14 ++++----- .../src/main/java/org/onap/aaf/cadi/CadiWrap.java | 2 +- .../src/main/java/org/onap/aaf/cadi/Capacitor.java | 2 +- .../main/java/org/onap/aaf/cadi/PropAccess.java | 2 +- .../core/src/main/java/org/onap/aaf/cadi/Symm.java | 2 +- .../core/src/main/java/org/onap/aaf/cadi/User.java | 4 +-- .../main/java/org/onap/aaf/cadi/config/Config.java | 6 ++-- .../org/onap/aaf/cadi/config/SecurityInfoC.java | 2 +- .../java/org/onap/aaf/cadi/config/UsersDump.java | 2 +- .../java/org/onap/aaf/cadi/filter/CadiFilter.java | 2 +- .../java/org/onap/aaf/cadi/taf/HttpEpiTaf.java | 7 ++++- .../java/org/onap/aaf/cadi/taf/cert/X509Taf.java | 2 +- .../onap/aaf/cadi/taf/dos/DenialOfServiceTaf.java | 10 +++---- .../src/main/java/org/onap/aaf/cadi/util/Pool.java | 2 +- .../main/java/org/onap/aaf/cadi/wsse/XReader.java | 14 +++++++-- .../org/onap/aaf/cadi/test/JU_AbsUserCache.java | 4 +-- .../test/java/org/onap/aaf/cadi/test/JU_User.java | 4 +-- .../java/org/onap/aaf/cadi/util/test/JU_Pool.java | 2 +- .../java/org/onap/aaf/cadi/util/test/JU_Vars.java | 6 ++-- .../main/java/org/onap/aaf/misc/env/StoreImpl.java | 20 ++++++------- .../java/org/onap/aaf/misc/env/impl/AbsTrans.java | 2 +- .../java/org/onap/aaf/misc/env/impl/BasicEnv.java | 2 +- .../java/org/onap/aaf/misc/env/jaxb/JAXBmar.java | 2 +- .../java/org/onap/aaf/misc/env/jaxb/JAXBumar.java | 2 +- .../main/java/org/onap/aaf/misc/env/util/Pool.java | 2 +- .../aaf/misc/env/util/RefreshableThreadObject.java | 2 +- .../main/java/org/onap/aaf/misc/rosetta/InXML.java | 6 ++-- .../java/org/onap/aaf/misc/rosetta/JaxInfo.java | 4 +-- .../java/org/onap/aaf/misc/rosetta/JaxSet.java | 6 ++-- .../java/org/onap/aaf/misc/rosetta/OutXML.java | 4 +-- .../java/org/onap/aaf/misc/rosetta/XmlEscape.java | 4 +-- .../main/java/org/onap/aaf/misc/xgen/CacheGen.java | 2 +- .../onap/aaf/misc/xgen/html/JU_HTML4GenTest.java | 20 ++++++------- .../onap/aaf/misc/xgen/html/JU_HTML5GenTest.java | 12 ++++---- .../org/onap/aaf/misc/xgen/xml/JU_XMLGenTest.java | 2 +- 145 files changed, 350 insertions(+), 346 deletions(-) diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Approval.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Approval.java index 7963b022..58aa206e 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Approval.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Approval.java @@ -114,7 +114,7 @@ public class Approval implements CacheChange.Data { if(person!=null) { ln = byApprover.get(person); if(ln==null) { - ln = new ArrayList(); + ln = new ArrayList<>(); byApprover.put(app.getApprover(), ln); } ln.add(app); @@ -125,7 +125,7 @@ public class Approval implements CacheChange.Data { if(person!=null) { ln = byUser.get(person); if(ln==null) { - ln = new ArrayList(); + ln = new ArrayList<>(); byUser.put(app.getUser(), ln); } ln.add(app); @@ -134,7 +134,7 @@ public class Approval implements CacheChange.Data { if(ticket!=null) { ln = byTicket.get(ticket); if(ln==null) { - ln = new ArrayList(); + ln = new ArrayList<>(); byTicket.put(app.getTicket(), ln); } ln.add(app); diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Approver.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Approver.java index 6043e436..127daac5 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Approver.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Approver.java @@ -35,7 +35,7 @@ public class Approver { public Approver(String approver, Organization org) { this.name = approver; this.org = org; - userRequests = new HashMap(); + userRequests = new HashMap<>(); } public void addRequest(String user) { diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/CacheChange.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/CacheChange.java index 02f34d28..0c82184b 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/CacheChange.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/CacheChange.java @@ -28,7 +28,7 @@ public class CacheChange { private List removed; public CacheChange() { - removed = new ArrayList(); + removed = new ArrayList<>(); } interface Data { diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Cred.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Cred.java index 1131aca7..56fbbbae 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Cred.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Cred.java @@ -43,8 +43,8 @@ import com.datastax.driver.core.SimpleStatement; import com.datastax.driver.core.Statement; public class Cred { - public static final TreeMap data = new TreeMap(); - public static final TreeMap> byNS = new TreeMap>(); + public static final TreeMap data = new TreeMap<>(); + public static final TreeMap> byNS = new TreeMap<>(); public final String id; public final List instances; @@ -52,7 +52,7 @@ public class Cred { public Cred(String id) { this.id = id; - instances = new ArrayList(); + instances = new ArrayList<>(); ns=Question.domain2ns(id); } @@ -93,7 +93,7 @@ public class Cred { public Set types() { - Set types = new HashSet(); + Set types = new HashSet<>(); for(Instance i : instances) { types.add(i.type); } @@ -155,7 +155,7 @@ public class Cred { List lscd = byNS.get(cred.ns); if(lscd==null) { - byNS.put(cred.ns, (lscd=new ArrayList())); + byNS.put(cred.ns, (lscd=new ArrayList<>())); } boolean found = false; for(Cred c : lscd) { diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/MiscID.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/MiscID.java index 1438ffdb..d92a448a 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/MiscID.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/MiscID.java @@ -36,7 +36,7 @@ import com.datastax.driver.core.SimpleStatement; import com.datastax.driver.core.Statement; public class MiscID { - public static final TreeMap data = new TreeMap(); + public static final TreeMap data = new TreeMap<>(); /* Sample Record aad890|mj9030|20040902|20120207 diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/MonthData.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/MonthData.java index 13a4c923..d633770e 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/MonthData.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/MonthData.java @@ -36,8 +36,7 @@ import java.util.Set; import java.util.TreeMap; public class MonthData { - public final Map> data = - new TreeMap>(); + public final Map> data = new TreeMap<>(); private File f; public MonthData(String env) throws IOException { @@ -69,7 +68,7 @@ public class MonthData { public void add(int yr_mon, String target, long total, long adds, long drops) { Set row = data.get(yr_mon); if(row==null) { - data.put(yr_mon, (row=new HashSet())); + data.put(yr_mon, (row=new HashSet<>())); } row.add(new Row(target,total,adds,drops)); } diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/NS.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/NS.java index 5dde8895..172768cb 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/NS.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/NS.java @@ -36,7 +36,7 @@ import com.datastax.driver.core.SimpleStatement; import com.datastax.driver.core.Statement; public class NS implements Comparable { - public final static Map data = new TreeMap(); + public final static Map data = new TreeMap<>(); public final String name, description, parent; public final int scope,type; diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Notification.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Notification.java index 9614bb19..57ff5c61 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Notification.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Notification.java @@ -71,7 +71,7 @@ public class Notification { } - public static final TreeMap> data = new TreeMap>(); + public static final TreeMap> data = new TreeMap<>(); public static final Date now = new Date(); public final String user; @@ -113,7 +113,7 @@ public class Notification { Notification not = creator.create(row); List ln = data.get(not.user); if(ln==null) { - ln = new ArrayList(); + ln = new ArrayList<>(); data.put(not.user, ln); } ln.add(not); diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Perm.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Perm.java index 51a7098e..469284a2 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Perm.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Perm.java @@ -38,9 +38,9 @@ import com.datastax.driver.core.SimpleStatement; import com.datastax.driver.core.Statement; public class Perm implements Comparable { - public static final TreeMap> data = new TreeMap>(); - public static final TreeMap keys = new TreeMap(); - private static List deletePerms = new ArrayList(); + public static final TreeMap> data = new TreeMap<>(); + public static final TreeMap keys = new TreeMap<>(); + private static List deletePerms = new ArrayList<>(); public final String ns, type, instance, action,description; private String fullType = null, fullPerm = null, encode = null; diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Role.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Role.java index f48544b1..a173c4fa 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Role.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Role.java @@ -39,10 +39,10 @@ import com.datastax.driver.core.SimpleStatement; import com.datastax.driver.core.Statement; public class Role implements Comparable { - public static final TreeMap> data = new TreeMap>(); - public static final TreeMap keys = new TreeMap(); - public static final TreeMap byName = new TreeMap(); - private static List deleteRoles = new ArrayList(); + public static final TreeMap> data = new TreeMap<>(); + public static final TreeMap keys = new TreeMap<>(); + public static final TreeMap byName = new TreeMap<>(); + private static List deleteRoles = new ArrayList<>(); public final String ns, name, description; private String full, encode; @@ -51,7 +51,7 @@ public class Role implements Comparable { public Role(String full) { ns = name = description = ""; this.full = full; - perms = new HashSet(); + perms = new HashSet<>(); } public Role(String ns, String name, String description,Set perms) { diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/UserRole.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/UserRole.java index 9f366c81..a289fe00 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/UserRole.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/UserRole.java @@ -44,10 +44,10 @@ import com.datastax.driver.core.SimpleStatement; import com.datastax.driver.core.Statement; public class UserRole implements Cloneable, CacheChange.Data { - public static final List data = new ArrayList(); - public static final TreeMap> byUser = new TreeMap>(); - public static final TreeMap> byRole = new TreeMap>(); - private final static CacheChange cache = new CacheChange(); + public static final List data = new ArrayList<>(); + public static final TreeMap> byUser = new TreeMap<>(); + public static final TreeMap> byRole = new TreeMap<>(); + private final static CacheChange cache = new CacheChange<>(); private static PrintStream urDelete=System.out,urRecover=System.err; private static int totalLoaded; private static int deleted; @@ -109,14 +109,14 @@ public class UserRole implements Cloneable, CacheChange.Data { List lur = byUser.get(ur.urdd.user); if(lur==null) { - lur = new ArrayList(); + lur = new ArrayList<>(); byUser.put(ur.urdd.user, lur); } lur.add(ur); lur = byRole.get(ur.urdd.role); if(lur==null) { - lur = new ArrayList(); + lur = new ArrayList<>(); byRole.put(ur.urdd.role, lur); } lur.add(ur); diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/reports/ExpiringNext.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/reports/ExpiringNext.java index 2412f496..8e0257fd 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/reports/ExpiringNext.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/reports/ExpiringNext.java @@ -73,7 +73,7 @@ public class ExpiringNext extends Batch { Date earliestUR = gc.getTime(); Date earliestCred = gc.getTime(); // Run for Roles - List expiring = new ArrayList(); + List expiring = new ArrayList<>(); trans.info().log("Checking for Expired UserRoles"); for(UserRole ur : UserRole.data) { diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/update/ExpiringP2.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/update/ExpiringP2.java index f568b330..79e127da 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/update/ExpiringP2.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/update/ExpiringP2.java @@ -89,7 +89,7 @@ public class ExpiringP2 extends Batch { String line,prev=""; try { UserRole ur; - Map tally = new HashMap(); + Map tally = new HashMap<>(); int count=0; try { while((line=urDeleteF.readLine())!=null) { diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/update/NotifyApprovals.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/update/NotifyApprovals.java index 3314694e..9653662c 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/update/NotifyApprovals.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/update/NotifyApprovals.java @@ -103,7 +103,7 @@ public class NotifyApprovals extends Batch { Message msg = new Message(); int emailCount = 0; - List pending = new ArrayList(); + List pending = new ArrayList<>(); boolean isOwner,isSupervisor; for(Entry> es : Approval.byApprover.entrySet()) { isOwner = isSupervisor = false; diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/update/NotifyCredExpiring.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/update/NotifyCredExpiring.java index bdf8347c..c9f04f73 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/update/NotifyCredExpiring.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/update/NotifyCredExpiring.java @@ -128,12 +128,12 @@ public class NotifyCredExpiring extends Batch { Date tooLate = new Date(now); // Temp structures - Map lastCred = new HashMap(); - Map> ownerCreds = new TreeMap>(); + Map lastCred = new HashMap<>(); + Map> ownerCreds = new TreeMap<>(); Date last; - List noOwner = new ArrayList(); + List noOwner = new ArrayList<>(); ownerCreds.put(UNKNOWN_ID,noOwner); // Get a list of ONLY the ones needing email by Owner @@ -148,7 +148,7 @@ public class NotifyCredExpiring extends Batch { String owner = ur.user(); List llc = ownerCreds.get(owner); if(llc==null) { - ownerCreds.put(owner, (llc=new ArrayList())); + ownerCreds.put(owner, (llc=new ArrayList<>())); } llc.add(new LastCred(c,last)); } diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/AbsCassDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/AbsCassDAO.java index 89fb12fe..b5a950d4 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/AbsCassDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/AbsCassDAO.java @@ -71,8 +71,8 @@ public abstract class AbsCassDAO { protected Class dataClass; private final String name; // private static Slot sessionSlot; // not used since 2015 - private static final ArrayList.PSInfo> psinfos = new ArrayList.PSInfo>(); - private static final List EMPTY = new ArrayList(0); + private static final ArrayList.PSInfo> psinfos = new ArrayList<>(); + private static final List EMPTY = new ArrayList<>(0); private static final Deque resetDeque = new ConcurrentLinkedDeque(); private static boolean resetTrigger = false; private static long nextAvailableReset = 0; @@ -288,7 +288,7 @@ public abstract class AbsCassDAO { /// TEST CODE for Exception // boolean force = true; // if(force) { -// Map misa = new HashMap(); +// Map misa = new HashMap<>(); // //misa.put(new InetSocketAddress(444),new Exception("no host was tried")); // misa.put(new InetSocketAddress(444),new Exception("Connection has been closed")); // throw new com.datastax.driver.core.exceptions.NoHostAvailableException(misa); @@ -338,7 +338,7 @@ public abstract class AbsCassDAO { return Result.ok((List)EMPTY); // Result sets now .emptyList(true); } else { DATA d; - List data = indata==null?new ArrayList(rows.size()):indata; + List data = indata==null?new ArrayList<>(rows.size()):indata; for(Row row : rows) { try { diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/CachedDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/CachedDAO.java index 017f8780..f468dba4 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/CachedDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/CachedDAO.java @@ -64,7 +64,7 @@ public class CachedDAO,DATA extend public void add(DATA data) { String key = keyFromObjs(dao.keyFrom(data)); - List list = new ArrayList(); + List list = new ArrayList<>(); list.add(data); super.add(key,list); } diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/CassAccess.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/CassAccess.java index e70bffb7..c213a04b 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/CassAccess.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/CassAccess.java @@ -44,7 +44,7 @@ public class CassAccess { public static final String CASSANDRA_CLUSTERS_USER_NAME = "cassandra.clusters.user"; public static final String CASSANDRA_CLUSTERS_PASSWORD = "cassandra.clusters.password"; public static final String CASSANDRA_RESET_EXCEPTIONS = "cassandra.reset.exceptions"; - private static final List resetExceptions = new ArrayList(); + private static final List resetExceptions = new ArrayList<>(); public static final String ERR_ACCESS_MSG = "Accessing Backend"; private static Builder cb = null; @@ -181,7 +181,7 @@ public class CassAccess { } } if(split.length>1) { - messages=new ArrayList(); + messages=new ArrayList<>(); for(int i=1;i { if(l<0) { return null; } - Set set = new HashSet(l); + Set set = new HashSet<>(l); for(int i=0;i { if(l<0) { return null; } - List list = new ArrayList(l); + List list = new ArrayList<>(l); for(int i=0;i { if(l<0) { return null; } - Map map = new HashMap(l); + Map map = new HashMap<>(l); for(int i=0;i> rrbu = readByUser(trans, user); if(rrbu.isOK()) { - List ld = new ArrayList(1); + List ld = new ArrayList<>(1); for(Data d : rrbu.value) { if(d.role.equals(role)) { ld.add(d); diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/ArtiDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/ArtiDAO.java index 391b55b4..a6fbecaf 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/ArtiDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/ArtiDAO.java @@ -82,18 +82,18 @@ public class ArtiDAO extends CassDAOImpl { // // Getters public Set type(boolean mutable) { if (type == null) { - type = new HashSet(); + type = new HashSet<>(); } else if (mutable && !(type instanceof HashSet)) { - type = new HashSet(type); + type = new HashSet<>(type); } return type; } public Set sans(boolean mutable) { if (sans == null) { - sans = new HashSet(); + sans = new HashSet<>(); } else if (mutable && !(sans instanceof HashSet)) { - sans = new HashSet(sans); + sans = new HashSet<>(sans); } return sans; } @@ -199,7 +199,7 @@ public class ArtiDAO extends CassDAOImpl { data.mechid = readString(is,buff); data.machine = readString(is,buff); int size = is.readInt(); - data.type = new HashSet(size); + data.type = new HashSet<>(size); for(int i=0;i { data.expires = l<0?null:new Date(l); data.renewDays = is.readInt(); size = is.readInt(); - data.sans = new HashSet(size); + data.sans = new HashSet<>(size); for(int i=0;i implements CIDAO { private static final String TABLE = "cache"; - public static final Map info = new ConcurrentHashMap(); + public static final Map info = new ConcurrentHashMap<>(); private static CacheUpdate cacheUpdate; @@ -217,7 +217,7 @@ public class CacheInfoDAO extends CassDAOImpl impl } public void add(int[] ints) { if(set==null) { - set = new HashSet(); + set = new HashSet<>(); for(int i=0;i impl start = System.nanoTime(); trans = env.newTransNoAvg(); cc = new CacheClear(trans); - gather = new HashMap(); + gather = new HashMap<>(); } IntHolder prev = gather.get(data.table); if(prev==null) { diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/HistoryDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/HistoryDAO.java index 0cfc1dc5..13af8795 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/HistoryDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/HistoryDAO.java @@ -82,13 +82,6 @@ public class HistoryDAO extends CassDAOImpl { public String target; public String subject; public String memo; -// Map detail = null; -// public Map detail() { -// if(detail == null) { -// detail = new HashMap(); -// } -// return detail; -// } public ByteBuffer reconstruct; } @@ -106,7 +99,6 @@ public class HistoryDAO extends CassDAOImpl { data.target = row.getString(4); data.subject = row.getString(5); data.memo = row.getString(6); -// data.detail = row.getMap(6, String.class, String.class); data.reconstruct = row.getBytes(7); return data; } diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/LocateDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/LocateDAO.java index bdf2748c..4778331b 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/LocateDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/LocateDAO.java @@ -81,9 +81,9 @@ public class LocateDAO extends CassDAOImpl { // Getters public Set subprotocol(boolean mutable) { if (subprotocol == null) { - subprotocol = new HashSet(); + subprotocol = new HashSet<>(); } else if (mutable && !(subprotocol instanceof HashSet)) { - subprotocol = new HashSet(subprotocol); + subprotocol = new HashSet<>(subprotocol); } return subprotocol; } @@ -191,7 +191,7 @@ public class LocateDAO extends CassDAOImpl { data.protocol = readString(is,buff); int size = is.readInt(); - data.subprotocol = new HashSet(size); + data.subprotocol = new HashSet<>(size); for(int i=0;i>(); + attrib = new ArrayList<>(); for( Entry entry : ndd.attrib.entrySet()) { attrib.add(new Pair(entry.getKey(),entry.getValue())); } @@ -71,7 +71,7 @@ public class Namespace implements Bytification { type = ndd.type; parent = ndd.parent; if(ndd.attrib!=null && !ndd.attrib.isEmpty()) { - attrib = new ArrayList>(); + attrib = new ArrayList<>(); for( Entry entry : ndd.attrib.entrySet()) { attrib.add(new Pair(entry.getKey(),entry.getValue())); } diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/NsDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/NsDAO.java index 567246d8..07890544 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/NsDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/NsDAO.java @@ -110,9 +110,9 @@ public class NsDAO extends CassDAOImpl { // // Getters public Map attrib(boolean mutable) { if (attrib == null) { - attrib = new HashMap(); + attrib = new HashMap<>(); } else if (mutable && !(attrib instanceof HashMap)) { - attrib = new HashMap(attrib); + attrib = new HashMap<>(attrib); } return attrib; } @@ -255,7 +255,7 @@ public class NsDAO extends CassDAOImpl { //// TEST CODE for Exception // boolean force = true; // if(force) { -// throw new com.datastax.driver.core.exceptions.NoHostAvailableException(new HashMap()); +// throw new com.datastax.driver.core.exceptions.NoHostAvailableException(new HashMap<>()); //// throw new com.datastax.driver.core.exceptions.AuthenticationException(new InetSocketAddress(9999),"Sample Message"); // } ////END TEST CODE @@ -376,7 +376,7 @@ public class NsDAO extends CassDAOImpl { } public Result> readAttribByNS(AuthzTrans trans, String ns) { - Map map = new HashMap(); + Map map = new HashMap<>(); TimeTaken tt = trans.start("readAttribByNS " + ns, Env.REMOTE); try { ResultSet rs = getSession(trans).execute("SELECT key,value FROM " @@ -399,7 +399,7 @@ public class NsDAO extends CassDAOImpl { } public Result> readNsByAttrib(AuthzTrans trans, String key) { - Set set = new HashSet(); + Set set = new HashSet<>(); TimeTaken tt = trans.start("readNsBykey " + key, Env.REMOTE); try { ResultSet rs = getSession(trans).execute("SELECT ns FROM " diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/OAuthTokenDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/OAuthTokenDAO.java index e1375b8a..4fe3aaab 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/OAuthTokenDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/OAuthTokenDAO.java @@ -80,9 +80,9 @@ public class OAuthTokenDAO extends CassDAOImpl { public Set scopes(boolean mutable) { if (scopes == null) { - scopes = new HashSet(); + scopes = new HashSet<>(); } else if (mutable && !(scopes instanceof HashSet)) { - scopes = new HashSet(scopes); + scopes = new HashSet<>(scopes); } return scopes; } diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/PermDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/PermDAO.java index 860b7ea5..0ecdd98d 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/PermDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/PermDAO.java @@ -216,9 +216,9 @@ public class PermDAO extends CassDAOImpl { // Getters public Set roles(boolean mutable) { if (roles == null) { - roles = new HashSet(); + roles = new HashSet<>(); } else if (mutable && !(roles instanceof HashSet)) { - roles = new HashSet(roles); + roles = new HashSet<>(roles); } return roles; } diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/RoleDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/RoleDAO.java index da7d7a2d..974f73fe 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/RoleDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/RoleDAO.java @@ -90,9 +90,9 @@ public class RoleDAO extends CassDAOImpl { // Getters public Set perms(boolean mutable) { if (perms == null) { - perms = new HashSet(); + perms = new HashSet<>(); } else if (mutable && !(perms instanceof HashSet)) { - perms = new HashSet(perms); + perms = new HashSet<>(perms); } return perms; } diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java index b7b17c90..24f9f887 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java @@ -117,7 +117,7 @@ public class Function { public static final String FOP_PERM = "perm"; public static final String FOP_ROLE = "role"; public static final String FOP_USER_ROLE = "user_role"; - private static final List NO_ADDL_APPROVE = new ArrayList(); + private static final List NO_ADDL_APPROVE = new ArrayList<>(); private static final String ROOT_NS = Define.ROOT_NS(); // First Action should ALWAYS be "write", see "CreateRole" public final Question q; @@ -134,7 +134,7 @@ public class Function { if (result.notOK()) { if (sb == null) { sb = new StringBuilder(); - ao = new ArrayList(); + ao = new ArrayList<>(); } sb.append(result.details); sb.append('\n'); @@ -333,7 +333,7 @@ public class Function { if (rrdc.isOKhasData()) { for (RoleDAO.Data rdd : rrdc.value) { // Remove old Role from Perms, save them off - List lpdd = new ArrayList(); + List lpdd = new ArrayList<>(); for(String p : rdd.perms(false)) { Result rpdd = PermDAO.Data.decode(trans,q,p); if(rpdd.isOKhasData()) { @@ -387,7 +387,7 @@ public class Function { if (rpdc.isOKhasData()) { for (PermDAO.Data pdd : rpdc.value) { // Remove old Perm from Roles, save them off - List lrdd = new ArrayList(); + List lrdd = new ArrayList<>(); for(String rl : pdd.roles(false)) { Result rrdd = RoleDAO.Data.decode(trans,q,rl); @@ -447,11 +447,11 @@ public class Function { pd.action = Question.ASTERIX; pd.description = "AAF Namespace Write Access"; - rd.perms = new HashSet(); + rd.perms = new HashSet<>(); rd.perms.add(pd.encode()); eb.log(q.roleDAO.create(trans, rd)); - pd.roles = new HashSet(); + pd.roles = new HashSet<>(); pd.roles.add(rd.encode()); eb.log(q.permDAO.create(trans, pd)); } @@ -469,11 +469,11 @@ public class Function { pd.action = Question.READ; pd.description = "AAF Namespace Read Access"; - rd.perms = new HashSet(); + rd.perms = new HashSet<>(); rd.perms.add(pd.encode()); eb.log(q.roleDAO.create(trans, rd)); - pd.roles = new HashSet(); + pd.roles = new HashSet<>(); pd.roles.add(rd.encode()); eb.log(q.permDAO.create(trans, pd)); } @@ -825,7 +825,7 @@ public class Function { continue; } // Remove old Perm from Roles, save them off - List lrdd = new ArrayList(); + List lrdd = new ArrayList<>(); for(String rl : pdd.roles(false)) { Result rrdd = RoleDAO.Data.decode(trans,q,rl); @@ -891,7 +891,7 @@ public class Function { continue; } // Remove old Role from Perms, save them off - List lpdd = new ArrayList(); + List lpdd = new ArrayList<>(); for(String p : rdd.perms(false)) { Result rpdd = PermDAO.Data.decode(trans,q,p); if(rpdd.isOKhasData()) { @@ -1439,7 +1439,7 @@ public class Function { } Date now = new Date(); List list = rurdd.value; - List rv = new ArrayList(list.size()); // presize + List rv = new ArrayList<>(list.size()); // presize for (UserRoleDAO.Data urdd : rurdd.value) { if (includeExpired || urdd.expires.after(now)) { rv.add(urdd.user); @@ -1471,7 +1471,7 @@ public class Function { Organization org = trans.org(); // For Reapproval, only check Owners.. Do Supervisors, etc, separately List approvers = op.equals(FUTURE_OP.A)?NO_ADDL_APPROVE:org.getApprovers(trans, user); - List owners = new ArrayList(); + List owners = new ArrayList<>(); if (nsd != null) { Result> rrbr = q.userRoleDAO .readByRole(trans, nsd.name + Question.DOT_OWNER); diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/PermLookup.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/PermLookup.java index 615d6b36..1544aab8 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/PermLookup.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/PermLookup.java @@ -59,7 +59,7 @@ class PermLookup { PermLookup lp=null; Map permMap = trans.get(Question.PERMS, null); if (permMap == null) { - trans.put(Question.PERMS, permMap = new HashMap()); + trans.put(Question.PERMS, permMap = new HashMap<>()); } else { lp = permMap.get(user); } @@ -78,7 +78,7 @@ class PermLookup { if(userRoles==null) { userRoles = q.userRoleDAO.readByUser(trans,user); if(userRoles.isOKhasData()) { - List lurdd = new ArrayList(); + List lurdd = new ArrayList<>(); Date now = new Date(); for(UserRoleDAO.Data urdd : userRoles.value) { if(urdd.expires.after(now)) { // Remove Expired @@ -104,7 +104,7 @@ class PermLookup { if(roles==null) { Result> rur = getUserRoles(); if(rur.isOK()) { - List lrdd = new ArrayList(); + List lrdd = new ArrayList<>(); for (UserRoleDAO.Data urdata : rur.value) { // Gather all permissions from all Roles if(urdata.ns==null || urdata.rname==null) { @@ -130,7 +130,7 @@ class PermLookup { if(permNames==null) { Result> rlrd = getRoles(); if (rlrd.isOK()) { - Set pns = new TreeSet(); + Set pns = new TreeSet<>(); for (RoleDAO.Data rdata : rlrd.value) { pns.addAll(rdata.perms(false)); } @@ -149,7 +149,7 @@ class PermLookup { // Jonathan 8/12/2013 Result> rss = getPermNames(); if(rss.isOK()) { - List lpdd = new ArrayList(); + List lpdd = new ArrayList<>(); for (String perm : rss.value) { if(lookup) { Result ap = PermDAO.Data.decodeToArray(trans, q, perm); diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Question.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Question.java index 95041ea3..53548423 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Question.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Question.java @@ -235,7 +235,7 @@ public class Question { nss = null; } else { // Setup a TreeSet to check on Namespaces to - nss = new TreeSet(); + nss = new TreeSet<>(); PermLookup fUser = PermLookup.get(trans, this, forUser); Result> forUpn = fUser.getPermNames(); if(forUpn.notOK()) { @@ -252,7 +252,7 @@ public class Question { } } - List rlpUser = new ArrayList(); + List rlpUser = new ArrayList<>(); Result rpdd; PermDAO.Data pdd; for(String pn : plPermNames.value) { @@ -298,7 +298,7 @@ public class Question { return Result.err(rlrd); } // Using Set to avoid duplicates - Set permNames = new HashSet(); + Set permNames = new HashSet<>(); if (rlrd.isOKhasData()) { for (RoleDAO.Data drr : rlrd.value) { permNames.addAll(drr.perms(false)); @@ -307,7 +307,7 @@ public class Question { // Note: It should be ok for a Valid user to have no permissions - // Jonathan 8/12/2013 - List perms = new ArrayList(); + List perms = new ArrayList<>(); for (String perm : permNames) { Result pr = PermDAO.Data.decode(trans, this, perm); if (pr.notOK()) { @@ -744,7 +744,7 @@ public class Question { // Bug noticed 6/22. Sorting on the result can cause Concurrency Issues. List cddl; if(result.value.size() > 1) { - cddl = new ArrayList(result.value.size()); + cddl = new ArrayList<>(result.value.size()); for(CredDAO.Data old : result.value) { if(old.type==CredDAO.BASIC_AUTH || old.type==CredDAO.BASIC_AUTH_SHA256) { cddl.add(old); @@ -1039,7 +1039,7 @@ public class Question { public static synchronized boolean specialLogOn(AuthzTrans trans, String id) { if (specialLog == null) { - specialLog = new HashSet(); + specialLog = new HashSet<>(); } boolean rc = specialLog.add(id); if(rc) { diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/direct/DirectAAFLocator.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/direct/DirectAAFLocator.java index b854deff..586ae4df 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/direct/DirectAAFLocator.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/direct/DirectAAFLocator.java @@ -84,7 +84,7 @@ public class DirectAAFLocator extends AbsAAFLocator { AuthzTrans trans = env.newTransNoAvg(); Result> rl = ldao.readByName(trans, name); if(rl.isOK()) { - LinkedList epl = new LinkedList(); + LinkedList epl = new LinkedList<>(); for(Data d : rl.value) { // if(myhostname!=null && d.port==myport && d.hostname.equals(myhostname)) { // continue; diff --git a/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/JU_Cached.java b/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/JU_Cached.java index e942f3f1..31a93723 100644 --- a/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/JU_Cached.java +++ b/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/JU_Cached.java @@ -75,7 +75,7 @@ public class JU_Cached { @Test public void testInvalidate(){ Cached cached = new Cached(ciDaoMock, name, 5, 30000L); - cached.add("test", new ArrayList()); + cached.add("test", new ArrayList<>()); cached.invalidate("test"); cached.invalidate("test1"); } diff --git a/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/JU_CassAccess.java b/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/JU_CassAccess.java index c73371e9..525450a6 100644 --- a/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/JU_CassAccess.java +++ b/auth/auth-cass/src/test/java/org/onap/aaf/auth/dao/JU_CassAccess.java @@ -51,7 +51,7 @@ public class JU_CassAccess { public static final String CASSANDRA_RESET_EXCEPTIONS = "cassandra.reset.exceptions"; public static final String LATITUDE = "LATITUDE"; public static final String LONGITUDE = "LONGITUDE"; - //private static final List resetExceptions = new ArrayList(); + //private static final List resetExceptions = new ArrayList<>(); public static final String ERR_ACCESS_MSG = "Accessing Backend"; private static Builder cb = null; @Mock diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/AAF_CM.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/AAF_CM.java index 17a42fc7..a9a9b4e5 100644 --- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/AAF_CM.java +++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/AAF_CM.java @@ -71,7 +71,7 @@ import com.datastax.driver.core.Cluster; public class AAF_CM extends AbsService { private static final String USER_PERMS = "userPerms"; - private static final Map certAuths = new TreeMap(); + private static final Map certAuths = new TreeMap<>(); public Facade1_0 facade1_0; // this is the default Facade public Facade1_0 facade1_0_XML; // this is the XML Facade public Map cacheUser; diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/CA.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/CA.java index ac3e1a54..e840ef56 100644 --- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/CA.java +++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/ca/CA.java @@ -51,7 +51,7 @@ public abstract class CA { private static final String CM_TRUST_CAS = "cm_trust_cas"; protected static final String CM_BACKUP_CAS = "cm_backup_cas"; - public static final Set EMPTY = Collections.unmodifiableSet(new HashSet()); + public static final Set EMPTY = Collections.unmodifiableSet(new HashSet<>()); private final String name; diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/cert/RDN.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/cert/RDN.java index 564a4b5d..b109ffcb 100644 --- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/cert/RDN.java +++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/cert/RDN.java @@ -66,7 +66,7 @@ public class RDN { * @throws CertException */ public static List parse(final char delim, final String dnString ) throws CertException { - List lrnd = new ArrayList(); + List lrnd = new ArrayList<>(); StringBuilder sb = new StringBuilder(); boolean inQuotes = false; for(int i=0;i extends org.onap.aaf. jks.load(null, cap); // Get the Cert(s)... Might include Trust store - List lcerts = new ArrayList(); + List lcerts = new ArrayList<>(); lcerts.add(cr.asCertString()); for(String s : trustChain) { lcerts.add(s); diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper2_0.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper2_0.java index 76f7d9be..62a656fc 100644 --- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper2_0.java +++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/mapper/Mapper2_0.java @@ -205,7 +205,7 @@ public class Mapper2_0 implements Mapper { */ @Override public List toArtifact(AuthzTrans trans, Artifacts artifacts) { - List ladd = new ArrayList(); + List ladd = new ArrayList<>(); for(Artifact arti : artifacts.getArtifact()) { ArtiDAO.Data data = new ArtiDAO.Data(); data.mechid = arti.getMechid(); diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java index ea65659a..dee788e4 100644 --- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java +++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/service/CMService.java @@ -125,7 +125,7 @@ public class CMService { } List notes = null; - List fqdns = new ArrayList(req.value.fqdns); + List fqdns = new ArrayList<>(req.value.fqdns); String email = null; @@ -161,7 +161,7 @@ public class CMService { for(String cn : req.value.fqdns) { try { InetAddress[] ias = InetAddress.getAllByName(cn); - Set potentialSanNames = new HashSet(); + Set potentialSanNames = new HashSet<>(); for(InetAddress ia1 : ias) { InetAddress ia2 = InetAddress.getByAddress(ia1.getAddress()); if(primary==null && ias.length==1 && trans.ip().equals(ia1.getHostAddress())) { @@ -261,7 +261,7 @@ public class CMService { // } // }, // new AAFPermission(ca.getPermType(), ca.getName(), SANS))) { -// if(notes==null) {notes = new ArrayList();} +// if(notes==null) {notes = new ArrayList<>();} // notes.add("Warning: Subject Alternative Names only allowed by Permission: Get CSO Exception."); // return Result.err(Status.ERR_Denied, "%s must have a CSO Exception to work with SAN",trans.user()); // } diff --git a/auth/auth-certman/src/test/java/org/onap/aaf/auth/cm/ca/JU_AppCA.java b/auth/auth-certman/src/test/java/org/onap/aaf/auth/cm/ca/JU_AppCA.java index d81ea9bc..1ab0f4bd 100644 --- a/auth/auth-certman/src/test/java/org/onap/aaf/auth/cm/ca/JU_AppCA.java +++ b/auth/auth-certman/src/test/java/org/onap/aaf/auth/cm/ca/JU_AppCA.java @@ -242,7 +242,7 @@ public class JU_AppCA { } }; - X509andChain xac = new X509andChain(cert, new ArrayList()); + X509andChain xac = new X509andChain(cert, new ArrayList<>()); when(localCA.sign(Mockito.any(Trans.class), Mockito.any(CSRMeta.class))).thenReturn(xac); certDAO = mock(CachedCertDAO.class, CALLS_REAL_METHODS); } 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); } diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/local/TextIndex.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/local/TextIndex.java index 6ef6a769..39225f74 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/local/TextIndex.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/local/TextIndex.java @@ -89,7 +89,7 @@ public class TextIndex { } } - List entries = new ArrayList(); + List entries = new ArrayList<>(); for(int i=min;i<=max;++i) { ttok.pos(i*REC_SIZE); tib.rewind(); @@ -127,7 +127,7 @@ public class TextIndex { public void create(final Trans trans,final DataFile data, int maxLine, char delim, int fieldOffset, int skipLines) throws IOException { FileChannel fos; - List list = new LinkedList(); // Some hashcodes will double... DO NOT make a set + List list = new LinkedList<>(); // Some hashcodes will double... DO NOT make a set TimeTaken tt2 = trans.start("Open Files", Env.SUB); RandomAccessFile raf=null; try { diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/org/Organization.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/org/Organization.java index 8476e06c..bbae00ca 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/org/Organization.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/org/Organization.java @@ -307,11 +307,11 @@ public interface Organization { public static final Organization NULL = new Organization() { private final GregorianCalendar gc = new GregorianCalendar(1900, 1, 1); - private final List nullList = new ArrayList(); - private final Set nullStringSet = new HashSet(); + private final List nullList = new ArrayList<>(); + private final Set nullStringSet = new HashSet<>(); private String[] nullStringArray = new String[0]; private final Identity nullIdentity = new Identity() { - List nullUser = new ArrayList(); + List nullUser = new ArrayList<>(); @Override public String type() { return N_A; diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java index 57d37d0b..f9507038 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java @@ -48,7 +48,7 @@ import org.onap.aaf.misc.env.impl.BasicEnv; public class OrganizationFactory { private static final String ORGANIZATION_DOT = "Organization."; private static Organization defaultOrg = null; - private static Map orgs = new ConcurrentHashMap(); + private static Map orgs = new ConcurrentHashMap<>(); public static Organization init(BasicEnv env) throws OrganizationException { int idx = ORGANIZATION_DOT.length(); Organization org,firstOrg = null; diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Acceptor.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Acceptor.java index 1953694b..82a226ec 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Acceptor.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Acceptor.java @@ -41,7 +41,7 @@ class Acceptor { public Acceptor(List, List>>>> types) { this.types = types; - acceptable = new ArrayList, List>>>>(); + acceptable = new ArrayList<>(); } private boolean eval(HttpCode code, String str, List props) { @@ -128,7 +128,7 @@ class Acceptor { int cis,cie=-1,cend; int sis,sie,send; String name; - ArrayList props = new ArrayList(); + ArrayList props = new ArrayList<>(); do { // Clear these in case more than one Semi props.clear(); // on loop, do not want mixed properties diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CachingFileAccess.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CachingFileAccess.java index 5a03a091..bc563f39 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CachingFileAccess.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CachingFileAccess.java @@ -109,11 +109,11 @@ public class CachingFileAccess extends HttpCode(); // multi-thread changes possible + content = new ConcurrentSkipListMap<>(); // multi-thread changes possible - attachOnly = new HashSet(); // short, unchanged + attachOnly = new HashSet<>(); // short, unchanged - typeMap = new TreeMap(); // Structure unchanged after Construction + typeMap = new TreeMap<>(); // Structure unchanged after Construction typeMap.put("ico","image/icon"); typeMap.put("html","text/html"); typeMap.put("css","text/css"); @@ -540,7 +540,7 @@ public class CachingFileAccess extends HttpCodemaxSize) { - ArrayList scont = new ArrayList(size); + ArrayList scont = new ArrayList<>(size); Object[] entries = content.entrySet().toArray(); for(int i=0;i)entries[i])); diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Match.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Match.java index ac8b31c1..e4eb239d 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Match.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Match.java @@ -51,7 +51,7 @@ public class Match { */ public Match(String path) { // IF DEBUG: System.out.print("\n[" + path + "]"); - params = new HashMap(); + params = new HashMap<>(); if(path!=null) { String[] pa = path.split("/"); values = new byte[pa.length][]; diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/RouteReport.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/RouteReport.java index 5de2ebe3..1c946e83 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/RouteReport.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/RouteReport.java @@ -28,6 +28,6 @@ public class RouteReport { public HttpMethods meth; public String path; public String desc; - public final List contextTypes = new ArrayList(); + public final List contextTypes = new ArrayList<>(); } diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Routes.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Routes.java index fefb8f3c..7cfadf2b 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Routes.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/Routes.java @@ -80,7 +80,7 @@ public class Routes { } public List routeReport() { - ArrayList ltr = new ArrayList(); + ArrayList ltr = new ArrayList<>(); for(int i=0;i extends Content { private List,List>>>> types; public TypedCode() { - types = new ArrayList,List>>>>(); + types = new ArrayList<>(); } /** @@ -88,7 +88,7 @@ public class TypedCode extends Content { @Override protected Pair, List>>> types(HttpCode code, String str) { Pair,List>>> type = null; - ArrayList> props = new ArrayList>(); + ArrayList> props = new ArrayList<>(); // Want Q percentage is to be first in the array everytime. If not listed, 1.0 is default props.add(new Pair(Q,1f)); Pair, List>> cl = new Pair, List>>(code, props); @@ -227,7 +227,7 @@ public class TypedCode extends Content { public void api(RouteReport tr) { // Need to build up a map, because Prop entries can be in several places. - HashMap,StringBuilder> psb = new HashMap,StringBuilder>(); + HashMap,StringBuilder> psb = new HashMap<>(); StringBuilder temp; tr.desc = null; diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/validation/Validator.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/validation/Validator.java index 7078cf0f..de20e476 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/validation/Validator.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/validation/Validator.java @@ -49,7 +49,7 @@ public class Validator { private StringBuilder msgs; static { - nsKeywords = new ArrayList(); + nsKeywords = new ArrayList<>(); nsKeywords.add(".access"); nsKeywords.add(".owner"); nsKeywords.add(".admin"); diff --git a/auth/auth-core/src/test/java/org/onap/aaf/auth/layer/test/JU_Result.java b/auth/auth-core/src/test/java/org/onap/aaf/auth/layer/test/JU_Result.java index 3219e476..a172ad26 100644 --- a/auth/auth-core/src/test/java/org/onap/aaf/auth/layer/test/JU_Result.java +++ b/auth/auth-core/src/test/java/org/onap/aaf/auth/layer/test/JU_Result.java @@ -73,7 +73,7 @@ public class JU_Result { Collection col1 = new ArrayList(); List list1 = new ArrayList(); - Set set1 = new HashSet(); + Set set1 = new HashSet<>(); Integer[] R1 = new Integer[0]; set1.add("derp"); list1.add("test"); diff --git a/auth/auth-core/src/test/java/org/onap/aaf/auth/local/test/JU_DataFile.java b/auth/auth-core/src/test/java/org/onap/aaf/auth/local/test/JU_DataFile.java index d0094dbc..559b275f 100644 --- a/auth/auth-core/src/test/java/org/onap/aaf/auth/local/test/JU_DataFile.java +++ b/auth/auth-core/src/test/java/org/onap/aaf/auth/local/test/JU_DataFile.java @@ -46,7 +46,7 @@ public class JU_DataFile { // File file = new File("../authz-batch/data/v1.dat"); // DataFile df = new DataFile(file,"r"); // int count = 0; -// List list = new ArrayList(); +// List list = new ArrayList<>(); // try { // df.open(); // Token tok = df.new Token(1024000); diff --git a/auth/auth-core/src/test/java/org/onap/aaf/auth/rserv/test/JU_CachingFileAccess.java b/auth/auth-core/src/test/java/org/onap/aaf/auth/rserv/test/JU_CachingFileAccess.java index e9c382d5..3d1f0062 100644 --- a/auth/auth-core/src/test/java/org/onap/aaf/auth/rserv/test/JU_CachingFileAccess.java +++ b/auth/auth-core/src/test/java/org/onap/aaf/auth/rserv/test/JU_CachingFileAccess.java @@ -122,7 +122,7 @@ public class JU_CachingFileAccess { @Test public void testCleanupParams() { - NavigableMap content = new ConcurrentSkipListMap(); + NavigableMap content = new ConcurrentSkipListMap<>(); cachingFileAccess.cleanupParams(50, 500); //TODO: find right input } @@ -170,7 +170,7 @@ public class JU_CachingFileAccess { @Test public void testInvalidate() { - //NavigableMap content = new ConcurrentSkipListMap(); + //NavigableMap content = new ConcurrentSkipListMap<>(); //Content con = mock(Content.class); //content.put("hello", con); cachingFileAccess.invalidate("hello"); diff --git a/auth/auth-deforg/src/main/java/org/onap/aaf/org/DefaultOrg.java b/auth/auth-deforg/src/main/java/org/onap/aaf/org/DefaultOrg.java index eefb2732..dd4a8260 100644 --- a/auth/auth-deforg/src/main/java/org/onap/aaf/org/DefaultOrg.java +++ b/auth/auth-deforg/src/main/java/org/onap/aaf/org/DefaultOrg.java @@ -62,7 +62,7 @@ public class DefaultOrg implements Organization { public DefaultOrg(Env env, String realm) throws OrganizationException { this.realm = realm; - supportedRealms=new HashSet(); + supportedRealms=new HashSet<>(); supportedRealms.add(realm); domain=FQI.reverseDomain(realm); atDomain = '@'+domain; @@ -126,7 +126,7 @@ public class DefaultOrg implements Organization { } // Implement your own Delegation System - static final List NULL_DELEGATES = new ArrayList(); + static final List NULL_DELEGATES = new ArrayList<>(); public Identities identities; private boolean dryRun; @@ -135,7 +135,7 @@ public class DefaultOrg implements Organization { private final static Set typeSet; static { - typeSet = new HashSet(); + typeSet = new HashSet<>(); for(Types t : Types.values()) { typeSet.add(t.name()); } @@ -251,7 +251,7 @@ public class DefaultOrg implements Organization { public Response notify(AuthzTrans trans, Notify type, String url, String[] identities, String[] ccs, String summary, Boolean urgent) { String system = trans.getProperty("CASS_ENV", ""); - ArrayList toList = new ArrayList(); + ArrayList toList = new ArrayList<>(); Identity identity; if (identities != null) { for (String user : identities) { @@ -278,7 +278,7 @@ public class DefaultOrg implements Organization { return Response.ERR_NotificationFailure; } - ArrayList ccList = new ArrayList(); + ArrayList ccList = new ArrayList<>(); // If we're sending an urgent email, CC the user's supervisor // @@ -393,7 +393,7 @@ public class DefaultOrg implements Organization { int status = 1; - List to = new ArrayList(); + List to = new ArrayList<>(); for(String em : toList) { if(em.indexOf('@')<0) { to.add(new DefaultOrgIdentity(trans, em, this).email()); @@ -402,7 +402,7 @@ public class DefaultOrg implements Organization { } } - List cc = new ArrayList(); + List cc = new ArrayList<>(); if(ccList!=null) { if(!ccList.isEmpty()) { @@ -461,7 +461,7 @@ public class DefaultOrg implements Organization { message.addHeader("X-Priority", "1"); } - ArrayList newBody = new ArrayList(); + ArrayList newBody = new ArrayList<>(); Address temp[] = getAddresses(to); String headerString = "TO:\t" + InternetAddress.toString(temp) + "\n"; @@ -574,7 +574,7 @@ public class DefaultOrg implements Organization { @Override public List getApprovers(AuthzTrans trans, String user) throws OrganizationException { Identity orgIdentity = getIdentity(trans, user); - List orgIdentitys = new ArrayList(); + List orgIdentitys = new ArrayList<>(); if(orgIdentity!=null) { Identity supervisor = orgIdentity.responsibleTo(); if(supervisor!=null) { 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 { diff --git a/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/facade/LocateFacadeImpl.java b/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/facade/LocateFacadeImpl.java index f7b9c363..f655657b 100644 --- a/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/facade/LocateFacadeImpl.java +++ b/auth/auth-locate/src/main/java/org/onap/aaf/auth/locate/facade/LocateFacadeImpl.java @@ -95,7 +95,7 @@ public abstract class LocateFacadeImpl epsCache = new HashMap(); // protected manually, in getEndpoints + private final static Map epsCache = new HashMap<>(); // protected manually, in getEndpoints public LocateFacadeImpl(AuthzEnv env, LocateService service, Data.TYPE dataType) throws APIException { this.service = service; diff --git a/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/service/JU_LocateServiceImplTest.java b/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/service/JU_LocateServiceImplTest.java index c79e9cbd..c66de60b 100644 --- a/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/service/JU_LocateServiceImplTest.java +++ b/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/service/JU_LocateServiceImplTest.java @@ -90,7 +90,7 @@ public class JU_LocateServiceImplTest { assertEquals(endPointResult, output); - List mgmtEndPoints = new ArrayList(); + List mgmtEndPoints = new ArrayList<>(); mgmtEndPoints.add(mgmtEndPoint); when(mgmtEndPoint.getName()).thenReturn("http.Endpoint1"); diff --git a/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/validation/JU_LocateValidatorTest.java b/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/validation/JU_LocateValidatorTest.java index 80248d2f..0339f318 100644 --- a/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/validation/JU_LocateValidatorTest.java +++ b/auth/auth-locate/src/test/java/org/onap/aaf/auth/locate/validation/JU_LocateValidatorTest.java @@ -83,7 +83,7 @@ public class JU_LocateValidatorTest { public void testSubProtoCol() { LocateValidator validator = new LocateValidator(); - List subProtocol = new ArrayList(); + List subProtocol = new ArrayList<>(); subProtocol.add(null); when(endpoint.getName()).thenReturn("EndPoint.Endpoint1"); @@ -127,20 +127,20 @@ public class JU_LocateValidatorTest { when(endpoint.getHostname()).thenReturn("HOST1"); when(endpoint.getPort()).thenReturn(9090); when(endpoint.getProtocol()).thenReturn("HTTP"); - List subprotocol = new ArrayList(); + List subprotocol = new ArrayList<>(); when(endpoint.getSubprotocol()).thenReturn(subprotocol); - List endpointList = new ArrayList(); + List endpointList = new ArrayList<>(); endpointList.add(endpoint); when(mgmtEndpoint.getName()).thenReturn("EndPoint.Endpoint1"); when(mgmtEndpoint.getHostname()).thenReturn("HOST1"); when(mgmtEndpoint.getPort()).thenReturn(9090); when(mgmtEndpoint.getProtocol()).thenReturn("HTTP"); - List specialPorts = new ArrayList(); + List specialPorts = new ArrayList<>(); specialPorts.add(null); when(mgmtEndpoint.getSpecialPorts()).thenReturn(specialPorts); - List mgmtEndpoints = new ArrayList(); + List mgmtEndpoints = new ArrayList<>(); mgmtEndpoints.add(mgmtEndpoint); when(endpoints.getEndpoint()).thenReturn(endpointList); @@ -160,20 +160,20 @@ public class JU_LocateValidatorTest { when(mgmtEndpoint.getPort()).thenReturn(9090); when(mgmtEndpoint.getProtocol()).thenReturn("HTTP"); - List specialPorts = new ArrayList(); + List specialPorts = new ArrayList<>(); specialPorts.add(specialPort); when(specialPort.getName()).thenReturn("Port1"); when(specialPort.getProtocol()).thenReturn("HTTP"); when(specialPort.getPort()).thenReturn(9090); - List versions = new ArrayList(); + List versions = new ArrayList<>(); versions.add("1"); when(specialPort.getProtocolVersions()).thenReturn(versions); when(mgmtEndpoint.getSpecialPorts()).thenReturn(specialPorts); - List mgmtEndpoints = new ArrayList(); + List mgmtEndpoints = new ArrayList<>(); mgmtEndpoints.add(mgmtEndpoint); when(me.getMgmtEndpoint()).thenReturn(mgmtEndpoints); 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(); diff --git a/auth/auth-service/src/test/java/org/onap/aaf/auth/service/validation/test/JU_ServiceValidator.java b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/validation/test/JU_ServiceValidator.java index f304fccd..872161a0 100644 --- a/auth/auth-service/src/test/java/org/onap/aaf/auth/service/validation/test/JU_ServiceValidator.java +++ b/auth/auth-service/src/test/java/org/onap/aaf/auth/service/validation/test/JU_ServiceValidator.java @@ -91,7 +91,7 @@ public class JU_ServiceValidator { to.ns = "namespace"; to.name = "name"; to.description = "description"; - Set permissions = new HashSet(); + Set permissions = new HashSet<>(); permissions.add("perm1"); to.perms = permissions; diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/AAFPermission.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/AAFPermission.java index e586d991..3b783949 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/AAFPermission.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/AAFPermission.java @@ -39,7 +39,7 @@ public class AAFPermission implements Permission { private List roles; static { - NO_ROLES = new ArrayList(); + NO_ROLES = new ArrayList<>(); } protected AAFPermission() {roles=NO_ROLES;} diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/TestConnectivity.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/TestConnectivity.java index cd08cd4d..d873205c 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/TestConnectivity.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/TestConnectivity.java @@ -133,7 +133,7 @@ public class TestConnectivity { print(true,"Load Security Setters from Configuration Information"); String user = access.getProperty(Config.AAF_APPID); - ArrayList> lss = new ArrayList>(); + ArrayList> lss = new ArrayList<>(); try { diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/cert/AAFListedCertIdentity.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/cert/AAFListedCertIdentity.java index bc1f94d9..abd1c40f 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/cert/AAFListedCertIdentity.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/cert/AAFListedCertIdentity.java @@ -118,9 +118,9 @@ public class AAFListedCertIdentity implements CertIdentity { @Override public void run() { try { - TreeMap newCertsMap = new TreeMap(); - Map> newTrustMap = new TreeMap>(); - Set userLookup = new HashSet(); + TreeMap newCertsMap = new TreeMap<>(); + Map> newTrustMap = new TreeMap<>(); + Set userLookup = new HashSet<>(); for(String s : certIDs) { userLookup.add(s); } @@ -132,7 +132,7 @@ public class AAFListedCertIdentity implements CertIdentity { aafcon.access.log(Level.WARN, "AAF Lookup-No IDs in Role com.att.aaf.trustForID <> "+authMech); } else { aafcon.access.log(Level.INFO,"Loading Trust Authentication Info for",authMech); - Set hsUser = new HashSet(); + Set hsUser = new HashSet<>(); for(User u : users) { userLookup.add(u.getId()); hsUser.add(u.getId()); diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFCon.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFCon.java index 286104eb..b076379c 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFCon.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFCon.java @@ -62,7 +62,7 @@ public abstract class AAFCon implements Connector { // Package access final public int timeout, cleanInterval, connTimeout; final public int highCount, userExpires, usageRefreshTriggerCount; - private Map> clients = new ConcurrentHashMap>(); + private Map> clients = new ConcurrentHashMap<>(); final public RosettaDF permsDF; final public RosettaDF certsDF; final public RosettaDF usersDF; diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFLocator.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFLocator.java index ee649549..4ae1a051 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFLocator.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFLocator.java @@ -109,7 +109,7 @@ public class AAFLocator extends AbsAAFLocator { client.send(); Future fr = client.futureRead(epsDF, TYPE.JSON); if(fr.get(client.timeout())) { - List epl = new LinkedList(); + List epl = new LinkedList<>(); for(Endpoint endpoint : fr.value.getEndpoint()) { epl.add(new EP(endpoint,latitude,longitude)); } diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AbsAAFLocator.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AbsAAFLocator.java index 312c58e9..f0909062 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AbsAAFLocator.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AbsAAFLocator.java @@ -75,7 +75,7 @@ public abstract class AbsAAFLocator implements Locator } } - epList = new LinkedList(); + epList = new LinkedList<>(); refreshWait = refreshMin; this.access = access; @@ -261,7 +261,7 @@ public abstract class AbsAAFLocator implements Locator if(!hasItems()) { throw new LocatorException("No Entries found" + (pathInfo==null?"":(" for " + pathInfo))); } - List lep = new ArrayList(); + List lep = new ArrayList<>(); EP first = null; // Note: Deque is sorted on the way by closest distance Iterator iter = getIterator(); diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AbsAAFLur.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AbsAAFLur.java index 083537a8..9feeee36 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AbsAAFLur.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AbsAAFLur.java @@ -132,7 +132,7 @@ public abstract class AbsAAFLur extends AbsUserCache perms = new ArrayList(); + List perms = new ArrayList<>(); user.copyPermsTo(perms); for(Permission p : perms) { sb.append("\n\t\t"); diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java index 3c8719b4..b19be6cd 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java @@ -174,7 +174,7 @@ public class Agent { permDF = env.newDataFactory(Perms.class); errMsg = new ErrMessage(env); - placeArtifact = new HashMap(); + placeArtifact = new HashMap<>(); placeArtifact.put(JKS, new PlaceArtifactInKeystore(JKS)); placeArtifact.put(PKCS12, new PlaceArtifactInKeystore(PKCS12)); placeArtifact.put(FILE, new PlaceArtifactInFiles()); diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/ArtifactDir.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/ArtifactDir.java index 74cf4e4b..266ace81 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/ArtifactDir.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/ArtifactDir.java @@ -48,11 +48,11 @@ public abstract class ArtifactDir implements PlaceArtifact { protected static final String C_R = "\n"; protected File dir; - private List encodeds = new ArrayList(); + private List encodeds = new ArrayList<>(); private Symm symm; // This checks for multiple passes of Dir on the same objects. Run clear after done. - protected static Map processed = new HashMap(); + protected static Map processed = new HashMap<>(); /** diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/PlaceArtifactInKeystore.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/PlaceArtifactInKeystore.java index 2a522bc1..cb282605 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/PlaceArtifactInKeystore.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/PlaceArtifactInKeystore.java @@ -64,8 +64,8 @@ public class PlaceArtifactInKeystore extends ArtifactDir { // find where the trusts end in 1.0 API X509Certificate x509; - List chainList = new ArrayList(); - Set caSet = new HashSet(); + List chainList = new ArrayList<>(); + Set caSet = new HashSet<>(); for(Certificate c : certColl) { x509 = (X509Certificate)c; // Is a Root (self-signed, anyway) @@ -98,7 +98,7 @@ public class PlaceArtifactInKeystore extends ArtifactDir { PrivateKey pk = Factory.toPrivateKey(trans, certInfo.getPrivatekey()); addEncProperty(Config.CADI_KEY_PASSWORD, keyPass); addProperty(Config.CADI_ALIAS, arti.getMechid()); -// Set attribs = new HashSet(); +// Set attribs = new HashSet<>(); // if(kst.equals("pkcs12")) { // // Friendly Name // attribs.add(new PKCS12Attribute("1.2.840.113549.1.9.20", arti.getNs())); diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenClient.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenClient.java index dec0b4e9..2ebd7dc1 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenClient.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenClient.java @@ -274,7 +274,7 @@ public class TokenClient { Result rtt = factory.get(key,hash,new Loader() { @Override public Result load(final String key) throws APIException, CadiException, LocatorException { - final List params = new ArrayList(); + final List params = new ArrayList<>(); params.add(scope); addSecurity(params,authn_method); @@ -331,7 +331,7 @@ public class TokenClient { if(ss==null) { throw new APIException("client_creds(...) must be set before obtaining Access Tokens"); } - final List params = new ArrayList(); + final List params = new ArrayList<>(); params.add("refresh_token="+token.getRefreshToken()); addSecurity(params,AUTHN_METHOD.refresh_token); final String scope="scope="+token.getScope().replace(' ', '+'); @@ -373,7 +373,7 @@ public class TokenClient { return tkCon.best(new Retryable>() { @Override public Result code(Rcli client) throws CadiException, ConnectException, APIException { - final List params = new ArrayList(); + final List params = new ArrayList<>(); params.add("token="+token); addSecurity(params,AUTHN_METHOD.client_credentials); final String paramsa[] = new String[params.size()]; diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenClientFactory.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenClientFactory.java index 2b895761..c2848980 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenClientFactory.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenClientFactory.java @@ -54,7 +54,7 @@ import aafoauth.v2_0.Token; public class TokenClientFactory extends Persist { private static TokenClientFactory instance; - private Map aafcons = new ConcurrentHashMap(); + private Map aafcons = new ConcurrentHashMap<>(); private SecurityInfoC hsi; // Package on purpose final Symm symm; diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenMgr.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenMgr.java index d8fd88f6..4e781bfa 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenMgr.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenMgr.java @@ -44,9 +44,9 @@ import aaf.v2_0.Perms; import aafoauth.v2_0.Introspect; public class TokenMgr extends Persist { - protected static Map tpmap = new ConcurrentHashMap(); - protected static Map tmmap = new HashMap(); // synchronized in getInstance - protected static Map currentToken = new HashMap(); // synchronized in getTP + protected static Map tpmap = new ConcurrentHashMap<>(); + protected static Map tmmap = new HashMap<>(); // synchronized in getInstance + protected static Map currentToken = new HashMap<>(); // synchronized in getTP public static RosettaDF permsDF; public static RosettaDF introspectDF; diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenPerm.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenPerm.java index 4a0259a4..5c77fda7 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenPerm.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenPerm.java @@ -42,7 +42,7 @@ import aaf.v2_0.Perms; import aafoauth.v2_0.Introspect; public class TokenPerm extends Persisting{ - private static final List NULL_PERMS = new ArrayList(); + private static final List NULL_PERMS = new ArrayList<>(); private Introspect introspect; private List perms; private String scopes; @@ -99,7 +99,7 @@ public class TokenPerm extends Persisting{ while((pd = ij.parse(r,pd.reuse())).valid()) { switch(pd.event) { case Parse.START_DOC: - perms = new ArrayList(); + perms = new ArrayList<>(); break; case Parse.START_ARRAY: inPerms = "perm".equals(pd.name); diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/persist/Persist.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/persist/Persist.java index 9754b1e6..11acbe91 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/persist/Persist.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/persist/Persist.java @@ -65,7 +65,7 @@ public abstract class Persist> extends PersistFile { super(access, sub_dir); this.env = env; df = env.newDataFactory(cls); - tmap = new ConcurrentHashMap(); + tmap = new ConcurrentHashMap<>(); synchronized(Persist.class) { if(clean==null) { clean = new Timer(true); diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/sso/AAFSSO.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/sso/AAFSSO.java index f2fb7057..28103b5d 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/sso/AAFSSO.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/sso/AAFSSO.java @@ -454,7 +454,7 @@ public class AAFSSO { private List parseArgs(String[] args) { - List larg = new ArrayList(args.length); + List larg = new ArrayList<>(args.length); // Cover for bash's need to escape *.. (\\*) // also, remove SSO if required diff --git a/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/test/JU_AAFPermission.java b/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/test/JU_AAFPermission.java index 10958a23..4836e4ed 100644 --- a/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/test/JU_AAFPermission.java +++ b/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/test/JU_AAFPermission.java @@ -44,7 +44,7 @@ public class JU_AAFPermission { @Before public void setup() { - roles = new ArrayList(); + roles = new ArrayList<>(); roles.add(role); } diff --git a/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/v2_0/test/JU_AAFLocator.java b/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/v2_0/test/JU_AAFLocator.java index 3b2ce7b1..eeb9c623 100644 --- a/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/v2_0/test/JU_AAFLocator.java +++ b/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/v2_0/test/JU_AAFLocator.java @@ -97,7 +97,7 @@ public class JU_AAFLocator { public static void tearDownAfterClass() throws Exception { Field field = SecurityInfoC.class.getDeclaredField("sicMap"); field.setAccessible(true); - field.set(null, new HashMap,SecurityInfoC>()); + field.set(null, new HashMap<>()); } @Test diff --git a/cadi/aaf/src/test/java/org/onap/aaf/cadi/cm/test/JU_Factory.java b/cadi/aaf/src/test/java/org/onap/aaf/cadi/cm/test/JU_Factory.java index b47abe2c..5827e8c0 100644 --- a/cadi/aaf/src/test/java/org/onap/aaf/cadi/cm/test/JU_Factory.java +++ b/cadi/aaf/src/test/java/org/onap/aaf/cadi/cm/test/JU_Factory.java @@ -238,7 +238,7 @@ public class JU_Factory { output = Factory.toString(transMock, certs.toArray(new Certificate[0])[0]); assertThat(output, is(certString)); - List certStrings = new ArrayList(); + List certStrings = new ArrayList<>(); certStrings.add(certString); certStrings.add(certString); certs = Factory.toX509Certificate(certStrings); @@ -318,7 +318,7 @@ public class JU_Factory { private String cleanupString(String str) { String[] lines = str.split("\n", 0); - List rawLines = new ArrayList(); + List rawLines = new ArrayList<>(); for (int i = 0; i < lines.length - 2; i++) { rawLines.add(lines[i + 1]); } diff --git a/cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_OAuthTest.java b/cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_OAuthTest.java index a30f274f..555eda41 100644 --- a/cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_OAuthTest.java +++ b/cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_OAuthTest.java @@ -79,7 +79,7 @@ public class JU_OAuthTest { public static void tearDownAfterClass() throws Exception { Field field = SecurityInfoC.class.getDeclaredField("sicMap"); field.setAccessible(true); - field.set(null, new HashMap,SecurityInfoC>()); + field.set(null, new HashMap<>()); } @Before diff --git a/cadi/aaf/src/test/java/org/onap/aaf/client/sample/Sample.java b/cadi/aaf/src/test/java/org/onap/aaf/client/sample/Sample.java index ff170772..45a7d341 100644 --- a/cadi/aaf/src/test/java/org/onap/aaf/client/sample/Sample.java +++ b/cadi/aaf/src/test/java/org/onap/aaf/client/sample/Sample.java @@ -105,7 +105,7 @@ public class Sample { } public List allAuthorization(Principal fqi) { - List pond = new ArrayList(); + List pond = new ArrayList<>(); aafLur.fishAll(fqi, pond); return pond; } diff --git a/cadi/client/src/main/java/org/onap/aaf/cadi/http/HClient.java b/cadi/client/src/main/java/org/onap/aaf/cadi/http/HClient.java index df8cacf4..a3dac7da 100644 --- a/cadi/client/src/main/java/org/onap/aaf/cadi/http/HClient.java +++ b/cadi/client/src/main/java/org/onap/aaf/cadi/http/HClient.java @@ -93,7 +93,7 @@ public class HClient implements EClient { @Override public void addHeader(String tag, String value) { if (headers == null) - headers = new ArrayList
(); + headers = new ArrayList<>(); headers.add(new Header(tag, value)); } diff --git a/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java b/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java index 4591122c..b75e8bc2 100644 --- a/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java +++ b/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java @@ -65,7 +65,7 @@ public class PropertyLocator implements Locator { throw new LocatorException("No Location List given for PropertyLocator"); } String[] locarray = Split.split(',',locList); - List uriList = new ArrayList(); + List uriList = new ArrayList<>(); random = new SecureRandom(); @@ -177,7 +177,7 @@ public class PropertyLocator implements Locator { public synchronized boolean refresh() { if(System.currentTimeMillis()>lastRefreshed) { // Build up list - List resolve = new ArrayList(); + List resolve = new ArrayList<>(); String realname; for(int i = 0; i < orig.length ; ++i) { try { diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/AbsUserCache.java b/cadi/core/src/main/java/org/onap/aaf/cadi/AbsUserCache.java index c65a9b22..1d01a3e8 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/AbsUserCache.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/AbsUserCache.java @@ -55,7 +55,7 @@ public abstract class AbsUserCache { private static Timer timer; // Map of userName to User private final Map> userMap; - private static final Map missMap = new TreeMap(); + private static final Map missMap = new TreeMap<>(); private final Symm missEncrypt; private Clean clean; @@ -73,7 +73,7 @@ public abstract class AbsUserCache { } missEncrypt = s; - userMap = new ConcurrentHashMap>(); + userMap = new ConcurrentHashMap<>(); if(cleanInterval>0) { @@ -236,7 +236,7 @@ public abstract class AbsUserCache { } public final List dumpInfo() { - List rv = new ArrayList(); + List rv = new ArrayList<>(); for(User user : userMap.values()) { rv.add(new DumpInfo(user)); } @@ -265,7 +265,7 @@ public abstract class AbsUserCache { // Simple map of Group name to a set of User Names - // private Map> groupMap = new HashMap>(); + // private Map> groupMap = new HashMap<>(); /** * Class to hold a small subset of the data, because we don't want to expose actual Permission or User Objects @@ -276,7 +276,7 @@ public abstract class AbsUserCache { public DumpInfo(User user) { this.user = user.principal.getName(); - perms = new ArrayList(user.perms.keySet()); + perms = new ArrayList<>(user.perms.keySet()); } } @@ -315,7 +315,7 @@ public abstract class AbsUserCache { int total = 0; try { // look at now. If we need to expire more by increasing "now" by "advance" - ArrayList> al = new ArrayList>(userMap.values().size()); + ArrayList> al = new ArrayList<>(userMap.values().size()); al.addAll(0, userMap.values()); long now = System.currentTimeMillis() + advance; for(User user : al) { @@ -367,7 +367,7 @@ public abstract class AbsUserCache { int missTotal = missMap.keySet().size(); int miss = 0; if(missTotal>0) { - ArrayList keys = new ArrayList(missTotal); + ArrayList keys = new ArrayList<>(missTotal); keys.addAll(missMap.keySet()); for(String key : keys) { Miss m = missMap.get(key); diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/CadiWrap.java b/cadi/core/src/main/java/org/onap/aaf/cadi/CadiWrap.java index 49572f4c..a2dfba37 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/CadiWrap.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/CadiWrap.java @@ -140,7 +140,7 @@ public class CadiWrap extends HttpServletRequestWrapper implements HttpServletRe * To utilize, the Request must be a "CadiWrap" object, then call. */ public List getPermissions(Principal p) { - List perms = new ArrayList(); + List perms = new ArrayList<>(); lur.fishAll(p, perms); return perms; } diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/Capacitor.java b/cadi/core/src/main/java/org/onap/aaf/cadi/Capacitor.java index 00383851..935e4f14 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/Capacitor.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/Capacitor.java @@ -36,7 +36,7 @@ import java.util.ArrayList; */ public class Capacitor { private static final int DEFAULT_CHUNK = 256; - private ArrayList bbs = new ArrayList(); + private ArrayList bbs = new ArrayList<>(); private ByteBuffer curr = null; private int idx; diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java b/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java index c827477f..5e001561 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java @@ -184,7 +184,7 @@ public class PropAccess implements Access { String chainProp = props.getProperty(Config.CADI_PROP_FILES); if(chainProp!=null) { if(recursionProtection==null) { - recursionProtection = new ArrayList(); + recursionProtection = new ArrayList<>(); recursionProtection.add(cadi_prop_files); } if(!recursionProtection.contains(chainProp)) { diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/Symm.java b/cadi/core/src/main/java/org/onap/aaf/cadi/Symm.java index 5a3fe825..4067f160 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/Symm.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/Symm.java @@ -138,7 +138,7 @@ public class Symm { // There can be time efficiencies gained when the underlying keyset consists mainly of ordered // data (i.e. abcde...). Therefore, we'll quickly analyze the keyset. If it proves to have // too much entropy, the "Unordered" algorithm, which is faster in such cases is used. - ArrayList la = new ArrayList(); + ArrayList la = new ArrayList<>(); for(int i=0;i { - private static final Map NULL_MAP = new HashMap(); + private static final Map NULL_MAP = new HashMap<>(); public String name; private byte[] cred; public Principal principal; @@ -121,7 +121,7 @@ public final class User { } public Map newMap() { - return new ConcurrentHashMap(); + return new ConcurrentHashMap<>(); } public void add(LocalPermission permission) { diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java index b74ccb36..dfcf7e3d 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java @@ -259,7 +259,7 @@ public class Config { access.log(Level.INIT, "Hostname set to",hostname); // Get appropriate TAFs - ArrayList htlist = new ArrayList(); + ArrayList htlist = new ArrayList<>(); ///////////////////////////////////////////////////// // Add a Denial of Service TAF @@ -507,7 +507,7 @@ public class Config { public static Lur configLur(SecurityInfoC si, Connector con, Object ... additionalTafLurs) throws CadiException { Access access = si.access; - List lurs = new ArrayList(); + List lurs = new ArrayList<>(); ///////////////////////////////////////////////////// // Configure a Local Property Based RBAC/LUR @@ -671,7 +671,7 @@ public class Config { aafConClass = loadClass(access, AAF_V2_0_AAF_CON_HTTP); if (aafConClass != null) { for (Constructor c : aafConClass.getConstructors()) { - List lo = new ArrayList(); + List lo = new ArrayList<>(); for (Class pc : c.getParameterTypes()) { if (pc.equals(Access.class)) { lo.add(access); diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfoC.java b/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfoC.java index cc366c27..a5fb4a0c 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfoC.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfoC.java @@ -31,7 +31,7 @@ import org.onap.aaf.cadi.SecuritySetter; public class SecurityInfoC extends SecurityInfo { public static final String DEF_ID = "ID not Set"; - private static Map,SecurityInfoC> sicMap = new HashMap,SecurityInfoC>(); + private static Map,SecurityInfoC> sicMap = new HashMap<>(); public SecuritySetter defSS; public SecurityInfoC(Access access) throws CadiException { diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/config/UsersDump.java b/cadi/core/src/main/java/org/onap/aaf/cadi/config/UsersDump.java index a3e267cd..974e5810 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/config/UsersDump.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/config/UsersDump.java @@ -58,7 +58,7 @@ public class UsersDump { StringBuilder sb = new StringBuilder(); // Obtain all unique role names - HashSet groups = new HashSet(); + HashSet groups = new HashSet<>(); for(AbsUserCache.DumpInfo di : lur.dumpInfo()) { sb.append("\n 0) { MapPermConverter mpc=null; int idx; - mapPairs = new ArrayList(); + mapPairs = new ArrayList<>(); for(String entry : map) { if((idx=entry.indexOf('='))<0) { // it's a Path, so create a new converter access.log(Level.INIT,"Loading Perm Conversions for:",entry); diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/taf/HttpEpiTaf.java b/cadi/core/src/main/java/org/onap/aaf/cadi/taf/HttpEpiTaf.java index 5cd6323d..5b51c111 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/taf/HttpEpiTaf.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/taf/HttpEpiTaf.java @@ -93,7 +93,12 @@ public class HttpEpiTaf implements HttpTaf { TafResp tresp = null; TafResp firstTry = null; List redirectables = null; - List log = (access.willLog(Level.DEBUG)) ? new ArrayList() : null; + List log; + if(access.willLog(Level.DEBUG)) { + log = new ArrayList<>(); + } else { + log = null; + } try { for (HttpTaf taf : tafs) { tresp = taf.validate(reading, req, resp); diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/taf/cert/X509Taf.java b/cadi/core/src/main/java/org/onap/aaf/cadi/taf/cert/X509Taf.java index dc07bb90..7b7f2db0 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/taf/cert/X509Taf.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/taf/cert/X509Taf.java @@ -86,7 +86,7 @@ public class X509Taf implements HttpTaf { throw new CadiException("X509Taf requires Environment ("+Config.AAF_ENV+") to be set."); } // this.lur = lur; - this.cadiIssuers = new ArrayList(); + this.cadiIssuers = new ArrayList<>(); for(String ci : access.getProperty(Config.CADI_X509_ISSUERS, "").split(":")) { access.printf(Level.INIT, "Trusting Identity for Certificates signed by \"%s\"",ci); cadiIssuers.add(ci); diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/taf/dos/DenialOfServiceTaf.java b/cadi/core/src/main/java/org/onap/aaf/cadi/taf/dos/DenialOfServiceTaf.java index 44a3a4a3..a0d56f67 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/taf/dos/DenialOfServiceTaf.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/taf/dos/DenialOfServiceTaf.java @@ -126,7 +126,7 @@ public class DenialOfServiceTaf implements HttpTaf { public static synchronized boolean denyIP(String ip) { boolean rv = false; if(deniedIP==null) { - deniedIP = new HashMap(); + deniedIP = new HashMap<>(); deniedIP.put(ip, new Counter(ip)); // Noted duplicated for minimum time spent rv= true; } else if(deniedIP.get(ip)==null) { @@ -170,7 +170,7 @@ public class DenialOfServiceTaf implements HttpTaf { br = new BufferedReader(new FileReader(dosIP)); try { if(deniedIP==null) { - deniedIP=new HashMap(); + deniedIP=new HashMap<>(); } String line; @@ -215,7 +215,7 @@ public class DenialOfServiceTaf implements HttpTaf { public static synchronized boolean denyID(String id) { boolean rv = false; if(deniedID==null) { - deniedID = new HashMap(); + deniedID = new HashMap<>(); deniedID.put(id, new Counter(id)); // Noted duplicated for minimum time spent rv = true; } else if(deniedID.get(id)==null) { @@ -260,7 +260,7 @@ public class DenialOfServiceTaf implements HttpTaf { br = new BufferedReader(new FileReader(dosID)); try { if(deniedID==null) { - deniedID=new HashMap(); + deniedID=new HashMap<>(); } String line; @@ -299,7 +299,7 @@ public class DenialOfServiceTaf implements HttpTaf { int initSize = 0; if(deniedIP!=null)initSize+=deniedIP.size(); if(deniedID!=null)initSize+=deniedID.size(); - ArrayList al = new ArrayList(initSize); + ArrayList al = new ArrayList<>(initSize); if(deniedID!=null) { for(Counter c : deniedID.values()) { al.add(c.toString()); diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/util/Pool.java b/cadi/core/src/main/java/org/onap/aaf/cadi/util/Pool.java index 4312c3ca..7cd7a633 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/util/Pool.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/util/Pool.java @@ -107,7 +107,7 @@ public class Pool { public Pool(Creator creator) { count = spares = 0; this.creator = creator; - list = new LinkedList>(); + list = new LinkedList<>(); logger = Log.NULL; } diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/wsse/XReader.java b/cadi/core/src/main/java/org/onap/aaf/cadi/wsse/XReader.java index 7af475ad..78265e4b 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/wsse/XReader.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/wsse/XReader.java @@ -354,14 +354,22 @@ public class XReader { for(Tag tag : t.attribs) { if("xmlns".equals(tag.prefix)) { if(newnss==null) { - newnss = new HashMap(); + newnss = new HashMap<>(); if(nss!=null)newnss.putAll(nss); } newnss.put(tag.name, tag.value); } } } - return newnss==null?(nss==null?new HashMap():nss):newnss; + //return newnss==null?(nss==null?new HashMap():nss):newnss; + if(newnss==null) { + if(nss==null) { + newnss = new HashMap<>(); + } else { + newnss = nss; + } + } + return newnss; } /** @@ -392,7 +400,7 @@ public class XReader { */ public void add(Tag attrib) { if(attribs == null) { - attribs = new ArrayList(); + attribs = new ArrayList<>(); } attribs.add(attrib); } diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_AbsUserCache.java b/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_AbsUserCache.java index b2739b9d..11877dea 100644 --- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_AbsUserCache.java +++ b/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_AbsUserCache.java @@ -284,10 +284,10 @@ public class JU_AbsUserCache { assertThat(dumpInfo.size(), is(2)); // Utility lists - List names = new ArrayList(); + List names = new ArrayList<>(); names.add(name1); names.add(name2); - List permissions = new ArrayList(); + List permissions = new ArrayList<>(); permissions.add("NewKey1"); permissions.add("NewKey2"); diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_User.java b/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_User.java index 25683249..2d5ba8d2 100644 --- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_User.java +++ b/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_User.java @@ -158,7 +158,7 @@ public class JU_User { @Test public void addValuesToNewMapTest() { User user = new User(principal); - Map newMap = new HashMap(); + Map newMap = new HashMap<>(); assertFalse(user.contains(permission)); @@ -167,7 +167,7 @@ public class JU_User { assertTrue(user.contains(permission)); - List sink = new ArrayList(); + List sink = new ArrayList<>(); user.copyPermsTo(sink); assertThat(sink.size(), is(1)); diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Pool.java b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Pool.java index 79209322..b9f0e997 100644 --- a/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Pool.java +++ b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Pool.java @@ -71,7 +71,7 @@ public class JU_Pool { public void getTest() throws CadiException { Pool intPool = new Pool(new IntegerCreator()); - List> gotten = new ArrayList>(); + List> gotten = new ArrayList<>(); for (int i = 0; i < 10; i++) { gotten.add(intPool.get()); assertThat(gotten.get(i).content, is(i)); diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Vars.java b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Vars.java index b2600aa5..551f725d 100644 --- a/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Vars.java +++ b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Vars.java @@ -39,21 +39,21 @@ public class JU_Vars { @Test public void convert() { String test = "test"; - List list = new ArrayList(); + List list = new ArrayList<>(); list.add("method"); assertEquals(Vars.convert(test, list), test); } @Test public void convertTest1() { - List list = new ArrayList(); + List list = new ArrayList<>(); list.add("method"); assertEquals(Vars.convert("test", list), "test"); } @Test public void convertTest2() { - List list = new ArrayList(); + List list = new ArrayList<>(); list.add("method"); assertEquals(Vars.convert("test", list), "test"); } diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/StoreImpl.java b/misc/env/src/main/java/org/onap/aaf/misc/env/StoreImpl.java index 54b0ce83..685bfb6e 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/StoreImpl.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/StoreImpl.java @@ -65,21 +65,21 @@ public class StoreImpl implements Store { public StoreImpl() { staticState = new Object[growSize]; - staticMap = new HashMap(); - localMap = new HashMap(); + staticMap = new HashMap<>(); + localMap = new HashMap<>(); } public StoreImpl(String tag) { staticState = new Object[growSize]; - staticMap = new HashMap(); - localMap = new HashMap(); + staticMap = new HashMap<>(); + localMap = new HashMap<>(); } public StoreImpl(String tag, String[] args) { staticState = new Object[growSize]; - staticMap = new HashMap(); - localMap = new HashMap(); + staticMap = new HashMap<>(); + localMap = new HashMap<>(); if(tag!=null) { String tequals = tag + '='; @@ -102,8 +102,8 @@ public class StoreImpl implements Store { public StoreImpl(String tag, Properties props) { staticState = new Object[growSize]; - staticMap = new HashMap(); - localMap = new HashMap(); + staticMap = new HashMap<>(); + localMap = new HashMap<>(); if(tag!=null) { String fname = props.getProperty(tag); @@ -191,7 +191,7 @@ public class StoreImpl implements Store { * @see com.att.env.Store#existingSlotNames() */ public List existingSlotNames() { - return new ArrayList(localMap.keySet()); + return new ArrayList<>(localMap.keySet()); } /* (non-Javadoc) @@ -234,7 +234,7 @@ public class StoreImpl implements Store { } public List existingStaticSlotNames() { - return new ArrayList(staticMap.keySet()); + return new ArrayList<>(staticMap.keySet()); } } diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java index f10de386..e378e2c3 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java @@ -37,7 +37,7 @@ public abstract class AbsTrans implements TransStore { private static final Object[] EMPTYO = new Object[0]; protected ENV delegate; - protected List trail = new ArrayList(30); + protected List trail = new ArrayList<>(30); private Object[] state; diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java index 2a3628d3..cd62a7e5 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java @@ -84,7 +84,7 @@ public class BasicEnv extends StoreImpl implements EnvJAXB, TransCreate(); +// props = new HashMap<>(); // String value; // for(int i=0;i[],Pool> pools = new HashMap[], Pool>(); + private static Map[],Pool> pools = new HashMap<>(); // Handle Marshaller class setting of properties only when needed private class PMarshaller { diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBumar.java b/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBumar.java index 74072aaf..0c078a98 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBumar.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBumar.java @@ -68,7 +68,7 @@ import org.w3c.dom.Node; */ public class JAXBumar { // Need to store off possible JAXBContexts based on Class, which will be stored in Creator - private static Map[],Pool> pools = new HashMap[], Pool>(); + private static Map[],Pool> pools = new HashMap<>(); private Class cls; private Schema schema; diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/util/Pool.java b/misc/env/src/main/java/org/onap/aaf/misc/env/util/Pool.java index 1694a011..82f05b4a 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/util/Pool.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/util/Pool.java @@ -104,7 +104,7 @@ public class Pool { public Pool(Creator creator) { count = spares = 0; this.creator = creator; - list = new LinkedList>(); + list = new LinkedList<>(); } /** diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/util/RefreshableThreadObject.java b/misc/env/src/main/java/org/onap/aaf/misc/env/util/RefreshableThreadObject.java index 56cd54e5..6892a4b5 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/util/RefreshableThreadObject.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/util/RefreshableThreadObject.java @@ -69,7 +69,7 @@ public class RefreshableThreadObject> { * @throws APIException */ public RefreshableThreadObject(Class clss) throws APIException { - objs = new ConcurrentHashMap(); + objs = new ConcurrentHashMap<>(); try { cnst = clss.getConstructor(new Class[]{Env.class} ); } catch (Exception e) { diff --git a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/InXML.java b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/InXML.java index 48275926..da66394c 100644 --- a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/InXML.java +++ b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/InXML.java @@ -205,7 +205,7 @@ public class InXML implements Parse { String value = sb.toString(); sb.setLength(0); if(tag !=null && value != null) { - if(props==null)props = new ArrayList(); + if(props==null)props = new ArrayList<>(); props.add(new Prop(tag,value)); } } @@ -251,7 +251,7 @@ public class InXML implements Parse { public void push(Prop prop) { if(attribs==null) { - attribs = new ArrayList(); + attribs = new ArrayList<>(); idx = 0; } attribs.add(prop); @@ -291,7 +291,7 @@ public class InXML implements Parse { private void addNS(Prop prop) { Map existingNS = getNS(); - if(ns==null)ns = new HashMap(); + if(ns==null)ns = new HashMap<>(); // First make a copy of previous NSs so that we have everything we need, but can overwrite, if necessary if(existingNS!=null && ns!=existingNS) { ns.putAll(ns); diff --git a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxInfo.java b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxInfo.java index 5f38c8c7..6c20ba25 100644 --- a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxInfo.java +++ b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxInfo.java @@ -74,7 +74,7 @@ public class JaxInfo { JaxInfo derived; // Lazy Instantiation if(extensions == null) { - extensions = new HashMap(); + extensions = new HashMap<>(); derived = null; } else { derived = extensions.get(derivedName); @@ -163,7 +163,7 @@ public class JaxInfo { // Build up Method names from JAXB Annotations XmlType xt; while((xt = cls.getAnnotation(XmlType.class))!=null) { - if(fields==null)fields = new ArrayList(); + if(fields==null)fields = new ArrayList<>(); for(String field : xt.propOrder()) { if("".equals(field)) break; // odd bug. "" returned when no fields exist, rather than empty array Field rf = cls.getDeclaredField(field); diff --git a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxSet.java b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxSet.java index bb6784c8..04d61581 100644 --- a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxSet.java +++ b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxSet.java @@ -38,11 +38,11 @@ import javax.xml.bind.annotation.XmlType; * @param */ public class JaxSet { - private static Map,JaxSet> jsets = new HashMap,JaxSet>(); + private static Map,JaxSet> jsets = new HashMap<>(); private Map> members; private JaxSet(Class cls) { - members = new TreeMap>(); + members = new TreeMap<>(); XmlType xmltype = cls.getAnnotation(XmlType.class); Class paramType[] = new Class[] {String.class}; for(String str : xmltype.propOrder()) { @@ -79,7 +79,7 @@ public class JaxSet { @SuppressWarnings("unchecked") JaxSet js = (JaxSet)jsets.get(cls); if(js == null) { - jsets.put(cls, js = new JaxSet(cls)); + jsets.put(cls, js = new JaxSet<>(cls)); } return js; } diff --git a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/OutXML.java b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/OutXML.java index f3ce1c22..8557c584 100644 --- a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/OutXML.java +++ b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/OutXML.java @@ -42,7 +42,7 @@ public class OutXML extends Out{ public OutXML(String root, String ... params) { this.root = root; - props = new ArrayList(); + props = new ArrayList<>(); for(String p : params) { String[] tv=p.split("="); if(tv.length==2) @@ -164,7 +164,7 @@ public class OutXML extends Out{ } if(create && !rv) { - if(nses == null) nses = new HashMap(); + if(nses == null) nses = new HashMap<>(); nses.put(ns, value); } return rv; diff --git a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/XmlEscape.java b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/XmlEscape.java index f1cde6e5..aac1e30f 100644 --- a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/XmlEscape.java +++ b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/XmlEscape.java @@ -106,8 +106,8 @@ public class XmlEscape { } static { - charMap = new TreeMap(); - intMap = new TreeMap(); + charMap = new TreeMap<>(); + intMap = new TreeMap<>(); charMap.put("quot", 34); charMap.put("amp",38); charMap.put("apos",39); diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/CacheGen.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/CacheGen.java index 74b590da..417f80b7 100644 --- a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/CacheGen.java +++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/CacheGen.java @@ -42,7 +42,7 @@ public abstract class CacheGen> { public final static int HTML5 = 0x8; - private ArrayList> sections = new ArrayList>(); + private ArrayList> sections = new ArrayList<>(); private int flags; private final Thematic thematic; diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML4GenTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML4GenTest.java index 18b33938..9160095d 100644 --- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML4GenTest.java +++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML4GenTest.java @@ -60,7 +60,7 @@ public class JU_HTML4GenTest { gen.html("attributes"); - Map map = new TreeMap(); + Map map = new TreeMap<>(); for (char ch : DOCTYPE.toCharArray()) { Integer times = map.get(ch); map.put(ch, (times == null ? 0 : times) + 1); @@ -84,7 +84,7 @@ public class JU_HTML4GenTest { gen.head(); - Map map = new TreeMap(); + Map map = new TreeMap<>(); for (char ch : "head".toCharArray()) { Integer times = map.get(ch); @@ -103,7 +103,7 @@ public class JU_HTML4GenTest { gen.body("attributes"); - Map map = new TreeMap(); + Map map = new TreeMap<>(); for (char ch : "body".toCharArray()) { Integer times = map.get(ch); @@ -126,7 +126,7 @@ public class JU_HTML4GenTest { gen.charset(charset); - Map map = new TreeMap(); + Map map = new TreeMap<>(); for (char ch : CHARSET_LINE.toCharArray()) { Integer times = map.get(ch); @@ -145,7 +145,7 @@ public class JU_HTML4GenTest { gen.header("attributes"); - Map map = new TreeMap(); + Map map = new TreeMap<>(); for (char ch : "header".toCharArray()) { Integer times = map.get(ch); @@ -174,7 +174,7 @@ public class JU_HTML4GenTest { gen.footer("attributes"); - Map map = new TreeMap(); + Map map = new TreeMap<>(); for (char ch : "footer".toCharArray()) { Integer times = map.get(ch); @@ -203,7 +203,7 @@ public class JU_HTML4GenTest { gen.section("attributes"); - Map map = new TreeMap(); + Map map = new TreeMap<>(); for (char ch : "section".toCharArray()) { Integer times = map.get(ch); @@ -232,7 +232,7 @@ public class JU_HTML4GenTest { gen.article("attributes"); - Map map = new TreeMap(); + Map map = new TreeMap<>(); for (char ch : "attrib".toCharArray()) { Integer times = map.get(ch); @@ -261,7 +261,7 @@ public class JU_HTML4GenTest { gen.aside("attributes"); - Map map = new TreeMap(); + Map map = new TreeMap<>(); for (char ch : "aside".toCharArray()) { Integer times = map.get(ch); @@ -290,7 +290,7 @@ public class JU_HTML4GenTest { gen.nav("attributes"); - Map map = new TreeMap(); + Map map = new TreeMap<>(); for (char ch : "nav".toCharArray()) { Integer times = map.get(ch); diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML5GenTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML5GenTest.java index 953a4a3b..69ebf89b 100644 --- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML5GenTest.java +++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML5GenTest.java @@ -36,8 +36,8 @@ import org.mockito.Mock; public class JU_HTML5GenTest { - private final static String DOCTYPE = ""; +// private final static String DOCTYPE = ""; private String charset = "utf-8"; @@ -59,7 +59,7 @@ public class JU_HTML5GenTest { gen.html("attributes"); - Map map = new TreeMap(); + Map map = new TreeMap<>(); for (char ch : "html".toCharArray()) { Integer times = map.get(ch); @@ -79,7 +79,7 @@ public class JU_HTML5GenTest { gen.head(); - Map map = new TreeMap(); + Map map = new TreeMap<>(); for (char ch : "head".toCharArray()) { Integer times = map.get(ch); @@ -98,7 +98,7 @@ public class JU_HTML5GenTest { gen.body("attributes"); - Map map = new TreeMap(); + Map map = new TreeMap<>(); for (char ch : "body".toCharArray()) { Integer times = map.get(ch); @@ -121,7 +121,7 @@ public class JU_HTML5GenTest { gen.charset(charset); - Map map = new TreeMap(); + Map map = new TreeMap<>(); for (char ch : CHARSET_LINE.toCharArray()) { Integer times = map.get(ch); diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLGenTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLGenTest.java index 2dbc422a..1c00b452 100644 --- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLGenTest.java +++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLGenTest.java @@ -41,7 +41,7 @@ public class JU_XMLGenTest { String XML_TAG = ""; - Map map = new TreeMap(); + Map map = new TreeMap<>(); @Before public void setUp() throws Exception { -- cgit 1.2.3-korg