No-sonar on the wrong line 91/121591/1
authorJim Hahn <jrh3@att.com>
Fri, 28 May 2021 14:59:36 +0000 (10:59 -0400)
committerJim Hahn <jrh3@att.com>
Fri, 28 May 2021 15:01:52 +0000 (11:01 -0400)
Tried putting NOSONAR comment at the end of the statement, because it
seems like checkstyle/sonar doesn't like comments in the middle of a
statement.  Nonetheless, sonar still reports an issue on the line with
the "SELECT" statement, so I guess there's no choice but to move NOSONAR
to the end of that line.

Issue-ID: POLICY-3094
Change-Id: If26ad0b1e7dcc9c7aa963da10a9c5160a8fe272d
Signed-off-by: Jim Hahn <jrh3@att.com>
models-dao/src/main/java/org/onap/policy/models/dao/impl/DefaultPfDao.java

index d1e3293..d27f3c6 100644 (file)
@@ -630,8 +630,8 @@ public class DefaultPfDao implements PfDao {
              * The invoking code only passes well-known classes into this method, thus
              * disabling the sonar about SQL injection.
              */
-            size = mg.createQuery("SELECT COUNT(c) FROM " + someClass.getSimpleName() + " c", Long.class)
-                    .getSingleResult();     // NOSONAR
+            size = mg.createQuery("SELECT COUNT(c) FROM " + someClass.getSimpleName() + " c", Long.class)   // NOSONAR
+                    .getSingleResult();
         } finally {
             mg.close();
         }