Fixed sonar issues in policy-pap
[policy/pap.git] / main / src / main / java / org / onap / policy / pap / main / comm / PdpStatusMessageHandler.java
index 4d14211..dc4a030 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  *  Copyright (C) 2019-2021,2023 Nordix Foundation.
  *  Modifications Copyright (C) 2019-2021 AT&T Intellectual Property.
- *  Modifications Copyright (C) 2021-2022 Bell Canada. All rights reserved.
+ *  Modifications Copyright (C) 2021-2023 Bell Canada. All rights reserved.
  * ================================================================================
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -159,10 +159,8 @@ public class PdpStatusMessageHandler extends PdpMessageGenerator {
                 return true;
             }
 
-            if (exceptionClazz.isInstance(thrown)) {
-                if (isDuplicateKeyException(thrown.getCause(), exceptionClazz)) {
-                    return true;
-                }
+            if (exceptionClazz.isInstance(thrown) && isDuplicateKeyException(thrown.getCause(), exceptionClazz)) {
+                return true;
             }
 
             thrown = thrown.getCause();