Remove code smells in Policy Agent
[nonrtric.git] / policy-agent / src / main / java / org / oransc / policyagent / controllers / PolicyController.java
index 21a0eee..3a49ff1 100644 (file)
@@ -216,12 +216,10 @@ public class PolicyController {
     private Mono<Object> validateModifiedPolicy(Policy policy) {
         // Check that ric is not updated
         Policy current = this.policies.get(policy.id());
-        if (current != null) {
-            if (!current.ric().name().equals(policy.ric().name())) {
-                return Mono.error(new Exception("Policy cannot change RIC, policyId: " + current.id() + //
-                    ", RIC name: " + current.ric().name() + //
-                    ", new name: " + policy.ric().name()));
-            }
+        if (current != null && !current.ric().name().equals(policy.ric().name())) {
+            return Mono.error(new Exception("Policy cannot change RIC, policyId: " + current.id() + //
+                ", RIC name: " + current.ric().name() + //
+                ", new name: " + policy.ric().name()));
         }
         return Mono.just("OK");
     }