controlloop m2 sonar fix 06/109606/4
authorTaka Cho <takamune.cho@att.com>
Fri, 26 Jun 2020 15:47:18 +0000 (11:47 -0400)
committerLiam Fallon <liam.fallon@est.tech>
Mon, 29 Jun 2020 10:43:36 +0000 (10:43 +0000)
- remove some unused statement
- remove unnecessary check

Issue-ID: POLICY-2616
Change-Id: Ieb2c898a3c6ad7210642aef990b43c9a01fc15b3
Signed-off-by: Taka Cho <takamune.cho@att.com>
controlloop/m2/util/src/main/java/org/onap/policy/util/DroolsSessionCommonSerializable.java

index 0834026..c76a8c2 100644 (file)
@@ -108,14 +108,13 @@ public class DroolsSessionCommonSerializable implements Serializable {
         if (session != null) {
             // we found the 'PolicySession' -- now, look for the adjunct
             Object adj = session.getAdjunct(Adjunct.class);
-            if (adj == null || !(adj instanceof Adjunct)) {
+            if (!(adj instanceof Adjunct)) {
                 // adjunct does not exist, or has the wrong type -- create it
                 adjunct = new Adjunct();
                 session.setAdjunct(Adjunct.class, adjunct);
             } else {
                 // found the adjunct -- return it
                 adjunct = (Adjunct) adj;
-                //adjunct = Adjunct.class.cast(adj);
             }
         }
         return adjunct;