diff options
Diffstat (limited to 'auth')
87 files changed, 216 insertions, 225 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<Approval>(); + 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<Approval>(); + 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<Approval>(); + 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<String, Integer>(); + 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<T extends CacheChange.Data> { private List<T> removed; public CacheChange() { - removed = new ArrayList<T>(); + 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<String,Cred> data = new TreeMap<String,Cred>(); - public static final TreeMap<String,List<Cred>> byNS = new TreeMap<String,List<Cred>>(); + public static final TreeMap<String,Cred> data = new TreeMap<>(); + public static final TreeMap<String,List<Cred>> byNS = new TreeMap<>(); public final String id; public final List<Instance> instances; @@ -52,7 +52,7 @@ public class Cred { public Cred(String id) { this.id = id; - instances = new ArrayList<Instance>(); + instances = new ArrayList<>(); ns=Question.domain2ns(id); } @@ -93,7 +93,7 @@ public class Cred { public Set<Integer> types() { - Set<Integer> types = new HashSet<Integer>(); + Set<Integer> types = new HashSet<>(); for(Instance i : instances) { types.add(i.type); } @@ -155,7 +155,7 @@ public class Cred { List<Cred> lscd = byNS.get(cred.ns); if(lscd==null) { - byNS.put(cred.ns, (lscd=new ArrayList<Cred>())); + 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<String,MiscID> data = new TreeMap<String,MiscID>(); + public static final TreeMap<String,MiscID> 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<Integer,Set<Row>> data = - new TreeMap<Integer,Set<Row>>(); + public final Map<Integer,Set<Row>> 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> row = data.get(yr_mon); if(row==null) { - data.put(yr_mon, (row=new HashSet<Row>())); + 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<NS> { - public final static Map<String,NS> data = new TreeMap<String,NS>(); + public final static Map<String,NS> 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<String,List<Notification>> data = new TreeMap<String,List<Notification>>(); + public static final TreeMap<String,List<Notification>> 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<Notification> ln = data.get(not.user); if(ln==null) { - ln = new ArrayList<Notification>(); + 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<Perm> { - public static final TreeMap<Perm,Set<String>> data = new TreeMap<Perm,Set<String>>(); - public static final TreeMap<String,Perm> keys = new TreeMap<String,Perm>(); - private static List<Perm> deletePerms = new ArrayList<Perm>(); + public static final TreeMap<Perm,Set<String>> data = new TreeMap<>(); + public static final TreeMap<String,Perm> keys = new TreeMap<>(); + private static List<Perm> 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<Role> { - public static final TreeMap<Role,Set<String>> data = new TreeMap<Role,Set<String>>(); - public static final TreeMap<String,Role> keys = new TreeMap<String,Role>(); - public static final TreeMap<String,Role> byName = new TreeMap<String,Role>(); - private static List<Role> deleteRoles = new ArrayList<Role>(); + public static final TreeMap<Role,Set<String>> data = new TreeMap<>(); + public static final TreeMap<String,Role> keys = new TreeMap<>(); + public static final TreeMap<String,Role> byName = new TreeMap<>(); + private static List<Role> deleteRoles = new ArrayList<>(); public final String ns, name, description; private String full, encode; @@ -51,7 +51,7 @@ public class Role implements Comparable<Role> { public Role(String full) { ns = name = description = ""; this.full = full; - perms = new HashSet<String>(); + perms = new HashSet<>(); } public Role(String ns, String name, String description,Set<String> 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<UserRole> data = new ArrayList<UserRole>(); - public static final TreeMap<String,List<UserRole>> byUser = new TreeMap<String,List<UserRole>>(); - public static final TreeMap<String,List<UserRole>> byRole = new TreeMap<String,List<UserRole>>(); - private final static CacheChange<UserRole> cache = new CacheChange<UserRole>(); + public static final List<UserRole> data = new ArrayList<>(); + public static final TreeMap<String,List<UserRole>> byUser = new TreeMap<>(); + public static final TreeMap<String,List<UserRole>> byRole = new TreeMap<>(); + private final static CacheChange<UserRole> 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<UserRole> lur = byUser.get(ur.urdd.user); if(lur==null) { - lur = new ArrayList<UserRole>(); + lur = new ArrayList<>(); byUser.put(ur.urdd.user, lur); } lur.add(ur); lur = byRole.get(ur.urdd.role); if(lur==null) { - lur = new ArrayList<UserRole>(); + 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<String> expiring = new ArrayList<String>(); + List<String> 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<String,Count> tally = new HashMap<String,Count>(); + Map<String,Count> 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<Approval> pending = new ArrayList<Approval>(); + List<Approval> pending = new ArrayList<>(); boolean isOwner,isSupervisor; for(Entry<String, List<Approval>> 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<String,Cred> lastCred = new HashMap<String,Cred>(); - Map<String,List<LastCred>> ownerCreds = new TreeMap<String,List<LastCred>>(); + Map<String,Cred> lastCred = new HashMap<>(); + Map<String,List<LastCred>> ownerCreds = new TreeMap<>(); Date last; - List<LastCred> noOwner = new ArrayList<LastCred>(); + List<LastCred> 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<LastCred> llc = ownerCreds.get(owner); if(llc==null) { - ownerCreds.put(owner, (llc=new ArrayList<LastCred>())); + 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<TRANS extends TransStore,DATA> { protected Class<DATA> dataClass; private final String name; // private static Slot sessionSlot; // not used since 2015 - private static final ArrayList<AbsCassDAO<? extends TransStore,?>.PSInfo> psinfos = new ArrayList<AbsCassDAO<? extends TransStore,?>.PSInfo>(); - private static final List<Object> EMPTY = new ArrayList<Object>(0); + private static final ArrayList<AbsCassDAO<? extends TransStore,?>.PSInfo> psinfos = new ArrayList<>(); + private static final List<Object> EMPTY = new ArrayList<>(0); private static final Deque<ResetRequest> resetDeque = new ConcurrentLinkedDeque<ResetRequest>(); private static boolean resetTrigger = false; private static long nextAvailableReset = 0; @@ -288,7 +288,7 @@ public abstract class AbsCassDAO<TRANS extends TransStore,DATA> { /// TEST CODE for Exception // boolean force = true; // if(force) { -// Map<InetSocketAddress, Throwable> misa = new HashMap<InetSocketAddress,Throwable>(); +// Map<InetSocketAddress, Throwable> 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<TRANS extends TransStore,DATA> { return Result.ok((List<DATA>)EMPTY); // Result sets now .emptyList(true); } else { DATA d; - List<DATA> data = indata==null?new ArrayList<DATA>(rows.size()):indata; + List<DATA> 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<TRANS extends Trans,D extends DAO<TRANS,DATA>,DATA extend public void add(DATA data) { String key = keyFromObjs(dao.keyFrom(data)); - List<DATA> list = new ArrayList<DATA>(); + List<DATA> 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<Resettable> resetExceptions = new ArrayList<Resettable>(); + private static final List<Resettable> 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<String>(); + messages=new ArrayList<>(); for(int i=1;i<split.length;++i) { String str = split[i]; int start = str.startsWith("\"")?1:0; diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/Loader.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/Loader.java index 485eabc6..00423161 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/Loader.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/Loader.java @@ -143,7 +143,7 @@ public abstract class Loader<DATA> { if(l<0) { return null; } - Set<String> set = new HashSet<String>(l); + Set<String> set = new HashSet<>(l); for(int i=0;i<l;++i) { set.add(readString(is,buff)); } @@ -155,7 +155,7 @@ public abstract class Loader<DATA> { if(l<0) { return null; } - List<String> list = new ArrayList<String>(l); + List<String> list = new ArrayList<>(l); for(int i=0;i<l;++i) { list.add(Loader.readString(is,buff)); } @@ -187,7 +187,7 @@ public abstract class Loader<DATA> { if(l<0) { return null; } - Map<String,String> map = new HashMap<String,String>(l); + Map<String,String> map = new HashMap<>(l); for(int i=0;i<l;++i) { String key = readString(is,buff); map.put(key,readString(is,buff)); diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedUserRoleDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedUserRoleDAO.java index dce2beaa..100c81d5 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedUserRoleDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cached/CachedUserRoleDAO.java @@ -91,7 +91,7 @@ public class CachedUserRoleDAO extends CachedDAO<AuthzTrans,UserRoleDAO, UserRol if(user.equals(trans.user())) { Result<List<Data>> rrbu = readByUser(trans, user); if(rrbu.isOK()) { - List<Data> ld = new ArrayList<Data>(1); + List<Data> 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<AuthzTrans,ArtiDAO.Data> { // // Getters public Set<String> type(boolean mutable) { if (type == null) { - type = new HashSet<String>(); + type = new HashSet<>(); } else if (mutable && !(type instanceof HashSet)) { - type = new HashSet<String>(type); + type = new HashSet<>(type); } return type; } public Set<String> sans(boolean mutable) { if (sans == null) { - sans = new HashSet<String>(); + sans = new HashSet<>(); } else if (mutable && !(sans instanceof HashSet)) { - sans = new HashSet<String>(sans); + sans = new HashSet<>(sans); } return sans; } @@ -199,7 +199,7 @@ public class ArtiDAO extends CassDAOImpl<AuthzTrans,ArtiDAO.Data> { data.mechid = readString(is,buff); data.machine = readString(is,buff); int size = is.readInt(); - data.type = new HashSet<String>(size); + data.type = new HashSet<>(size); for(int i=0;i<size;++i) { data.type.add(readString(is,buff)); } @@ -213,7 +213,7 @@ public class ArtiDAO extends CassDAOImpl<AuthzTrans,ArtiDAO.Data> { data.expires = l<0?null:new Date(l); data.renewDays = is.readInt(); size = is.readInt(); - data.sans = new HashSet<String>(size); + data.sans = new HashSet<>(size); for(int i=0;i<size;++i) { data.sans.add(readString(is,buff)); } diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/CacheInfoDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/CacheInfoDAO.java index 66ab7344..6d9900b9 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/CacheInfoDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/CacheInfoDAO.java @@ -63,7 +63,7 @@ import com.datastax.driver.core.exceptions.DriverException; public class CacheInfoDAO extends CassDAOImpl<AuthzTrans,CacheInfoDAO.Data> implements CIDAO<AuthzTrans> { private static final String TABLE = "cache"; - public static final Map<String,Date[]> info = new ConcurrentHashMap<String,Date[]>(); + public static final Map<String,Date[]> info = new ConcurrentHashMap<>(); private static CacheUpdate cacheUpdate; @@ -217,7 +217,7 @@ public class CacheInfoDAO extends CassDAOImpl<AuthzTrans,CacheInfoDAO.Data> impl } public void add(int[] ints) { if(set==null) { - set = new HashSet<Integer>(); + set = new HashSet<>(); for(int i=0;i<raw.length;++i) { set.add(raw[i]); @@ -275,7 +275,7 @@ public class CacheInfoDAO extends CassDAOImpl<AuthzTrans,CacheInfoDAO.Data> impl start = System.nanoTime(); trans = env.newTransNoAvg(); cc = new CacheClear(trans); - gather = new HashMap<String,IntHolder>(); + 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<AuthzTrans, HistoryDAO.Data> { public String target; public String subject; public String memo; -// Map<String, String> detail = null; -// public Map<String, String> detail() { -// if(detail == null) { -// detail = new HashMap<String, String>(); -// } -// return detail; -// } public ByteBuffer reconstruct; } @@ -106,7 +99,6 @@ public class HistoryDAO extends CassDAOImpl<AuthzTrans, HistoryDAO.Data> { 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<AuthzTrans,LocateDAO.Data> { // Getters public Set<String> subprotocol(boolean mutable) { if (subprotocol == null) { - subprotocol = new HashSet<String>(); + subprotocol = new HashSet<>(); } else if (mutable && !(subprotocol instanceof HashSet)) { - subprotocol = new HashSet<String>(subprotocol); + subprotocol = new HashSet<>(subprotocol); } return subprotocol; } @@ -191,7 +191,7 @@ public class LocateDAO extends CassDAOImpl<AuthzTrans,LocateDAO.Data> { data.protocol = readString(is,buff); int size = is.readInt(); - data.subprotocol = new HashSet<String>(size); + data.subprotocol = new HashSet<>(size); for(int i=0;i<size;++i) { data.subprotocol.add(readString(is,buff)); } diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/Namespace.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/Namespace.java index 4b1ff149..11ee4bcb 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/Namespace.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/Namespace.java @@ -56,7 +56,7 @@ public class Namespace implements Bytification { type = ndd.type; parent = ndd.parent; if(ndd.attrib!=null && !ndd.attrib.isEmpty()) { - attrib = new ArrayList<Pair<String,String>>(); + attrib = new ArrayList<>(); for( Entry<String, String> entry : ndd.attrib.entrySet()) { attrib.add(new Pair<String,String>(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<Pair<String,String>>(); + attrib = new ArrayList<>(); for( Entry<String, String> entry : ndd.attrib.entrySet()) { attrib.add(new Pair<String,String>(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<AuthzTrans,NsDAO.Data> { // // Getters public Map<String,String> attrib(boolean mutable) { if (attrib == null) { - attrib = new HashMap<String,String>(); + attrib = new HashMap<>(); } else if (mutable && !(attrib instanceof HashMap)) { - attrib = new HashMap<String,String>(attrib); + attrib = new HashMap<>(attrib); } return attrib; } @@ -255,7 +255,7 @@ public class NsDAO extends CassDAOImpl<AuthzTrans,NsDAO.Data> { //// TEST CODE for Exception // boolean force = true; // if(force) { -// throw new com.datastax.driver.core.exceptions.NoHostAvailableException(new HashMap<InetSocketAddress,Throwable>()); +// 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<AuthzTrans,NsDAO.Data> { } public Result<Map<String,String>> readAttribByNS(AuthzTrans trans, String ns) { - Map<String,String> map = new HashMap<String,String>(); + Map<String,String> 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<AuthzTrans,NsDAO.Data> { } public Result<Set<String>> readNsByAttrib(AuthzTrans trans, String key) { - Set<String> set = new HashSet<String>(); + Set<String> 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<AuthzTrans,OAuthTokenDAO.Data> { public Set<String> scopes(boolean mutable) { if (scopes == null) { - scopes = new HashSet<String>(); + scopes = new HashSet<>(); } else if (mutable && !(scopes instanceof HashSet)) { - scopes = new HashSet<String>(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<AuthzTrans,PermDAO.Data> { // Getters public Set<String> roles(boolean mutable) { if (roles == null) { - roles = new HashSet<String>(); + roles = new HashSet<>(); } else if (mutable && !(roles instanceof HashSet)) { - roles = new HashSet<String>(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<AuthzTrans,RoleDAO.Data> { // Getters public Set<String> perms(boolean mutable) { if (perms == null) { - perms = new HashSet<String>(); + perms = new HashSet<>(); } else if (mutable && !(perms instanceof HashSet)) { - perms = new HashSet<String>(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<Identity> NO_ADDL_APPROVE = new ArrayList<Identity>(); + private static final List<Identity> 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<String>(); + 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<PermDAO.Data> lpdd = new ArrayList<PermDAO.Data>(); + List<PermDAO.Data> lpdd = new ArrayList<>(); for(String p : rdd.perms(false)) { Result<PermDAO.Data> 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<RoleDAO.Data> lrdd = new ArrayList<RoleDAO.Data>(); + List<RoleDAO.Data> lrdd = new ArrayList<>(); for(String rl : pdd.roles(false)) { Result<RoleDAO.Data> 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<String>(); + rd.perms = new HashSet<>(); rd.perms.add(pd.encode()); eb.log(q.roleDAO.create(trans, rd)); - pd.roles = new HashSet<String>(); + 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<String>(); + rd.perms = new HashSet<>(); rd.perms.add(pd.encode()); eb.log(q.roleDAO.create(trans, rd)); - pd.roles = new HashSet<String>(); + 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<RoleDAO.Data> lrdd = new ArrayList<RoleDAO.Data>(); + List<RoleDAO.Data> lrdd = new ArrayList<>(); for(String rl : pdd.roles(false)) { Result<RoleDAO.Data> rrdd = RoleDAO.Data.decode(trans,q,rl); @@ -891,7 +891,7 @@ public class Function { continue; } // Remove old Role from Perms, save them off - List<PermDAO.Data> lpdd = new ArrayList<PermDAO.Data>(); + List<PermDAO.Data> lpdd = new ArrayList<>(); for(String p : rdd.perms(false)) { Result<PermDAO.Data> rpdd = PermDAO.Data.decode(trans,q,p); if(rpdd.isOKhasData()) { @@ -1439,7 +1439,7 @@ public class Function { } Date now = new Date(); List<UserRoleDAO.Data> list = rurdd.value; - List<String> rv = new ArrayList<String>(list.size()); // presize + List<String> 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<Identity> approvers = op.equals(FUTURE_OP.A)?NO_ADDL_APPROVE:org.getApprovers(trans, user); - List<Identity> owners = new ArrayList<Identity>(); + List<Identity> owners = new ArrayList<>(); if (nsd != null) { Result<List<UserRoleDAO.Data>> 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<String, PermLookup> permMap = trans.get(Question.PERMS, null); if (permMap == null) { - trans.put(Question.PERMS, permMap = new HashMap<String, PermLookup>()); + 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<UserRoleDAO.Data> lurdd = new ArrayList<UserRoleDAO.Data>(); + List<UserRoleDAO.Data> 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<List<UserRoleDAO.Data>> rur = getUserRoles(); if(rur.isOK()) { - List<RoleDAO.Data> lrdd = new ArrayList<RoleDAO.Data>(); + List<RoleDAO.Data> 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<List<RoleDAO.Data>> rlrd = getRoles(); if (rlrd.isOK()) { - Set<String> pns = new TreeSet<String>(); + Set<String> 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<Set<String>> rss = getPermNames(); if(rss.isOK()) { - List<PermDAO.Data> lpdd = new ArrayList<PermDAO.Data>(); + List<PermDAO.Data> lpdd = new ArrayList<>(); for (String perm : rss.value) { if(lookup) { Result<String[]> 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<String>(); + nss = new TreeSet<>(); PermLookup fUser = PermLookup.get(trans, this, forUser); Result<Set<String>> forUpn = fUser.getPermNames(); if(forUpn.notOK()) { @@ -252,7 +252,7 @@ public class Question { } } - List<PermDAO.Data> rlpUser = new ArrayList<PermDAO.Data>(); + List<PermDAO.Data> rlpUser = new ArrayList<>(); Result<PermDAO.Data> 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<String> permNames = new HashSet<String>(); + Set<String> 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<PermDAO.Data> perms = new ArrayList<PermDAO.Data>(); + List<PermDAO.Data> perms = new ArrayList<>(); for (String perm : permNames) { Result<PermDAO.Data> 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<CredDAO.Data> cddl; if(result.value.size() > 1) { - cddl = new ArrayList<CredDAO.Data>(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<String>(); + 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> { AuthzTrans trans = env.newTransNoAvg(); Result<List<Data>> rl = ldao.readByName(trans, name); if(rl.isOK()) { - LinkedList<EP> epl = new LinkedList<EP>(); + LinkedList<EP> 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<Trans, DataStub> cached = new Cached<Trans, DataStub>(ciDaoMock, name, 5, 30000L); - cached.add("test", new ArrayList<DataStub>()); + 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<Resettable> resetExceptions = new ArrayList<Resettable>(); + //private static final List<Resettable> 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<AuthzEnv, AuthzTrans> { private static final String USER_PERMS = "userPerms"; - private static final Map<String,CA> certAuths = new TreeMap<String,CA>(); + private static final Map<String,CA> 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<String, Dated> 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<String> EMPTY = Collections.unmodifiableSet(new HashSet<String>()); + public static final Set<String> 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<RDN> parse(final char delim, final String dnString ) throws CertException { - List<RDN> lrnd = new ArrayList<RDN>(); + List<RDN> lrnd = new ArrayList<>(); StringBuilder sb = new StringBuilder(); boolean inQuotes = false; for(int i=0;i<dnString.length();++i) { diff --git a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/facade/FacadeImpl.java b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/facade/FacadeImpl.java index 51a905a4..794f63a6 100644 --- a/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/facade/FacadeImpl.java +++ b/auth/auth-certman/src/main/java/org/onap/aaf/auth/cm/facade/FacadeImpl.java @@ -365,7 +365,7 @@ public abstract class FacadeImpl<REQ,CERT,ARTIFACTS,ERROR> extends org.onap.aaf. jks.load(null, cap); // Get the Cert(s)... Might include Trust store - List<String> lcerts = new ArrayList<String>(); + List<String> 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<BaseRequest,CertInfo,Artifacts,Error> { */ @Override public List<ArtiDAO.Data> toArtifact(AuthzTrans trans, Artifacts artifacts) { - List<ArtiDAO.Data> ladd = new ArrayList<ArtiDAO.Data>(); + List<ArtiDAO.Data> 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<String> notes = null; - List<String> fqdns = new ArrayList<String>(req.value.fqdns); + List<String> 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<String> potentialSanNames = new HashSet<String>(); + Set<String> 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<String>();} +// 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<String>()); + 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<Cmd> cmds; // Lex State - private ArrayList<Integer> expect = new ArrayList<Integer>(); + private ArrayList<Integer> expect = new ArrayList<>(); private boolean verbose = true; private int delay; private SecurityInfoC<HttpURLConnection> si; @@ -113,7 +113,7 @@ public class AAFcli { /* * Create Cmd Tree */ - cmds = new ArrayList<Cmd>(); + 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<String> arr = new ArrayList<String>(); + ArrayList<String> 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<CMD extends Cmd> extends Cmd { public BaseCmd(AAFcli aafcli, String name, Param ... params) { super(aafcli, null, name, params); - cmds = new ArrayList<Cmd>(); + cmds = new ArrayList<>(); } public BaseCmd(CMD parent, String name, Param ... params) { super(parent.aafcli, parent, name, params); - cmds = new ArrayList<Cmd>(); + 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<Cmd> children; - private final static ConcurrentHashMap<Class<?>,RosettaDF<?>> dfs = new ConcurrentHashMap<Class<?>,RosettaDF<?>>(); + private final static ConcurrentHashMap<Class<?>,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<Cmd>(); + 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<Nss> fn = client.read("/authz/nss/"+ns,getDF(Nss.class)); if(fn.get(AAFcli.timeout())) { if(fn.value!=null) { - Set<String> uset = detail?null:new HashSet<String>(); + Set<String> uset = detail?null:new HashSet<>(); for(Ns n : fn.value.getNs()) { Future<Roles> 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<Nss> fn = client.read("/authz/nss/"+ns,getDF(Nss.class)); if(fn.get(AAFcli.timeout())) { if(fn.value!=null) { - Set<String> uset = detail?null:new HashSet<String>(); + Set<String> uset = detail?null:new HashSet<>(); for(Ns n : fn.value.getNs()) { Future<Roles> 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<Nss> fn = client.read("/authz/nss/"+ns,getDF(Nss.class)); if(fn.get(AAFcli.timeout())) { if(fn.value!=null) { - Set<String> uset = detail?null:new HashSet<String>(); + Set<String> uset = detail?null:new HashSet<>(); for(Ns n : fn.value.getNs()) { Future<Perms> 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<Nss.Ns>(); + 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<Nss.Ns.Attrib>(); + this.attrib = new ArrayList<>(); } this.attrib.add(attrib); } public void addResponsible(String str) { if (this.responsible == null) { - this.responsible = new ArrayList<String>(); + this.responsible = new ArrayList<>(); } this.responsible.add(str); } public void addAdmin(String str) { if (this.admin == null) { - this.admin = new ArrayList<String>(); + 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<aaf.v2_0.Role>(); + 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<Pkey>(); + 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<Integer> entries = new ArrayList<Integer>(); + List<Integer> 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<Idx> list = new LinkedList<Idx>(); // Some hashcodes will double... DO NOT make a set + List<Idx> 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<Identity> nullList = new ArrayList<Identity>(); - private final Set<String> nullStringSet = new HashSet<String>(); + private final List<Identity> nullList = new ArrayList<>(); + private final Set<String> nullStringSet = new HashSet<>(); private String[] nullStringArray = new String[0]; private final Identity nullIdentity = new Identity() { - List<String> nullUser = new ArrayList<String>(); + List<String> 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<String,Organization> orgs = new ConcurrentHashMap<String,Organization>(); + private static Map<String,Organization> 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<TRANS extends Trans> { public Acceptor(List<Pair<String, Pair<HttpCode<TRANS,?>, List<Pair<String, Object>>>>> types) { this.types = types; - acceptable = new ArrayList<Pair<String, Pair<HttpCode<TRANS,?>, List<Pair<String, Object>>>>>(); + acceptable = new ArrayList<>(); } private boolean eval(HttpCode<TRANS,?> code, String str, List<String> props) { @@ -128,7 +128,7 @@ class Acceptor<TRANS extends Trans> { int cis,cie=-1,cend; int sis,sie,send; String name; - ArrayList<String> props = new ArrayList<String>(); + ArrayList<String> 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<TRANS extends Trans> extends HttpCode<TRANS, Void public CachingFileAccess(EnvJAXB env, String ... args) throws IOException { super(null,"Caching File Access"); setEnv(env,args); - content = new ConcurrentSkipListMap<String,Content>(); // multi-thread changes possible + content = new ConcurrentSkipListMap<>(); // multi-thread changes possible - attachOnly = new HashSet<String>(); // short, unchanged + attachOnly = new HashSet<>(); // short, unchanged - typeMap = new TreeMap<String,String>(); // 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<TRANS extends Trans> extends HttpCode<TRANS, Void public void run() { int size = content.size(); if(size>maxSize) { - ArrayList<Comp> scont = new ArrayList<Comp>(size); + ArrayList<Comp> scont = new ArrayList<>(size); Object[] entries = content.entrySet().toArray(); for(int i=0;i<size;++i) { scont.add(i, new Comp((Map.Entry<String,Content>)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<String,Integer>(); + 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<String> contextTypes = new ArrayList<String>(); + public final List<String> 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<TRANS extends Trans> { } public List<RouteReport> routeReport() { - ArrayList<RouteReport> ltr = new ArrayList<RouteReport>(); + ArrayList<RouteReport> ltr = new ArrayList<>(); for(int i=0;i<end;++i) { ltr.add(routes[i].api()); } diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/TypedCode.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/TypedCode.java index 82b291c7..4425886c 100644 --- a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/TypedCode.java +++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/TypedCode.java @@ -59,7 +59,7 @@ public class TypedCode<TRANS extends Trans> extends Content<TRANS> { private List<Pair<String, Pair<HttpCode<TRANS,?>,List<Pair<String, Object>>>>> types; public TypedCode() { - types = new ArrayList<Pair<String,Pair<HttpCode<TRANS,?>,List<Pair<String,Object>>>>>(); + types = new ArrayList<>(); } /** @@ -88,7 +88,7 @@ public class TypedCode<TRANS extends Trans> extends Content<TRANS> { @Override protected Pair<String, Pair<HttpCode<TRANS,?>, List<Pair<String, Object>>>> types(HttpCode<TRANS,?> code, String str) { Pair<String, Pair<HttpCode<TRANS,?>,List<Pair<String, Object>>>> type = null; - ArrayList<Pair<String, Object>> props = new ArrayList<Pair<String,Object>>(); + ArrayList<Pair<String, Object>> 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<String,Object>(Q,1f)); Pair<HttpCode<TRANS,?>, List<Pair<String,Object>>> cl = new Pair<HttpCode<TRANS,?>, List<Pair<String,Object>>>(code, props); @@ -227,7 +227,7 @@ public class TypedCode<TRANS extends Trans> extends Content<TRANS> { public void api(RouteReport tr) { // Need to build up a map, because Prop entries can be in several places. - HashMap<HttpCode<?,?>,StringBuilder> psb = new HashMap<HttpCode<?,?>,StringBuilder>(); + HashMap<HttpCode<?,?>,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<String>(); + 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<String> col1 = new ArrayList(); List<String> list1 = new ArrayList(); - Set<String> set1 = new HashSet<String>(); + Set<String> 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<String> list = new ArrayList<String>(); +// List<String> 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<String,org.onap.aaf.auth.rserv.Content> content = new ConcurrentSkipListMap<String,org.onap.aaf.auth.rserv.Content>(); + NavigableMap<String,org.onap.aaf.auth.rserv.Content> content = new ConcurrentSkipListMap<>(); cachingFileAccess.cleanupParams(50, 500); //TODO: find right input } @@ -170,7 +170,7 @@ public class JU_CachingFileAccess { @Test public void testInvalidate() { - //NavigableMap<String,org.onap.aaf.auth.rserv.Content> content = new ConcurrentSkipListMap<String,org.onap.aaf.auth.rserv.Content>(); + //NavigableMap<String,org.onap.aaf.auth.rserv.Content> 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<String>(); + 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<String> NULL_DELEGATES = new ArrayList<String>(); + static final List<String> NULL_DELEGATES = new ArrayList<>(); public Identities identities; private boolean dryRun; @@ -135,7 +135,7 @@ public class DefaultOrg implements Organization { private final static Set<String> typeSet; static { - typeSet = new HashSet<String>(); + 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<String> toList = new ArrayList<String>(); + ArrayList<String> 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<String> ccList = new ArrayList<String>(); + ArrayList<String> 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<String> to = new ArrayList<String>(); + List<String> 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<String> cc = new ArrayList<String>(); + List<String> cc = new ArrayList<>(); if(ccList!=null) { if(!ccList.isEmpty()) { @@ -461,7 +461,7 @@ public class DefaultOrg implements Organization { message.addHeader("X-Priority", "1"); } - ArrayList<String> newBody = new ArrayList<String>(); + ArrayList<String> 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<Identity> getApprovers(AuthzTrans trans, String user) throws OrganizationException { Identity orgIdentity = getIdentity(trans, user); - List<Identity> orgIdentitys = new ArrayList<Identity>(); + List<Identity> 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<String,Map<String,Permission>> perms = new HashMap<String,Map<String,Permission>>(); + private final static Map<String,Map<String,Permission>> perms = new HashMap<>(); public String name() { return bcName; @@ -379,7 +379,7 @@ public class Page extends HTMLCacheGen { Map<String,Permission> msp = perms.get(instance); Permission p; if(msp==null) { - msp = new HashMap<String,Permission>(); + 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<AbsCell[]> ns = new ArrayList<AbsCell[]>(); - final ArrayList<AbsCell[]> perms = new ArrayList<AbsCell[]>(); - final ArrayList<AbsCell[]> roles = new ArrayList<AbsCell[]>(); - final ArrayList<AbsCell[]> user = new ArrayList<AbsCell[]>(); - final ArrayList<AbsCell[]> aafOnly = new ArrayList<AbsCell[]>(); - final ArrayList<AbsCell[]> rv = new ArrayList<AbsCell[]>(); + final ArrayList<AbsCell[]> ns = new ArrayList<>(); + final ArrayList<AbsCell[]> perms = new ArrayList<>(); + final ArrayList<AbsCell[]> roles = new ArrayList<>(); + final ArrayList<AbsCell[]> user = new ArrayList<>(); + final ArrayList<AbsCell[]> aafOnly = new ArrayList<>(); + final ArrayList<AbsCell[]> 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<AbsCell[]> rv = new ArrayList<AbsCell[]>(); + final ArrayList<AbsCell[]> rv = new ArrayList<>(); final TimeTaken tt = trans.start("AAF X509 Details",Env.REMOTE); try { gui.cmClientAsUser(trans.getUserPrincipal(),new Retryable<Void>() { 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<AbsCell[]> rv = new ArrayList<AbsCell[]>(); + final ArrayList<AbsCell[]> rv = new ArrayList<>(); final TimeTaken tt = trans.start("AAF Cred Details",Env.REMOTE); List<Artifact> la; try { @@ -164,7 +164,7 @@ public class CredDetail extends Page { } }); - final Set<String> lns = new HashSet<String>(); + final Set<String> lns = new HashSet<>(); if(la!=null) { for(Artifact a : la){ lns.add(a.getMechid()); @@ -176,7 +176,7 @@ public class CredDetail extends Page { Future<Users> fu = client.read("/authn/creds/ns/"+ns,gui.getDF(Users.class)); if(fu.get(AAFcli.timeout())) { // Organize User entries - Map<String,List<Map<Integer,List<User>>>> users = new HashMap<String,List<Map<Integer,List<User>>>>(); + Map<String,List<Map<Integer,List<User>>>> users = new HashMap<>(); List<Map<Integer,List<User>>> lmu=null; Map<Integer, List<User>> 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<Map<Integer,List<User>>>()); + users.put(u.getId(),lmu=new ArrayList<>()); } mu=null; for(Map<Integer,List<User>> xmu : lmu) { @@ -198,12 +198,12 @@ public class CredDetail extends Page { } if(mu==null) { - lmu.add(mu=new HashMap<Integer,List<User>>()); + lmu.add(mu=new HashMap<>()); } lu = mu.get(u.getType()); if(lu==null) { - mu.put(u.getType(),lu = new ArrayList<User>()); + 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<AbsCell[]> rv = new ArrayList<AbsCell[]>(); + final ArrayList<AbsCell[]> 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<String> roles = new ArrayList<String>(); + List<String> 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<String> perms = new ArrayList<String>(); + List<String> 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<AbsCell[]> rv = new ArrayList<AbsCell[]>(); + final ArrayList<AbsCell[]> 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<AbsCell[]> rv = new ArrayList<AbsCell[]>(); + ArrayList<AbsCell[]> rv = new ArrayList<>(); List<Ns> 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<AbsCell[]> rv = new ArrayList<AbsCell[]>(); + final ArrayList<AbsCell[]> rv = new ArrayList<>(); try { gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Void>() { @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<AbsCell[]> rv = new ArrayList<AbsCell[]>(); + final ArrayList<AbsCell[]> 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<String> getMyRoles(final AAF_GUI gui, final AuthzTrans trans) { - final List<String> myRoles = new ArrayList<String>(); + final List<String> myRoles = new ArrayList<>(); try { gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Void>() { @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<AbsCell[]> rv = new ArrayList<AbsCell[]>(); + final ArrayList<AbsCell[]> rv = new ArrayList<>(); String msg = null; try { gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Void>() { 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<AbsCell[]> rv = new ArrayList<AbsCell[]>(); + final ArrayList<AbsCell[]> rv = new ArrayList<>(); TimeTaken tt = trans.start("AAF Perms by User",Env.REMOTE); try { gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Void>() { 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<AbsCell[]> rv = new ArrayList<AbsCell[]>(); + ArrayList<AbsCell[]> rv = new ArrayList<>(); try { Future<Approvals> 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<AbsCell[]> rv = new ArrayList<AbsCell[]>(); + ArrayList<AbsCell[]> 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<Boolean>() { @Override public Boolean code(Rcli<?> client) throws CadiException, ConnectException, APIException { - List<TypedFuture> ltf = new ArrayList<TypedFuture>(); + List<TypedFuture> ltf = new ArrayList<>(); String text; Map<String, String[]> pm = (Map<String, String[]>)req.getParameterMap(); for(final Entry<String, String[]> 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<Cells>() { @Override public Cells code(Rcli<?> client) throws CadiException, ConnectException, APIException { - ArrayList<AbsCell[]> rv = new ArrayList<AbsCell[]>(); + ArrayList<AbsCell[]> 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<IN,OUT,ENDPOINTS,MGMT_ENDPOINTS,CONFIGURA private static long cacheClear = 0L, emptyCheck=0L; - private final static Map<String,String> epsCache = new HashMap<String, String>(); // protected manually, in getEndpoints + private final static Map<String,String> epsCache = new HashMap<>(); // protected manually, in getEndpoints public LocateFacadeImpl(AuthzEnv env, LocateService<IN,OUT,ENDPOINTS,MGMT_ENDPOINTS,CONFIGURATION,ERROR> 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<MgmtEndpoint> mgmtEndPoints = new ArrayList<MgmtEndpoint>();
+ List<MgmtEndpoint> 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<String> subProtocol = new ArrayList<String>();
+ List<String> 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<String> subprotocol = new ArrayList<String>();
+ List<String> subprotocol = new ArrayList<>();
when(endpoint.getSubprotocol()).thenReturn(subprotocol);
- List<Endpoint> endpointList = new ArrayList<Endpoint>();
+ List<Endpoint> 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> specialPorts = new ArrayList<SpecialPorts>();
+ List<SpecialPorts> specialPorts = new ArrayList<>();
specialPorts.add(null);
when(mgmtEndpoint.getSpecialPorts()).thenReturn(specialPorts);
- List<MgmtEndpoint> mgmtEndpoints = new ArrayList<MgmtEndpoint>();
+ List<MgmtEndpoint> 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> specialPorts = new ArrayList<SpecialPorts>();
+ List<SpecialPorts> specialPorts = new ArrayList<>();
specialPorts.add(specialPort);
when(specialPort.getName()).thenReturn("Port1");
when(specialPort.getProtocol()).thenReturn("HTTP");
when(specialPort.getPort()).thenReturn(9090);
- List<String> versions = new ArrayList<String>();
+ List<String> versions = new ArrayList<>();
versions.add("1");
when(specialPort.getProtocolVersions()).thenReturn(versions);
when(mgmtEndpoint.getSpecialPorts()).thenReturn(specialPorts);
- List<MgmtEndpoint> mgmtEndpoints = new ArrayList<MgmtEndpoint>();
+ List<MgmtEndpoint> 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 <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS if(urd.notOKorIsEmpty()) { return Result.err(urd); } - Map<String, Namespace> lm = new HashMap<String,Namespace>(); - Map<String, Namespace> other = full || endsWith==null?null:new TreeMap<String,Namespace>(); + Map<String, Namespace> lm = new HashMap<>(); + Map<String, Namespace> 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 <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS } if(namespace==null) { namespace = new Namespace(nsd.value); - namespace.admin=new ArrayList<String>(); - namespace.owner=new ArrayList<String>(); + 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 <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS return Result.err(rnd); } - Set<Namespace> lm = new HashSet<Namespace>(); + Set<Namespace> lm = new HashSet<>(); Result<List<NsDAO.Data>> rlnd = ques.nsDAO.dao().getChildren(trans, parent); if(rlnd.isOK()) { if(rlnd.isEmpty()) { @@ -1301,7 +1301,7 @@ public class AuthzCassServiceImpl <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS } // Create a set of Update Roles, which are in Internal Format - Set<String> updtRoles = new HashSet<String>(); + Set<String> updtRoles = new HashSet<>(); Result<NsSplit> nss; for(String role : updt.value.roles(false)) { nss = ques.deriveNsSplit(trans, role); @@ -3114,7 +3114,7 @@ public class AuthzCassServiceImpl <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS // filter = false; // Get list of roles per user, then add to Roles as we go - HashSet<UserRoleDAO.Data> userSet = new HashSet<UserRoleDAO.Data>(); + HashSet<UserRoleDAO.Data> userSet = new HashSet<>(); Result<List<UserRoleDAO.Data>> rlurd = ques.userRoleDAO.readByRole(trans, role); if(rlurd.isOK()) { for(UserRoleDAO.Data data : rlurd.value) { @@ -3186,7 +3186,7 @@ public class AuthzCassServiceImpl <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS List<UserRoleDAO.Data> content; if(mustFilter) { - content = new ArrayList<UserRoleDAO.Data>(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 <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS return Result.err(Status.ERR_BadData,v.errs()); } - Set<String> currRoles = new HashSet<String>(); + Set<String> currRoles = new HashSet<>(); Result<List<UserRoleDAO.Data>> rlurd = ques.userRoleDAO.readByUser(trans, rurdd.value.user); if(rlurd.isOK()) { for(UserRoleDAO.Data data : rlurd.value) { @@ -3325,7 +3325,7 @@ public class AuthzCassServiceImpl <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS return Result.err(nsr); } - Set<String> currUsers = new HashSet<String>(); + Set<String> currUsers = new HashSet<>(); Result<List<UserRoleDAO.Data>> rlurd = ques.userRoleDAO.readByRole(trans, rurdd.value.role); if(rlurd.isOK()) { for(UserRoleDAO.Data data : rlurd.value) { @@ -3541,7 +3541,7 @@ public class AuthzCassServiceImpl <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS return Result.err(rnd); } - HashSet<UserRoleDAO.Data> userSet = new HashSet<UserRoleDAO.Data>(); + HashSet<UserRoleDAO.Data> userSet = new HashSet<>(); Result<List<UserRoleDAO.Data>> rlurd = ques.userRoleDAO.readUserInRole(trans, user, role); if(rlurd.isOK()) { for(UserRoleDAO.Data data : rlurd.value) { @@ -3593,7 +3593,7 @@ public class AuthzCassServiceImpl <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS } } - HashSet<UserRoleDAO.Data> userSet = new HashSet<UserRoleDAO.Data>(); + HashSet<UserRoleDAO.Data> userSet = new HashSet<>(); Result<List<UserRoleDAO.Data>> rlurd = ques.userRoleDAO.readByRole(trans, role); if(rlurd.isOK()) { for(UserRoleDAO.Data data : rlurd.value) { @@ -3657,8 +3657,8 @@ public class AuthzCassServiceImpl <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS // Get list of roles per Permission, // Then loop through Roles to get Users // Note: Use Sets to avoid processing or responding with Duplicates - Set<String> roleUsed = new HashSet<String>(); - Set<UserRoleDAO.Data> userSet = new HashSet<UserRoleDAO.Data>(); + Set<String> roleUsed = new HashSet<>(); + Set<UserRoleDAO.Data> userSet = new HashSet<>(); if(!nss.isEmpty()) { Result<List<PermDAO.Data>> rlp = ques.permDAO.readByType(trans, nss.value.ns, nss.value.name); @@ -4025,8 +4025,8 @@ public class AuthzCassServiceImpl <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS } if(curr.isOKhasData()) { - Map<String, Result<List<DelegateDAO.Data>>> delegateCache = new HashMap<String, Result<List<DelegateDAO.Data>>>(); - Map<UUID, FutureDAO.Data> futureCache = new HashMap<UUID, FutureDAO.Data>(); + Map<String, Result<List<DelegateDAO.Data>>> delegateCache = new HashMap<>(); + Map<UUID, FutureDAO.Data> futureCache = new HashMap<>(); FutureDAO.Data hasDeleted = new FutureDAO.Data(); for(ApprovalDAO.Data cd : curr.value) { @@ -4177,7 +4177,7 @@ public class AuthzCassServiceImpl <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS return Result.err(Status.ERR_BadData,v.errs()); } - List<ApprovalDAO.Data> listRapds = new ArrayList<ApprovalDAO.Data>(); + List<ApprovalDAO.Data> listRapds = new ArrayList<>(); Result<List<ApprovalDAO.Data>> 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<Integer> ai= new ArrayList<Integer>(); + ArrayList<Integer> 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<Nss, Perms, Pkey, Roles, Users, UserRo @Override public Result<List<PermDAO.Data>> perms(AuthzTrans trans, Perms perms) { - List<PermDAO.Data> lpd = new ArrayList<PermDAO.Data>(); + List<PermDAO.Data> lpd = new ArrayList<>(); for (Perm p : perms.getPerm()) { Result<NsSplit> nss = q.deriveNsSplit(trans, p.getType()); PermDAO.Data pd = new PermDAO.Data(); @@ -790,7 +790,7 @@ public class Mapper_2_0 implements Mapper<Nss, Perms, Pkey, Roles, Users, UserRo @Override public Result<List<ApprovalDAO.Data>> approvals(Approvals apprs) { - List<ApprovalDAO.Data> lappr = new ArrayList<ApprovalDAO.Data>(); + List<ApprovalDAO.Data> 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<String> permissions = new HashSet<String>(); + Set<String> permissions = new HashSet<>(); permissions.add("perm1"); to.perms = permissions; |