Move variable declarations out of the loop

Change-Id: I7d89e942e459e65838282f0c7dc9a1399c4af166
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalConnectivityIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalConnectivityIntentCompiler.java
index 44d0894..98df5f3 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalConnectivityIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/OpticalConnectivityIntentCompiler.java
@@ -120,15 +120,15 @@
         // Calculate available light paths
         Set<Path> paths = getOpticalPaths(intent);
 
+        // Static or dynamic lambda allocation
+        String staticLambda = srcPort.annotations().value(AnnotationKeys.STATIC_LAMBDA);
+        OchPort srcOchPort = (OchPort) srcPort;
+        OchPort dstOchPort = (OchPort) dstPort;
+        OchSignal ochSignal;
+
         // Use first path that can be successfully reserved
         for (Path path : paths) {
 
-            // Static or dynamic lambda allocation
-            String staticLambda = srcPort.annotations().value(AnnotationKeys.STATIC_LAMBDA);
-            OchPort srcOchPort = (OchPort) srcPort;
-            OchPort dstOchPort = (OchPort) dstPort;
-            OchSignal ochSignal;
-
             // FIXME: need to actually reserve the lambda for static lambda's
             if (staticLambda != null) {
                 ochSignal = new OchSignal(Frequency.ofHz(Long.parseLong(staticLambda)),