Make AbstractNetconfOperation.handle() final 56/108156/2
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 2 Oct 2023 12:09:20 +0000 (14:09 +0200)
committerRobert Varga <nite@hq.sk>
Mon, 2 Oct 2023 15:11:51 +0000 (15:11 +0000)
We do not want to have a byzantine overrides when there is an extension
point. This locks the method down by making it final.

Change-Id: I974d6944a51d579607a422a8ced4d6917e470be5
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
protocol/netconf-server/src/main/java/org/opendaylight/netconf/server/api/operations/AbstractNetconfOperation.java

index 42b6200869e6745a8e4a0469a369358cdb80f9ab..2d3c8b53fe098325151d37a3b4e7eaa74a7a0281 100644 (file)
@@ -33,9 +33,8 @@ public abstract class AbstractNetconfOperation implements NetconfOperation {
     }
 
     @Override
-    public HandlingPriority canHandle(final Document message) throws DocumentedException {
-        OperationNameAndNamespace operationNameAndNamespace = null;
-        operationNameAndNamespace = new OperationNameAndNamespace(message);
+    public final HandlingPriority canHandle(final Document message) throws DocumentedException {
+        final var operationNameAndNamespace = new OperationNameAndNamespace(message);
         return canHandle(operationNameAndNamespace.getOperationName(), operationNameAndNamespace.getNamespace());
     }