X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=ECOMP-PAP-REST%2Fsrc%2Fmain%2Fjava%2Forg%2Fopenecomp%2Fpolicy%2Fpap%2Fxacml%2Frest%2Fcomponents%2FPolicyDBDao.java;h=51fcb3d09dcf76f5bbecbdbc99258622a70ab9b1;hb=87c95be02a8a4d77e165dede90777e811b59dcae;hp=eaceb6575997f3e3f92418c2530398423d286c2c;hpb=7e547eaa55920dfbc9691eab33bb728395b50cf2;p=policy%2Fengine.git diff --git a/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/PolicyDBDao.java b/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/PolicyDBDao.java index eaceb6575..51fcb3d09 100644 --- a/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/PolicyDBDao.java +++ b/ECOMP-PAP-REST/src/main/java/org/openecomp/policy/pap/xacml/rest/components/PolicyDBDao.java @@ -213,7 +213,7 @@ public class PolicyDBDao { */ private List getRemotePolicyDBDaoList(){ logger.debug("getRemotePolicyDBDaoList() as getRemotePolicyDBDaoList() called"); - List policyDBDaoEntityList = new LinkedList(); + List policyDBDaoEntityList = new LinkedList<>(); EntityManager em = emf.createEntityManager(); startTransactionSynced(em, 1000); try{ @@ -375,7 +375,6 @@ public class PolicyDBDao { em.close(); } catch(Exception e2){ PolicyLogger.error(MessageCodes.EXCEPTION_ERROR, e2, "PolicyDBDao", "COULD NOT CREATE DATABASELOCK ROW. WILL TRY ONE MORE TIME"); - e2.printStackTrace(); } em = null; em = emf.createEntityManager(); @@ -446,7 +445,7 @@ public class PolicyDBDao { } public void notifyOthers(long entityId, String entityType, String newGroupId){ logger.debug("notifyOthers(long entityId, String entityType, long newGroupId) as notifyOthers("+entityId+","+entityType+","+newGroupId+") called"); - LinkedList notifyThreads = new LinkedList(); + LinkedList notifyThreads = new LinkedList<>(); //we're going to run notiftions in parellel threads to speed things up for(Object obj : otherServers){ @@ -855,7 +854,7 @@ public class PolicyDBDao { //this must always be true since we don't explicitly know when a delete is occuring boolean didUpdate = true; HashMap currentPolicySet = new HashMap(oldPdpGroup.getPolicies().size()); - HashSet newPolicySet = new HashSet(); + HashSet newPolicySet = new HashSet<>(); for(PDPPolicy pdpPolicy : oldPdpGroup.getPolicies()){ currentPolicySet.put(pdpPolicy.getId(), pdpPolicy); } @@ -1127,7 +1126,7 @@ public class PolicyDBDao { Properties propertyFileProperties = new Properties(); String groupList = ""; String defaultGroup = ""; - HashSet currentGroupPaths = new HashSet(); + HashSet currentGroupPaths = new HashSet<>(); for(Object o : groups){ GroupEntity group = (GroupEntity)o; Path groupPath = Paths.get(pdpsPath.toString(), group.getGroupId()); @@ -1663,7 +1662,7 @@ public class PolicyDBDao { getPolicyEntitiesQuery.setParameter("deleted", false); policyEntityList = getPolicyEntitiesQuery.getResultList(); } catch(Exception e){ - policyEntityList = new LinkedList(); + policyEntityList = new LinkedList<>(); } for (PolicyEntity policy: policyEntityList){ @@ -1971,7 +1970,7 @@ public class PolicyDBDao { } String gitPath = getGitPath(); - ArrayList gitPathParts = new ArrayList(); + ArrayList gitPathParts = new ArrayList<>(); Iterator gitPathIterator = Paths.get(gitPath).iterator(); while(gitPathIterator.hasNext()){ gitPathParts.add(gitPathIterator.next().toString()); @@ -2528,7 +2527,7 @@ public class PolicyDBDao { getGroups.setParameter("pid", existingPolicy.getPolicyId()); groups = getGroups.getResultList(); }catch(Exception e){ - groups = new LinkedList(); + groups = new LinkedList<>(); } for(Object o : groups){ GroupEntity group = (GroupEntity)o; @@ -3104,7 +3103,7 @@ public class PolicyDBDao { PolicyLogger.error("We cannot get the group from the papEngine to delete policies"); } else { - Set newPolicySet = new HashSet(group.getPolicies().size()); + Set newPolicySet = new HashSet<>(group.getPolicies().size()); //a multiple of n runtime is faster than n^2, so I am using a hashset to do the comparison for(PDPPolicy pol: group.getPolicies()){ newPolicySet.add(pol.getId());