Refactor: Simplify method
Change-Id: I2fc8bed7ab41d3577cb8bb31af48941a2d738010
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 fa684f5..7a898f3 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
@@ -446,25 +446,22 @@
}
private Pair<OchPort, OchPort> findPorts(ConnectPoint src, ConnectPoint dst, CltSignalType signalType) {
- Pair<OchPort, OchPort> ochPorts = null;
// According to the OpticalCircuitIntent's signalType find OCH ports with available TributarySlots resources
switch (signalType) {
case CLT_1GBE:
case CLT_10GBE:
// First search for OCH ports with OduSignalType of ODU2. If not found - search for those with ODU4
- ochPorts = findPorts(src, dst, OduSignalType.ODU2);
+ Pair<OchPort, OchPort> ochPorts = findPorts(src, dst, OduSignalType.ODU2);
if (ochPorts == null) {
ochPorts = findPorts(src, dst, OduSignalType.ODU4);
}
- break;
+ return ochPorts;
case CLT_100GBE:
- ochPorts = findPorts(src, dst, OduSignalType.ODU4);
- break;
+ return findPorts(src, dst, OduSignalType.ODU4);
case CLT_40GBE:
default:
- break;
+ return null;
}
- return ochPorts;
}
private Pair<OchPort, OchPort> findPorts(ConnectPoint src, ConnectPoint dst, OduSignalType ochPortSignalType) {