From 59f4f54cdf4c1a5c155360239272da690e8c4a72 Mon Sep 17 00:00:00 2001 From: Jim Hahn Date: Tue, 25 Aug 2020 12:30:29 -0400 Subject: Address more sonar issues in policy-models Addressed sonar issues: - diamond operator Also removed a number of the "NOSONAR" comments now that we know how to address them without disabling sonar. Issue-ID: POLICY-2714 Change-Id: I440f4fa955968fd911616c2b6ee61b4b4d013821 Signed-off-by: Jim Hahn --- .../src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'models-dao/src/main/java/org') diff --git a/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java b/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java index 092b14ad8..ad9ef1215 100644 --- a/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java +++ b/models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java @@ -552,11 +552,7 @@ public class DefaultPfDao implements PfDao { final EntityManager mg = getEntityManager(); long size = 0; try { - /* - * Concatenation should be safe because the class name should be safe, thus - * disabling sonar. - */ - size = mg.createQuery("SELECT COUNT(c) FROM " + someClass.getSimpleName() + " c", Long.class) // NOSONAR + size = mg.createQuery("SELECT COUNT(c) FROM " + someClass.getSimpleName() + " c", Long.class) .getSingleResult(); } finally { mg.close(); -- cgit 1.2.3-korg