diff options
145 files changed, 350 insertions, 346 deletions
diff --git a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Approval.java b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Approval.java index 7963b022..58aa206e 100644 --- a/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Approval.java +++ b/auth/auth-batch/src/main/java/org/onap/aaf/auth/helpers/Approval.java @@ -114,7 +114,7 @@ public class Approval implements CacheChange.Data { if(person!=null) { ln = byApprover.get(person); if(ln==null) { - ln = new ArrayList<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; diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/AAFPermission.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/AAFPermission.java index e586d991..3b783949 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/AAFPermission.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/AAFPermission.java @@ -39,7 +39,7 @@ public class AAFPermission implements Permission { private List<String> roles; static { - NO_ROLES = new ArrayList<String>(); + NO_ROLES = new ArrayList<>(); } protected AAFPermission() {roles=NO_ROLES;} diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/TestConnectivity.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/TestConnectivity.java index cd08cd4d..d873205c 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/TestConnectivity.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/TestConnectivity.java @@ -133,7 +133,7 @@ public class TestConnectivity { print(true,"Load Security Setters from Configuration Information"); String user = access.getProperty(Config.AAF_APPID); - ArrayList<SecuritySetter<HttpURLConnection>> lss = new ArrayList<SecuritySetter<HttpURLConnection>>(); + ArrayList<SecuritySetter<HttpURLConnection>> lss = new ArrayList<>(); try { diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/cert/AAFListedCertIdentity.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/cert/AAFListedCertIdentity.java index bc1f94d9..abd1c40f 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/cert/AAFListedCertIdentity.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/cert/AAFListedCertIdentity.java @@ -118,9 +118,9 @@ public class AAFListedCertIdentity implements CertIdentity { @Override public void run() { try { - TreeMap<ByteArrayHolder, String> newCertsMap = new TreeMap<ByteArrayHolder,String>(); - Map<String,Set<String>> newTrustMap = new TreeMap<String,Set<String>>(); - Set<String> userLookup = new HashSet<String>(); + TreeMap<ByteArrayHolder, String> newCertsMap = new TreeMap<>(); + Map<String,Set<String>> newTrustMap = new TreeMap<>(); + Set<String> userLookup = new HashSet<>(); for(String s : certIDs) { userLookup.add(s); } @@ -132,7 +132,7 @@ public class AAFListedCertIdentity implements CertIdentity { aafcon.access.log(Level.WARN, "AAF Lookup-No IDs in Role com.att.aaf.trustForID <> "+authMech); } else { aafcon.access.log(Level.INFO,"Loading Trust Authentication Info for",authMech); - Set<String> hsUser = new HashSet<String>(); + Set<String> hsUser = new HashSet<>(); for(User u : users) { userLookup.add(u.getId()); hsUser.add(u.getId()); diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFCon.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFCon.java index 286104eb..b076379c 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFCon.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFCon.java @@ -62,7 +62,7 @@ public abstract class AAFCon<CLIENT> implements Connector { // Package access final public int timeout, cleanInterval, connTimeout; final public int highCount, userExpires, usageRefreshTriggerCount; - private Map<String,Rcli<CLIENT>> clients = new ConcurrentHashMap<String,Rcli<CLIENT>>(); + private Map<String,Rcli<CLIENT>> clients = new ConcurrentHashMap<>(); final public RosettaDF<Perms> permsDF; final public RosettaDF<Certs> certsDF; final public RosettaDF<Users> usersDF; diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFLocator.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFLocator.java index ee649549..4ae1a051 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFLocator.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AAFLocator.java @@ -109,7 +109,7 @@ public class AAFLocator extends AbsAAFLocator<BasicTrans> { client.send(); Future<Endpoints> fr = client.futureRead(epsDF, TYPE.JSON); if(fr.get(client.timeout())) { - List<EP> epl = new LinkedList<EP>(); + List<EP> epl = new LinkedList<>(); for(Endpoint endpoint : fr.value.getEndpoint()) { epl.add(new EP(endpoint,latitude,longitude)); } diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AbsAAFLocator.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AbsAAFLocator.java index 312c58e9..f0909062 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AbsAAFLocator.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AbsAAFLocator.java @@ -75,7 +75,7 @@ public abstract class AbsAAFLocator<TRANS extends Trans> implements Locator<URI> } } - epList = new LinkedList<EP>(); + epList = new LinkedList<>(); refreshWait = refreshMin; this.access = access; @@ -261,7 +261,7 @@ public abstract class AbsAAFLocator<TRANS extends Trans> implements Locator<URI> if(!hasItems()) { throw new LocatorException("No Entries found" + (pathInfo==null?"":(" for " + pathInfo))); } - List<EP> lep = new ArrayList<EP>(); + List<EP> lep = new ArrayList<>(); EP first = null; // Note: Deque is sorted on the way by closest distance Iterator<EP> iter = getIterator(); diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AbsAAFLur.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AbsAAFLur.java index 083537a8..9feeee36 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AbsAAFLur.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/aaf/v2_0/AbsAAFLur.java @@ -132,7 +132,7 @@ public abstract class AbsAAFLur<PERM extends Permission> extends AbsUserCache<PE } else { sb.append("\n\tUser does not contain "); sb.append(pond.getKey()); - List<Permission> perms = new ArrayList<Permission>(); + List<Permission> perms = new ArrayList<>(); user.copyPermsTo(perms); for(Permission p : perms) { sb.append("\n\t\t"); diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java index 3c8719b4..b19be6cd 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/Agent.java @@ -174,7 +174,7 @@ public class Agent { permDF = env.newDataFactory(Perms.class); errMsg = new ErrMessage(env); - placeArtifact = new HashMap<String,PlaceArtifact>(); + placeArtifact = new HashMap<>(); placeArtifact.put(JKS, new PlaceArtifactInKeystore(JKS)); placeArtifact.put(PKCS12, new PlaceArtifactInKeystore(PKCS12)); placeArtifact.put(FILE, new PlaceArtifactInFiles()); diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/ArtifactDir.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/ArtifactDir.java index 74cf4e4b..266ace81 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/ArtifactDir.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/ArtifactDir.java @@ -48,11 +48,11 @@ public abstract class ArtifactDir implements PlaceArtifact { protected static final String C_R = "\n"; protected File dir; - private List<String> encodeds = new ArrayList<String>(); + private List<String> encodeds = new ArrayList<>(); private Symm symm; // This checks for multiple passes of Dir on the same objects. Run clear after done. - protected static Map<String,Object> processed = new HashMap<String,Object>(); + protected static Map<String,Object> processed = new HashMap<>(); /** diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/PlaceArtifactInKeystore.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/PlaceArtifactInKeystore.java index 2a522bc1..cb282605 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/PlaceArtifactInKeystore.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/configure/PlaceArtifactInKeystore.java @@ -64,8 +64,8 @@ public class PlaceArtifactInKeystore extends ArtifactDir { // find where the trusts end in 1.0 API X509Certificate x509; - List<X509Certificate> chainList = new ArrayList<X509Certificate>(); - Set<X509Certificate> caSet = new HashSet<X509Certificate>(); + List<X509Certificate> chainList = new ArrayList<>(); + Set<X509Certificate> caSet = new HashSet<>(); for(Certificate c : certColl) { x509 = (X509Certificate)c; // Is a Root (self-signed, anyway) @@ -98,7 +98,7 @@ public class PlaceArtifactInKeystore extends ArtifactDir { PrivateKey pk = Factory.toPrivateKey(trans, certInfo.getPrivatekey()); addEncProperty(Config.CADI_KEY_PASSWORD, keyPass); addProperty(Config.CADI_ALIAS, arti.getMechid()); -// Set<Attribute> attribs = new HashSet<Attribute>(); +// Set<Attribute> attribs = new HashSet<>(); // if(kst.equals("pkcs12")) { // // Friendly Name // attribs.add(new PKCS12Attribute("1.2.840.113549.1.9.20", arti.getNs())); diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenClient.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenClient.java index dec0b4e9..2ebd7dc1 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenClient.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenClient.java @@ -274,7 +274,7 @@ public class TokenClient { Result<TimedToken> rtt = factory.get(key,hash,new Loader<TimedToken>() { @Override public Result<TimedToken> load(final String key) throws APIException, CadiException, LocatorException { - final List<String> params = new ArrayList<String>(); + final List<String> params = new ArrayList<>(); params.add(scope); addSecurity(params,authn_method); @@ -331,7 +331,7 @@ public class TokenClient { if(ss==null) { throw new APIException("client_creds(...) must be set before obtaining Access Tokens"); } - final List<String> params = new ArrayList<String>(); + final List<String> params = new ArrayList<>(); params.add("refresh_token="+token.getRefreshToken()); addSecurity(params,AUTHN_METHOD.refresh_token); final String scope="scope="+token.getScope().replace(' ', '+'); @@ -373,7 +373,7 @@ public class TokenClient { return tkCon.best(new Retryable<Result<Introspect>>() { @Override public Result<Introspect> code(Rcli<?> client) throws CadiException, ConnectException, APIException { - final List<String> params = new ArrayList<String>(); + final List<String> params = new ArrayList<>(); params.add("token="+token); addSecurity(params,AUTHN_METHOD.client_credentials); final String paramsa[] = new String[params.size()]; diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenClientFactory.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenClientFactory.java index 2b895761..c2848980 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenClientFactory.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenClientFactory.java @@ -54,7 +54,7 @@ import aafoauth.v2_0.Token; public class TokenClientFactory extends Persist<Token,TimedToken> { private static TokenClientFactory instance; - private Map<String,AAFConHttp> aafcons = new ConcurrentHashMap<String, AAFConHttp>(); + private Map<String,AAFConHttp> aafcons = new ConcurrentHashMap<>(); private SecurityInfoC<HttpURLConnection> hsi; // Package on purpose final Symm symm; diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenMgr.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenMgr.java index d8fd88f6..4e781bfa 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenMgr.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenMgr.java @@ -44,9 +44,9 @@ import aaf.v2_0.Perms; import aafoauth.v2_0.Introspect; public class TokenMgr extends Persist<Introspect, TokenPerm> { - protected static Map<String,TokenPerm> tpmap = new ConcurrentHashMap<String, TokenPerm>(); - protected static Map<String,TokenMgr> tmmap = new HashMap<String, TokenMgr>(); // synchronized in getInstance - protected static Map<String,String> currentToken = new HashMap<String,String>(); // synchronized in getTP + protected static Map<String,TokenPerm> tpmap = new ConcurrentHashMap<>(); + protected static Map<String,TokenMgr> tmmap = new HashMap<>(); // synchronized in getInstance + protected static Map<String,String> currentToken = new HashMap<>(); // synchronized in getTP public static RosettaDF<Perms> permsDF; public static RosettaDF<Introspect> introspectDF; diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenPerm.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenPerm.java index 4a0259a4..5c77fda7 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenPerm.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/oauth/TokenPerm.java @@ -42,7 +42,7 @@ import aaf.v2_0.Perms; import aafoauth.v2_0.Introspect; public class TokenPerm extends Persisting<Introspect>{ - private static final List<AAFPermission> NULL_PERMS = new ArrayList<AAFPermission>(); + private static final List<AAFPermission> NULL_PERMS = new ArrayList<>(); private Introspect introspect; private List<AAFPermission> perms; private String scopes; @@ -99,7 +99,7 @@ public class TokenPerm extends Persisting<Introspect>{ while((pd = ij.parse(r,pd.reuse())).valid()) { switch(pd.event) { case Parse.START_DOC: - perms = new ArrayList<AAFPermission>(); + perms = new ArrayList<>(); break; case Parse.START_ARRAY: inPerms = "perm".equals(pd.name); diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/persist/Persist.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/persist/Persist.java index 9754b1e6..11acbe91 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/persist/Persist.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/persist/Persist.java @@ -65,7 +65,7 @@ public abstract class Persist<T,CT extends Persistable<T>> extends PersistFile { super(access, sub_dir); this.env = env; df = env.newDataFactory(cls); - tmap = new ConcurrentHashMap<String, CT>(); + tmap = new ConcurrentHashMap<>(); synchronized(Persist.class) { if(clean==null) { clean = new Timer(true); diff --git a/cadi/aaf/src/main/java/org/onap/aaf/cadi/sso/AAFSSO.java b/cadi/aaf/src/main/java/org/onap/aaf/cadi/sso/AAFSSO.java index f2fb7057..28103b5d 100644 --- a/cadi/aaf/src/main/java/org/onap/aaf/cadi/sso/AAFSSO.java +++ b/cadi/aaf/src/main/java/org/onap/aaf/cadi/sso/AAFSSO.java @@ -454,7 +454,7 @@ public class AAFSSO { private List<String> parseArgs(String[] args) { - List<String> larg = new ArrayList<String>(args.length); + List<String> larg = new ArrayList<>(args.length); // Cover for bash's need to escape *.. (\\*) // also, remove SSO if required diff --git a/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/test/JU_AAFPermission.java b/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/test/JU_AAFPermission.java index 10958a23..4836e4ed 100644 --- a/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/test/JU_AAFPermission.java +++ b/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/test/JU_AAFPermission.java @@ -44,7 +44,7 @@ public class JU_AAFPermission { @Before public void setup() { - roles = new ArrayList<String>(); + roles = new ArrayList<>(); roles.add(role); } diff --git a/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/v2_0/test/JU_AAFLocator.java b/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/v2_0/test/JU_AAFLocator.java index 3b2ce7b1..eeb9c623 100644 --- a/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/v2_0/test/JU_AAFLocator.java +++ b/cadi/aaf/src/test/java/org/onap/aaf/cadi/aaf/v2_0/test/JU_AAFLocator.java @@ -97,7 +97,7 @@ public class JU_AAFLocator { public static void tearDownAfterClass() throws Exception { Field field = SecurityInfoC.class.getDeclaredField("sicMap"); field.setAccessible(true); - field.set(null, new HashMap<Class<?>,SecurityInfoC<?>>()); + field.set(null, new HashMap<>()); } @Test diff --git a/cadi/aaf/src/test/java/org/onap/aaf/cadi/cm/test/JU_Factory.java b/cadi/aaf/src/test/java/org/onap/aaf/cadi/cm/test/JU_Factory.java index b47abe2c..5827e8c0 100644 --- a/cadi/aaf/src/test/java/org/onap/aaf/cadi/cm/test/JU_Factory.java +++ b/cadi/aaf/src/test/java/org/onap/aaf/cadi/cm/test/JU_Factory.java @@ -238,7 +238,7 @@ public class JU_Factory { output = Factory.toString(transMock, certs.toArray(new Certificate[0])[0]); assertThat(output, is(certString)); - List<String> certStrings = new ArrayList<String>(); + List<String> certStrings = new ArrayList<>(); certStrings.add(certString); certStrings.add(certString); certs = Factory.toX509Certificate(certStrings); @@ -318,7 +318,7 @@ public class JU_Factory { private String cleanupString(String str) { String[] lines = str.split("\n", 0); - List<String> rawLines = new ArrayList<String>(); + List<String> rawLines = new ArrayList<>(); for (int i = 0; i < lines.length - 2; i++) { rawLines.add(lines[i + 1]); } diff --git a/cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_OAuthTest.java b/cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_OAuthTest.java index a30f274f..555eda41 100644 --- a/cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_OAuthTest.java +++ b/cadi/aaf/src/test/java/org/onap/aaf/cadi/oauth/test/JU_OAuthTest.java @@ -79,7 +79,7 @@ public class JU_OAuthTest { public static void tearDownAfterClass() throws Exception { Field field = SecurityInfoC.class.getDeclaredField("sicMap"); field.setAccessible(true); - field.set(null, new HashMap<Class<?>,SecurityInfoC<?>>()); + field.set(null, new HashMap<>()); } @Before diff --git a/cadi/aaf/src/test/java/org/onap/aaf/client/sample/Sample.java b/cadi/aaf/src/test/java/org/onap/aaf/client/sample/Sample.java index ff170772..45a7d341 100644 --- a/cadi/aaf/src/test/java/org/onap/aaf/client/sample/Sample.java +++ b/cadi/aaf/src/test/java/org/onap/aaf/client/sample/Sample.java @@ -105,7 +105,7 @@ public class Sample { } public List<Permission> allAuthorization(Principal fqi) { - List<Permission> pond = new ArrayList<Permission>(); + List<Permission> pond = new ArrayList<>(); aafLur.fishAll(fqi, pond); return pond; } diff --git a/cadi/client/src/main/java/org/onap/aaf/cadi/http/HClient.java b/cadi/client/src/main/java/org/onap/aaf/cadi/http/HClient.java index df8cacf4..a3dac7da 100644 --- a/cadi/client/src/main/java/org/onap/aaf/cadi/http/HClient.java +++ b/cadi/client/src/main/java/org/onap/aaf/cadi/http/HClient.java @@ -93,7 +93,7 @@ public class HClient implements EClient<HttpURLConnection> { @Override public void addHeader(String tag, String value) { if (headers == null) - headers = new ArrayList<Header>(); + headers = new ArrayList<>(); headers.add(new Header(tag, value)); } diff --git a/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java b/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java index 4591122c..b75e8bc2 100644 --- a/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java +++ b/cadi/client/src/main/java/org/onap/aaf/cadi/locator/PropertyLocator.java @@ -65,7 +65,7 @@ public class PropertyLocator implements Locator<URI> { throw new LocatorException("No Location List given for PropertyLocator"); } String[] locarray = Split.split(',',locList); - List<URI> uriList = new ArrayList<URI>(); + List<URI> uriList = new ArrayList<>(); random = new SecureRandom(); @@ -177,7 +177,7 @@ public class PropertyLocator implements Locator<URI> { public synchronized boolean refresh() { if(System.currentTimeMillis()>lastRefreshed) { // Build up list - List<URI> resolve = new ArrayList<URI>(); + List<URI> resolve = new ArrayList<>(); String realname; for(int i = 0; i < orig.length ; ++i) { try { diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/AbsUserCache.java b/cadi/core/src/main/java/org/onap/aaf/cadi/AbsUserCache.java index c65a9b22..1d01a3e8 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/AbsUserCache.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/AbsUserCache.java @@ -55,7 +55,7 @@ public abstract class AbsUserCache<PERM extends Permission> { private static Timer timer; // Map of userName to User private final Map<String, User<PERM>> userMap; - private static final Map<String, Miss> missMap = new TreeMap<String,Miss>(); + private static final Map<String, Miss> missMap = new TreeMap<>(); private final Symm missEncrypt; private Clean clean; @@ -73,7 +73,7 @@ public abstract class AbsUserCache<PERM extends Permission> { } missEncrypt = s; - userMap = new ConcurrentHashMap<String, User<PERM>>(); + userMap = new ConcurrentHashMap<>(); if(cleanInterval>0) { @@ -236,7 +236,7 @@ public abstract class AbsUserCache<PERM extends Permission> { } public final List<DumpInfo> dumpInfo() { - List<DumpInfo> rv = new ArrayList<DumpInfo>(); + List<DumpInfo> rv = new ArrayList<>(); for(User<PERM> user : userMap.values()) { rv.add(new DumpInfo(user)); } @@ -265,7 +265,7 @@ public abstract class AbsUserCache<PERM extends Permission> { // Simple map of Group name to a set of User Names - // private Map<String, Set<String>> groupMap = new HashMap<String, Set<String>>(); + // private Map<String, Set<String>> groupMap = new HashMap<>(); /** * Class to hold a small subset of the data, because we don't want to expose actual Permission or User Objects @@ -276,7 +276,7 @@ public abstract class AbsUserCache<PERM extends Permission> { public DumpInfo(User<PERM> user) { this.user = user.principal.getName(); - perms = new ArrayList<String>(user.perms.keySet()); + perms = new ArrayList<>(user.perms.keySet()); } } @@ -315,7 +315,7 @@ public abstract class AbsUserCache<PERM extends Permission> { int total = 0; try { // look at now. If we need to expire more by increasing "now" by "advance" - ArrayList<User<PERM>> al = new ArrayList<User<PERM>>(userMap.values().size()); + ArrayList<User<PERM>> al = new ArrayList<>(userMap.values().size()); al.addAll(0, userMap.values()); long now = System.currentTimeMillis() + advance; for(User<PERM> user : al) { @@ -367,7 +367,7 @@ public abstract class AbsUserCache<PERM extends Permission> { int missTotal = missMap.keySet().size(); int miss = 0; if(missTotal>0) { - ArrayList<String> keys = new ArrayList<String>(missTotal); + ArrayList<String> keys = new ArrayList<>(missTotal); keys.addAll(missMap.keySet()); for(String key : keys) { Miss m = missMap.get(key); diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/CadiWrap.java b/cadi/core/src/main/java/org/onap/aaf/cadi/CadiWrap.java index 49572f4c..a2dfba37 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/CadiWrap.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/CadiWrap.java @@ -140,7 +140,7 @@ public class CadiWrap extends HttpServletRequestWrapper implements HttpServletRe * To utilize, the Request must be a "CadiWrap" object, then call. */ public List<Permission> getPermissions(Principal p) { - List<Permission> perms = new ArrayList<Permission>(); + List<Permission> perms = new ArrayList<>(); lur.fishAll(p, perms); return perms; } diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/Capacitor.java b/cadi/core/src/main/java/org/onap/aaf/cadi/Capacitor.java index 00383851..935e4f14 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/Capacitor.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/Capacitor.java @@ -36,7 +36,7 @@ import java.util.ArrayList; */ public class Capacitor { private static final int DEFAULT_CHUNK = 256; - private ArrayList<ByteBuffer> bbs = new ArrayList<ByteBuffer>(); + private ArrayList<ByteBuffer> bbs = new ArrayList<>(); private ByteBuffer curr = null; private int idx; diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java b/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java index c827477f..5e001561 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/PropAccess.java @@ -184,7 +184,7 @@ public class PropAccess implements Access { String chainProp = props.getProperty(Config.CADI_PROP_FILES); if(chainProp!=null) { if(recursionProtection==null) { - recursionProtection = new ArrayList<String>(); + recursionProtection = new ArrayList<>(); recursionProtection.add(cadi_prop_files); } if(!recursionProtection.contains(chainProp)) { diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/Symm.java b/cadi/core/src/main/java/org/onap/aaf/cadi/Symm.java index 5a3fe825..4067f160 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/Symm.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/Symm.java @@ -138,7 +138,7 @@ public class Symm { // There can be time efficiencies gained when the underlying keyset consists mainly of ordered // data (i.e. abcde...). Therefore, we'll quickly analyze the keyset. If it proves to have // too much entropy, the "Unordered" algorithm, which is faster in such cases is used. - ArrayList<int[]> la = new ArrayList<int[]>(); + ArrayList<int[]> la = new ArrayList<>(); for(int i=0;i<codeset.length;++i) { curr = codeset[i]; if(prev+1==curr) { // is next character in set diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/User.java b/cadi/core/src/main/java/org/onap/aaf/cadi/User.java index 5e9f8a58..34aaf170 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/User.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/User.java @@ -36,7 +36,7 @@ import org.onap.aaf.cadi.lur.LocalPermission; * */ public final class User<PERM extends Permission> { - private static final Map<String,Permission> NULL_MAP = new HashMap<String,Permission>(); + private static final Map<String,Permission> NULL_MAP = new HashMap<>(); public String name; private byte[] cred; public Principal principal; @@ -121,7 +121,7 @@ public final class User<PERM extends Permission> { } public Map<String,Permission> newMap() { - return new ConcurrentHashMap<String,Permission>(); + return new ConcurrentHashMap<>(); } public void add(LocalPermission permission) { diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java index b74ccb36..dfcf7e3d 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/config/Config.java @@ -259,7 +259,7 @@ public class Config { access.log(Level.INIT, "Hostname set to",hostname); // Get appropriate TAFs - ArrayList<HttpTaf> htlist = new ArrayList<HttpTaf>(); + ArrayList<HttpTaf> htlist = new ArrayList<>(); ///////////////////////////////////////////////////// // Add a Denial of Service TAF @@ -507,7 +507,7 @@ public class Config { public static Lur configLur(SecurityInfoC<HttpURLConnection> si, Connector con, Object ... additionalTafLurs) throws CadiException { Access access = si.access; - List<Lur> lurs = new ArrayList<Lur>(); + List<Lur> lurs = new ArrayList<>(); ///////////////////////////////////////////////////// // Configure a Local Property Based RBAC/LUR @@ -671,7 +671,7 @@ public class Config { aafConClass = loadClass(access, AAF_V2_0_AAF_CON_HTTP); if (aafConClass != null) { for (Constructor<?> c : aafConClass.getConstructors()) { - List<Object> lo = new ArrayList<Object>(); + List<Object> lo = new ArrayList<>(); for (Class<?> pc : c.getParameterTypes()) { if (pc.equals(Access.class)) { lo.add(access); diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfoC.java b/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfoC.java index cc366c27..a5fb4a0c 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfoC.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/config/SecurityInfoC.java @@ -31,7 +31,7 @@ import org.onap.aaf.cadi.SecuritySetter; public class SecurityInfoC<CLIENT> extends SecurityInfo { public static final String DEF_ID = "ID not Set"; - private static Map<Class<?>,SecurityInfoC<?>> sicMap = new HashMap<Class<?>,SecurityInfoC<?>>(); + private static Map<Class<?>,SecurityInfoC<?>> sicMap = new HashMap<>(); public SecuritySetter<CLIENT> defSS; public SecurityInfoC(Access access) throws CadiException { diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/config/UsersDump.java b/cadi/core/src/main/java/org/onap/aaf/cadi/config/UsersDump.java index a3e267cd..974e5810 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/config/UsersDump.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/config/UsersDump.java @@ -58,7 +58,7 @@ public class UsersDump { StringBuilder sb = new StringBuilder(); // Obtain all unique role names - HashSet<String> groups = new HashSet<String>(); + HashSet<String> groups = new HashSet<>(); for(AbsUserCache<?>.DumpInfo di : lur.dumpInfo()) { sb.append("\n <user username=\""); sb.append(di.user); diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/filter/CadiFilter.java b/cadi/core/src/main/java/org/onap/aaf/cadi/filter/CadiFilter.java index 1f302c64..237aa28d 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/filter/CadiFilter.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/filter/CadiFilter.java @@ -218,7 +218,7 @@ public class CadiFilter implements Filter { if(map.length>0) { MapPermConverter mpc=null; int idx; - mapPairs = new ArrayList<Pair>(); + mapPairs = new ArrayList<>(); for(String entry : map) { if((idx=entry.indexOf('='))<0) { // it's a Path, so create a new converter access.log(Level.INIT,"Loading Perm Conversions for:",entry); diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/taf/HttpEpiTaf.java b/cadi/core/src/main/java/org/onap/aaf/cadi/taf/HttpEpiTaf.java index 5cd6323d..5b51c111 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/taf/HttpEpiTaf.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/taf/HttpEpiTaf.java @@ -93,7 +93,12 @@ public class HttpEpiTaf implements HttpTaf { TafResp tresp = null; TafResp firstTry = null; List<Redirectable> redirectables = null; - List<TafResp> log = (access.willLog(Level.DEBUG)) ? new ArrayList<TafResp>() : null; + List<TafResp> log; + if(access.willLog(Level.DEBUG)) { + log = new ArrayList<>(); + } else { + log = null; + } try { for (HttpTaf taf : tafs) { tresp = taf.validate(reading, req, resp); diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/taf/cert/X509Taf.java b/cadi/core/src/main/java/org/onap/aaf/cadi/taf/cert/X509Taf.java index dc07bb90..7b7f2db0 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/taf/cert/X509Taf.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/taf/cert/X509Taf.java @@ -86,7 +86,7 @@ public class X509Taf implements HttpTaf { throw new CadiException("X509Taf requires Environment ("+Config.AAF_ENV+") to be set."); } // this.lur = lur; - this.cadiIssuers = new ArrayList<String>(); + this.cadiIssuers = new ArrayList<>(); for(String ci : access.getProperty(Config.CADI_X509_ISSUERS, "").split(":")) { access.printf(Level.INIT, "Trusting Identity for Certificates signed by \"%s\"",ci); cadiIssuers.add(ci); diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/taf/dos/DenialOfServiceTaf.java b/cadi/core/src/main/java/org/onap/aaf/cadi/taf/dos/DenialOfServiceTaf.java index 44a3a4a3..a0d56f67 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/taf/dos/DenialOfServiceTaf.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/taf/dos/DenialOfServiceTaf.java @@ -126,7 +126,7 @@ public class DenialOfServiceTaf implements HttpTaf { public static synchronized boolean denyIP(String ip) { boolean rv = false; if(deniedIP==null) { - deniedIP = new HashMap<String,Counter>(); + deniedIP = new HashMap<>(); deniedIP.put(ip, new Counter(ip)); // Noted duplicated for minimum time spent rv= true; } else if(deniedIP.get(ip)==null) { @@ -170,7 +170,7 @@ public class DenialOfServiceTaf implements HttpTaf { br = new BufferedReader(new FileReader(dosIP)); try { if(deniedIP==null) { - deniedIP=new HashMap<String,Counter>(); + deniedIP=new HashMap<>(); } String line; @@ -215,7 +215,7 @@ public class DenialOfServiceTaf implements HttpTaf { public static synchronized boolean denyID(String id) { boolean rv = false; if(deniedID==null) { - deniedID = new HashMap<String,Counter>(); + deniedID = new HashMap<>(); deniedID.put(id, new Counter(id)); // Noted duplicated for minimum time spent rv = true; } else if(deniedID.get(id)==null) { @@ -260,7 +260,7 @@ public class DenialOfServiceTaf implements HttpTaf { br = new BufferedReader(new FileReader(dosID)); try { if(deniedID==null) { - deniedID=new HashMap<String,Counter>(); + deniedID=new HashMap<>(); } String line; @@ -299,7 +299,7 @@ public class DenialOfServiceTaf implements HttpTaf { int initSize = 0; if(deniedIP!=null)initSize+=deniedIP.size(); if(deniedID!=null)initSize+=deniedID.size(); - ArrayList<String> al = new ArrayList<String>(initSize); + ArrayList<String> al = new ArrayList<>(initSize); if(deniedID!=null) { for(Counter c : deniedID.values()) { al.add(c.toString()); diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/util/Pool.java b/cadi/core/src/main/java/org/onap/aaf/cadi/util/Pool.java index 4312c3ca..7cd7a633 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/util/Pool.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/util/Pool.java @@ -107,7 +107,7 @@ public class Pool<T> { public Pool(Creator<T> creator) { count = spares = 0; this.creator = creator; - list = new LinkedList<Pooled<T>>(); + list = new LinkedList<>(); logger = Log.NULL; } diff --git a/cadi/core/src/main/java/org/onap/aaf/cadi/wsse/XReader.java b/cadi/core/src/main/java/org/onap/aaf/cadi/wsse/XReader.java index 7af475ad..78265e4b 100644 --- a/cadi/core/src/main/java/org/onap/aaf/cadi/wsse/XReader.java +++ b/cadi/core/src/main/java/org/onap/aaf/cadi/wsse/XReader.java @@ -354,14 +354,22 @@ public class XReader { for(Tag tag : t.attribs) { if("xmlns".equals(tag.prefix)) { if(newnss==null) { - newnss = new HashMap<String,String>(); + newnss = new HashMap<>(); if(nss!=null)newnss.putAll(nss); } newnss.put(tag.name, tag.value); } } } - return newnss==null?(nss==null?new HashMap<String,String>():nss):newnss; + //return newnss==null?(nss==null?new HashMap<String,String>():nss):newnss; + if(newnss==null) { + if(nss==null) { + newnss = new HashMap<>(); + } else { + newnss = nss; + } + } + return newnss; } /** @@ -392,7 +400,7 @@ public class XReader { */ public void add(Tag attrib) { if(attribs == null) { - attribs = new ArrayList<Tag>(); + attribs = new ArrayList<>(); } attribs.add(attrib); } diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_AbsUserCache.java b/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_AbsUserCache.java index b2739b9d..11877dea 100644 --- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_AbsUserCache.java +++ b/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_AbsUserCache.java @@ -284,10 +284,10 @@ public class JU_AbsUserCache { assertThat(dumpInfo.size(), is(2)); // Utility lists - List<String> names = new ArrayList<String>(); + List<String> names = new ArrayList<>(); names.add(name1); names.add(name2); - List<String> permissions = new ArrayList<String>(); + List<String> permissions = new ArrayList<>(); permissions.add("NewKey1"); permissions.add("NewKey2"); diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_User.java b/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_User.java index 25683249..2d5ba8d2 100644 --- a/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_User.java +++ b/cadi/core/src/test/java/org/onap/aaf/cadi/test/JU_User.java @@ -158,7 +158,7 @@ public class JU_User { @Test public void addValuesToNewMapTest() { User<Permission> user = new User<Permission>(principal); - Map<String, Permission> newMap = new HashMap<String,Permission>(); + Map<String, Permission> newMap = new HashMap<>(); assertFalse(user.contains(permission)); @@ -167,7 +167,7 @@ public class JU_User { assertTrue(user.contains(permission)); - List<Permission> sink = new ArrayList<Permission>(); + List<Permission> sink = new ArrayList<>(); user.copyPermsTo(sink); assertThat(sink.size(), is(1)); diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Pool.java b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Pool.java index 79209322..b9f0e997 100644 --- a/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Pool.java +++ b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Pool.java @@ -71,7 +71,7 @@ public class JU_Pool { public void getTest() throws CadiException { Pool<Integer> intPool = new Pool<Integer>(new IntegerCreator()); - List<Pooled<Integer>> gotten = new ArrayList<Pooled<Integer>>(); + List<Pooled<Integer>> gotten = new ArrayList<>(); for (int i = 0; i < 10; i++) { gotten.add(intPool.get()); assertThat(gotten.get(i).content, is(i)); diff --git a/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Vars.java b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Vars.java index b2600aa5..551f725d 100644 --- a/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Vars.java +++ b/cadi/core/src/test/java/org/onap/aaf/cadi/util/test/JU_Vars.java @@ -39,21 +39,21 @@ public class JU_Vars { @Test public void convert() { String test = "test"; - List<String> list = new ArrayList<String>(); + List<String> list = new ArrayList<>(); list.add("method"); assertEquals(Vars.convert(test, list), test); } @Test public void convertTest1() { - List<String> list = new ArrayList<String>(); + List<String> list = new ArrayList<>(); list.add("method"); assertEquals(Vars.convert("test", list), "test"); } @Test public void convertTest2() { - List<String> list = new ArrayList<String>(); + List<String> list = new ArrayList<>(); list.add("method"); assertEquals(Vars.convert("test", list), "test"); } diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/StoreImpl.java b/misc/env/src/main/java/org/onap/aaf/misc/env/StoreImpl.java index 54b0ce83..685bfb6e 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/StoreImpl.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/StoreImpl.java @@ -65,21 +65,21 @@ public class StoreImpl implements Store { public StoreImpl() {
staticState = new Object[growSize];
- staticMap = new HashMap<String,StaticSlot>();
- localMap = new HashMap<String,Slot>();
+ staticMap = new HashMap<>();
+ localMap = new HashMap<>();
}
public StoreImpl(String tag) {
staticState = new Object[growSize];
- staticMap = new HashMap<String,StaticSlot>();
- localMap = new HashMap<String,Slot>();
+ staticMap = new HashMap<>();
+ localMap = new HashMap<>();
}
public StoreImpl(String tag, String[] args) {
staticState = new Object[growSize];
- staticMap = new HashMap<String,StaticSlot>();
- localMap = new HashMap<String,Slot>();
+ staticMap = new HashMap<>();
+ localMap = new HashMap<>();
if(tag!=null) {
String tequals = tag + '=';
@@ -102,8 +102,8 @@ public class StoreImpl implements Store { public StoreImpl(String tag, Properties props) {
staticState = new Object[growSize];
- staticMap = new HashMap<String,StaticSlot>();
- localMap = new HashMap<String,Slot>();
+ staticMap = new HashMap<>();
+ localMap = new HashMap<>();
if(tag!=null) {
String fname = props.getProperty(tag);
@@ -191,7 +191,7 @@ public class StoreImpl implements Store { * @see com.att.env.Store#existingSlotNames()
*/
public List<String> existingSlotNames() {
- return new ArrayList<String>(localMap.keySet());
+ return new ArrayList<>(localMap.keySet());
}
/* (non-Javadoc)
@@ -234,7 +234,7 @@ public class StoreImpl implements Store { }
public List<String> existingStaticSlotNames() {
- return new ArrayList<String>(staticMap.keySet());
+ return new ArrayList<>(staticMap.keySet());
}
}
diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java index f10de386..e378e2c3 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/AbsTrans.java @@ -37,7 +37,7 @@ public abstract class AbsTrans<ENV extends Env> implements TransStore { private static final Object[] EMPTYO = new Object[0];
protected ENV delegate;
- protected List<TimeTaken> trail = new ArrayList<TimeTaken>(30);
+ protected List<TimeTaken> trail = new ArrayList<>(30);
private Object[] state;
diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java index 2a3628d3..cd62a7e5 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/impl/BasicEnv.java @@ -84,7 +84,7 @@ public class BasicEnv extends StoreImpl implements EnvJAXB, TransCreate<TransJAX */
public BasicEnv(Applet applet, String ... tags) {
super(null, tags);
-// props = new HashMap<String, String>();
+// props = new HashMap<>();
// String value;
// for(int i=0;i<tags.length;++i) {
// value = applet.getParameter(tags[i]);
diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBmar.java b/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBmar.java index 127eb154..4a01d8b1 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBmar.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBmar.java @@ -64,7 +64,7 @@ import org.onap.aaf.misc.env.util.Pool.Pooled; */
public class JAXBmar {
// Need to store off possible JAXBContexts based on Class, which will be stored in Creator
- private static Map<Class<?>[],Pool<PMarshaller>> pools = new HashMap<Class<?>[], Pool<PMarshaller>>();
+ private static Map<Class<?>[],Pool<PMarshaller>> pools = new HashMap<>();
// Handle Marshaller class setting of properties only when needed
private class PMarshaller {
diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBumar.java b/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBumar.java index 74072aaf..0c078a98 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBumar.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/jaxb/JAXBumar.java @@ -68,7 +68,7 @@ import org.w3c.dom.Node; */
public class JAXBumar {
// Need to store off possible JAXBContexts based on Class, which will be stored in Creator
- private static Map<Class<?>[],Pool<SUnmarshaller>> pools = new HashMap<Class<?>[], Pool<SUnmarshaller>>();
+ private static Map<Class<?>[],Pool<SUnmarshaller>> pools = new HashMap<>();
private Class<?> cls;
private Schema schema;
diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/util/Pool.java b/misc/env/src/main/java/org/onap/aaf/misc/env/util/Pool.java index 1694a011..82f05b4a 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/util/Pool.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/util/Pool.java @@ -104,7 +104,7 @@ public class Pool<T> { public Pool(Creator<T> creator) {
count = spares = 0;
this.creator = creator;
- list = new LinkedList<Pooled<T>>();
+ list = new LinkedList<>();
}
/**
diff --git a/misc/env/src/main/java/org/onap/aaf/misc/env/util/RefreshableThreadObject.java b/misc/env/src/main/java/org/onap/aaf/misc/env/util/RefreshableThreadObject.java index 56cd54e5..6892a4b5 100644 --- a/misc/env/src/main/java/org/onap/aaf/misc/env/util/RefreshableThreadObject.java +++ b/misc/env/src/main/java/org/onap/aaf/misc/env/util/RefreshableThreadObject.java @@ -69,7 +69,7 @@ public class RefreshableThreadObject<T extends Creatable<T>> { * @throws APIException
*/
public RefreshableThreadObject(Class<T> clss) throws APIException {
- objs = new ConcurrentHashMap<Thread,T>();
+ objs = new ConcurrentHashMap<>();
try {
cnst = clss.getConstructor(new Class[]{Env.class} );
} catch (Exception e) {
diff --git a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/InXML.java b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/InXML.java index 48275926..da66394c 100644 --- a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/InXML.java +++ b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/InXML.java @@ -205,7 +205,7 @@ public class InXML implements Parse<Reader, State> { String value = sb.toString(); sb.setLength(0); if(tag !=null && value != null) { - if(props==null)props = new ArrayList<Prop>(); + if(props==null)props = new ArrayList<>(); props.add(new Prop(tag,value)); } } @@ -251,7 +251,7 @@ public class InXML implements Parse<Reader, State> { public void push(Prop prop) { if(attribs==null) { - attribs = new ArrayList<Prop>(); + attribs = new ArrayList<>(); idx = 0; } attribs.add(prop); @@ -291,7 +291,7 @@ public class InXML implements Parse<Reader, State> { private void addNS(Prop prop) { Map<String,String> existingNS = getNS(); - if(ns==null)ns = new HashMap<String,String>(); + if(ns==null)ns = new HashMap<>(); // First make a copy of previous NSs so that we have everything we need, but can overwrite, if necessary if(existingNS!=null && ns!=existingNS) { ns.putAll(ns); diff --git a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxInfo.java b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxInfo.java index 5f38c8c7..6c20ba25 100644 --- a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxInfo.java +++ b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxInfo.java @@ -74,7 +74,7 @@ public class JaxInfo { JaxInfo derived; // Lazy Instantiation if(extensions == null) { - extensions = new HashMap<String,JaxInfo>(); + extensions = new HashMap<>(); derived = null; } else { derived = extensions.get(derivedName); @@ -163,7 +163,7 @@ public class JaxInfo { // Build up Method names from JAXB Annotations XmlType xt; while((xt = cls.getAnnotation(XmlType.class))!=null) { - if(fields==null)fields = new ArrayList<JaxInfo>(); + if(fields==null)fields = new ArrayList<>(); for(String field : xt.propOrder()) { if("".equals(field)) break; // odd bug. "" returned when no fields exist, rather than empty array Field rf = cls.getDeclaredField(field); diff --git a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxSet.java b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxSet.java index bb6784c8..04d61581 100644 --- a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxSet.java +++ b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/JaxSet.java @@ -38,11 +38,11 @@ import javax.xml.bind.annotation.XmlType; * @param <T> */ public class JaxSet<T> { - private static Map<Class<?>,JaxSet<?>> jsets = new HashMap<Class<?>,JaxSet<?>>(); + private static Map<Class<?>,JaxSet<?>> jsets = new HashMap<>(); private Map<String,Setter<T>> members; private JaxSet(Class<?> cls) { - members = new TreeMap<String, Setter<T>>(); + members = new TreeMap<>(); XmlType xmltype = cls.getAnnotation(XmlType.class); Class<?> paramType[] = new Class[] {String.class}; for(String str : xmltype.propOrder()) { @@ -79,7 +79,7 @@ public class JaxSet<T> { @SuppressWarnings("unchecked") JaxSet<X> js = (JaxSet<X>)jsets.get(cls); if(js == null) { - jsets.put(cls, js = new JaxSet<X>(cls)); + jsets.put(cls, js = new JaxSet<>(cls)); } return js; } diff --git a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/OutXML.java b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/OutXML.java index f3ce1c22..8557c584 100644 --- a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/OutXML.java +++ b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/OutXML.java @@ -42,7 +42,7 @@ public class OutXML extends Out{ public OutXML(String root, String ... params) { this.root = root; - props = new ArrayList<Prop>(); + props = new ArrayList<>(); for(String p : params) { String[] tv=p.split("="); if(tv.length==2) @@ -164,7 +164,7 @@ public class OutXML extends Out{ } if(create && !rv) { - if(nses == null) nses = new HashMap<String,String>(); + if(nses == null) nses = new HashMap<>(); nses.put(ns, value); } return rv; diff --git a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/XmlEscape.java b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/XmlEscape.java index f1cde6e5..aac1e30f 100644 --- a/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/XmlEscape.java +++ b/misc/rosetta/src/main/java/org/onap/aaf/misc/rosetta/XmlEscape.java @@ -106,8 +106,8 @@ public class XmlEscape { } static { - charMap = new TreeMap<String, Integer>(); - intMap = new TreeMap<Integer,String>(); + charMap = new TreeMap<>(); + intMap = new TreeMap<>(); charMap.put("quot", 34); charMap.put("amp",38); charMap.put("apos",39); diff --git a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/CacheGen.java b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/CacheGen.java index 74b590da..417f80b7 100644 --- a/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/CacheGen.java +++ b/misc/xgen/src/main/java/org/onap/aaf/misc/xgen/CacheGen.java @@ -42,7 +42,7 @@ public abstract class CacheGen<G extends XGen<G>> { public final static int HTML5 = 0x8;
- private ArrayList<Section<G>> sections = new ArrayList<Section<G>>();
+ private ArrayList<Section<G>> sections = new ArrayList<>();
private int flags;
private final Thematic thematic;
diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML4GenTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML4GenTest.java index 18b33938..9160095d 100644 --- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML4GenTest.java +++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML4GenTest.java @@ -60,7 +60,7 @@ public class JU_HTML4GenTest { gen.html("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : DOCTYPE.toCharArray()) {
Integer times = map.get(ch);
map.put(ch, (times == null ? 0 : times) + 1);
@@ -84,7 +84,7 @@ public class JU_HTML4GenTest { gen.head();
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "head".toCharArray()) {
Integer times = map.get(ch);
@@ -103,7 +103,7 @@ public class JU_HTML4GenTest { gen.body("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "body".toCharArray()) {
Integer times = map.get(ch);
@@ -126,7 +126,7 @@ public class JU_HTML4GenTest { gen.charset(charset);
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : CHARSET_LINE.toCharArray()) {
Integer times = map.get(ch);
@@ -145,7 +145,7 @@ public class JU_HTML4GenTest { gen.header("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "header".toCharArray()) {
Integer times = map.get(ch);
@@ -174,7 +174,7 @@ public class JU_HTML4GenTest { gen.footer("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "footer".toCharArray()) {
Integer times = map.get(ch);
@@ -203,7 +203,7 @@ public class JU_HTML4GenTest { gen.section("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "section".toCharArray()) {
Integer times = map.get(ch);
@@ -232,7 +232,7 @@ public class JU_HTML4GenTest { gen.article("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "attrib".toCharArray()) {
Integer times = map.get(ch);
@@ -261,7 +261,7 @@ public class JU_HTML4GenTest { gen.aside("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "aside".toCharArray()) {
Integer times = map.get(ch);
@@ -290,7 +290,7 @@ public class JU_HTML4GenTest { gen.nav("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "nav".toCharArray()) {
Integer times = map.get(ch);
diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML5GenTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML5GenTest.java index 953a4a3b..69ebf89b 100644 --- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML5GenTest.java +++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/html/JU_HTML5GenTest.java @@ -36,8 +36,8 @@ import org.mockito.Mock; public class JU_HTML5GenTest {
- private final static String DOCTYPE = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
- + " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
+// private final static String DOCTYPE = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\""
+// + " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">";
private String charset = "utf-8";
@@ -59,7 +59,7 @@ public class JU_HTML5GenTest { gen.html("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "html".toCharArray()) {
Integer times = map.get(ch);
@@ -79,7 +79,7 @@ public class JU_HTML5GenTest { gen.head();
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "head".toCharArray()) {
Integer times = map.get(ch);
@@ -98,7 +98,7 @@ public class JU_HTML5GenTest { gen.body("attributes");
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : "body".toCharArray()) {
Integer times = map.get(ch);
@@ -121,7 +121,7 @@ public class JU_HTML5GenTest { gen.charset(charset);
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
for (char ch : CHARSET_LINE.toCharArray()) {
Integer times = map.get(ch);
diff --git a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLGenTest.java b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLGenTest.java index 2dbc422a..1c00b452 100644 --- a/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLGenTest.java +++ b/misc/xgen/src/test/java/org/onap/aaf/misc/xgen/xml/JU_XMLGenTest.java @@ -41,7 +41,7 @@ public class JU_XMLGenTest { String XML_TAG = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>";
- Map<Character, Integer> map = new TreeMap<Character, Integer>();
+ Map<Character, Integer> map = new TreeMap<>();
@Before
public void setUp() throws Exception {
|