Remove ByteBufUtils.padBuffer() 69/92669/4
authorRobert Varga <robert.varga@pantheon.tech>
Thu, 24 Sep 2020 11:22:55 +0000 (13:22 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Thu, 24 Sep 2020 15:38:21 +0000 (17:38 +0200)
This method has been deprecated for at least three years and is not
used anywhere, remove it.

Change-Id: Ied94f803d3a2025542a07ef1e6e9320fd9a7af4a
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
openflowjava/openflowjava-util/src/main/java/org/opendaylight/openflowjava/util/ByteBufUtils.java
openflowjava/openflowjava-util/src/test/java/org/opendaylight/openflowjava/util/ByteBufUtilsTest.java

index da0bf849b229a5bdf00d0568f067fab0aeeb1be4..76a95c1d72ee08da717f7827401fc3f8f4605a6b 100644 (file)
@@ -109,18 +109,6 @@ public abstract class ByteBufUtils {
         out.writeBytes(hexStringToBytes(hexSrc));
     }
 
-    /**
-     * Fills specified ByteBuf with 0 (zeros) of desired length, used for padding.
-     *
-     * @param length the desired length
-     * @param out ByteBuf to be padded
-     * @deprecated Use {@link ByteBuf#writeZero(int)} directly.
-     */
-    @Deprecated
-    public static void padBuffer(final int length, final ByteBuf out) {
-        out.writeZero(length);
-    }
-
     /**
      * Create standard OF header.
      *
index 75bbf6769d291c0ed65eca44eae18b8a1a35a51b..b0fe37a300374678ce103fbebd01134a5b44769a 100644 (file)
@@ -338,18 +338,6 @@ public class ByteBufUtilsTest {
         Assert.assertEquals("Wrong data read", "04 05 06 07", ByteBufUtils.byteBufToHexString(buf));
     }
 
-    /**
-     * Buffer padding test.
-     */
-    @Test
-    public void testPadBuffer() {
-        ByteBuf buf = PooledByteBufAllocator.DEFAULT.buffer();
-        ByteBufUtils.padBuffer(4, buf);
-        Assert.assertEquals("Wrong padding", 0, buf.readUnsignedInt());
-        ByteBufUtils.padBuffer(0, buf);
-        Assert.assertTrue("Wrong padding", buf.readableBytes() == 0);
-    }
-
     /**
      * Write OF header test.
      */