Refactor: Make method simpler
Change-Id: I28cabf5c5a381a8e2e6695aea7ad5000146111a3
Showing
1 changed file
with
4 additions
and
6 deletions
... | @@ -194,7 +194,8 @@ public class OpticalCircuitIntentCompiler implements IntentCompiler<OpticalCircu | ... | @@ -194,7 +194,8 @@ public class OpticalCircuitIntentCompiler implements IntentCompiler<OpticalCircu |
194 | } | 194 | } |
195 | 195 | ||
196 | // Check if both devices support multiplexing (usage of TributarySlots) | 196 | // Check if both devices support multiplexing (usage of TributarySlots) |
197 | - boolean multiplexingSupported = isMultiplexingSupported(intent.getSrc(), intent.getDst()); | 197 | + boolean multiplexingSupported = isMultiplexingSupported(intent.getSrc()) |
198 | + && isMultiplexingSupported(intent.getDst()); | ||
198 | 199 | ||
199 | // slots are used only for devices supporting multiplexing | 200 | // slots are used only for devices supporting multiplexing |
200 | Set<TributarySlot> slots = Collections.emptySet(); | 201 | Set<TributarySlot> slots = Collections.emptySet(); |
... | @@ -557,11 +558,8 @@ public class OpticalCircuitIntentCompiler implements IntentCompiler<OpticalCircu | ... | @@ -557,11 +558,8 @@ public class OpticalCircuitIntentCompiler implements IntentCompiler<OpticalCircu |
557 | return (driver != null && driver.hasBehaviour(TributarySlotQuery.class)); | 558 | return (driver != null && driver.hasBehaviour(TributarySlotQuery.class)); |
558 | } | 559 | } |
559 | 560 | ||
560 | - private boolean isMultiplexingSupported(ConnectPoint src, ConnectPoint dst) { | 561 | + private boolean isMultiplexingSupported(ConnectPoint cp) { |
561 | - return isTributarySlotBehaviourSupported(src.deviceId()) | 562 | + return isTributarySlotBehaviourSupported(cp.deviceId()) && staticPort(cp) == null; |
562 | - && isTributarySlotBehaviourSupported(dst.deviceId()) | ||
563 | - && staticPort(src) == null | ||
564 | - && staticPort(dst) == null; | ||
565 | } | 563 | } |
566 | 564 | ||
567 | /** | 565 | /** | ... | ... |
-
Please register or login to post a comment