Refactor: Make method simpler
Change-Id: I28cabf5c5a381a8e2e6695aea7ad5000146111a3
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalCircuitIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalCircuitIntentCompiler.java
index 11a6655..45711a4 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalCircuitIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalCircuitIntentCompiler.java
@@ -194,7 +194,8 @@
}
// Check if both devices support multiplexing (usage of TributarySlots)
- boolean multiplexingSupported = isMultiplexingSupported(intent.getSrc(), intent.getDst());
+ boolean multiplexingSupported = isMultiplexingSupported(intent.getSrc())
+ && isMultiplexingSupported(intent.getDst());
// slots are used only for devices supporting multiplexing
Set<TributarySlot> slots = Collections.emptySet();
@@ -557,11 +558,8 @@
return (driver != null && driver.hasBehaviour(TributarySlotQuery.class));
}
- private boolean isMultiplexingSupported(ConnectPoint src, ConnectPoint dst) {
- return isTributarySlotBehaviourSupported(src.deviceId())
- && isTributarySlotBehaviourSupported(dst.deviceId())
- && staticPort(src) == null
- && staticPort(dst) == null;
+ private boolean isMultiplexingSupported(ConnectPoint cp) {
+ return isTributarySlotBehaviourSupported(cp.deviceId()) && staticPort(cp) == null;
}
/**