Make methods static 00/105500/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 19 Apr 2023 10:55:50 +0000 (12:55 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 19 Apr 2023 10:55:50 +0000 (12:55 +0200)
We have a number of context-free methods, turn them into statics to
lower their potential reach.

Change-Id: If5d8b516423d29410ec0f9d8541e108de03b5301
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/LispSouthboundPlugin.java
mappingservice/southbound/src/main/java/org/opendaylight/lispflowmapping/southbound/lisp/LispSouthboundHandler.java

index c5f173e648e02dd73292aee26686a0fe6fa6be55..077aca6bcd39caa5dd4575494dbcd212a486fa8f 100644 (file)
@@ -317,7 +317,7 @@ public class LispSouthboundPlugin implements IConfigLispSouthboundPlugin, AutoCl
         senderChannel.flush();
     }
 
-    private InetAddress getInetAddress(final TransportAddress address) {
+    private static InetAddress getInetAddress(final TransportAddress address) {
         requireNonNull(address, "TransportAddress must not be null");
         IpAddressBinary ip = address.getIpAddress();
         try {
index b0da4cb85e82834c1f7d8843e562157355747181..535ab72631d62720faf91ca21d19bee00169a192 100644 (file)
@@ -146,7 +146,7 @@ public class LispSouthboundHandler extends SimpleChannelInboundHandler<DatagramP
     }
 
     @SuppressWarnings("checkstyle:IllegalCatch")
-    private int extractEncapsulatedSourcePort(ByteBuffer inBuffer) {
+    private static int extractEncapsulatedSourcePort(ByteBuffer inBuffer) {
         try {
             inBuffer.position(PacketHeader.Length.LISP_ENCAPSULATION);
             int ipType = inBuffer.get() >> 4;
@@ -285,7 +285,7 @@ public class LispSouthboundHandler extends SimpleChannelInboundHandler<DatagramP
         return null;
     }
 
-    private MappingKeepAlive createMappingKeepAlive(final MapRegisterCacheValue value) {
+    private static MappingKeepAlive createMappingKeepAlive(final MapRegisterCacheValue value) {
         MappingKeepAliveBuilder mappingKeepAliveBuilder = new MappingKeepAliveBuilder();
         mappingKeepAliveBuilder.setMapRegisterCacheMetadata(value.getMapRegisterCacheMetadata());
         return mappingKeepAliveBuilder.build();
@@ -332,14 +332,14 @@ public class LispSouthboundHandler extends SimpleChannelInboundHandler<DatagramP
     /**
      * Calculates new message authentication code (MAC) for notify message.
      */
-    private ByteBuffer calculateAndSetNewMAC(final ByteBuffer buffer, final String authKey) {
+    private static ByteBuffer calculateAndSetNewMAC(final ByteBuffer buffer, final String authKey) {
         final byte[] authenticationData = LispAuthenticationUtil.createAuthenticationData(buffer, authKey);
         buffer.position(ILispAuthentication.MAP_REGISTER_AND_NOTIFY_AUTHENTICATION_POSITION);
         buffer.put(authenticationData);
         return buffer;
     }
 
-    private ByteBuffer transformMapRegisterToMapNotify(final ByteBuffer buffer) {
+    private static ByteBuffer transformMapRegisterToMapNotify(final ByteBuffer buffer) {
         buffer.position(0);
         byte typeAndFlags = buffer.get(0);
         // Shift the xTR-ID present and built for an RTR bits to their correct position
@@ -354,7 +354,7 @@ public class LispSouthboundHandler extends SimpleChannelInboundHandler<DatagramP
         return buffer;
     }
 
-    private Map<EidLispAddressKey, EidLispAddress> provideEidPrefixesFromMessage(final MapRegister mapRegister) {
+    private static Map<EidLispAddressKey, EidLispAddress> provideEidPrefixesFromMessage(final MapRegister mapRegister) {
         Map<EidLispAddressKey, EidLispAddress> eidsResult = new LinkedHashMap<>();
         int idx = 0;
         for (MappingRecordItem mappingRecordItem : mapRegister.getMappingRecordItem()) {