Committed by
Gerrit Code Review
Refactor: Flip condition to reduce the depth of indentation
Change-Id: I572a989730a8dd93b5ab7ee63b37bc9d728c17e7
Showing
1 changed file
with
4 additions
and
2 deletions
... | @@ -373,7 +373,10 @@ public class IntentManager | ... | @@ -373,7 +373,10 @@ public class IntentManager |
373 | private void applyIntentData(IntentData data, | 373 | private void applyIntentData(IntentData data, |
374 | FlowRuleOperations.Builder builder, | 374 | FlowRuleOperations.Builder builder, |
375 | Direction direction) { | 375 | Direction direction) { |
376 | - if (data != null) { | 376 | + if (data == null) { |
377 | + return; | ||
378 | + } | ||
379 | + | ||
377 | List<Intent> intentsToApply = data.installables(); | 380 | List<Intent> intentsToApply = data.installables(); |
378 | if (!intentsToApply.stream().allMatch(x -> x instanceof FlowRuleIntent)) { | 381 | if (!intentsToApply.stream().allMatch(x -> x instanceof FlowRuleIntent)) { |
379 | throw new IllegalStateException("installable intents must be FlowRuleIntent"); | 382 | throw new IllegalStateException("installable intents must be FlowRuleIntent"); |
... | @@ -405,7 +408,6 @@ public class IntentManager | ... | @@ -405,7 +408,6 @@ public class IntentManager |
405 | rules.forEach(builder::remove); | 408 | rules.forEach(builder::remove); |
406 | } | 409 | } |
407 | } | 410 | } |
408 | - } | ||
409 | 411 | ||
410 | } | 412 | } |
411 | 413 | ... | ... |
-
Please register or login to post a comment