From 1e58b3a1544c4f0efff5d5d6a246707da90ee834 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Sat, 4 Jan 2020 16:15:26 +0100 Subject: [PATCH] Remove superfluous constants java.lang.{Byte,Short,Integer,Long,Float} define a BYTES constant since Java 8, use that instead of brewing our own. Change-Id: If7a8e75c123fef7d79172f22dadb01012de4b1b5 Signed-off-by: Robert Varga --- .../protocol/bgp/parser/spi/PathIdUtil.java | 2 +- .../message/StatisticsReportHandler.java | 4 +--- .../protocol/bmp/spi/parser/TlvUtil.java | 11 +++-------- .../object/PCEPOverloadObjectParser.java | 3 +-- .../object/PCEPProcTimeObjectParser.java | 3 +-- .../impl/te/AdminStatusObjectParser.java | 4 +--- .../parser/impl/te/FlowSpecObjectParser.java | 12 +++++------- .../InformationalFastRerouteObjectParser.java | 3 +-- .../parser/impl/te/MetricObjectParser.java | 3 +-- .../parser/impl/te/ProtectionCommonParser.java | 7 +++---- .../impl/te/SenderTspecObjectParser.java | 9 ++++----- .../protocol/util/ByteBufWriteUtil.java | 12 ------------ .../protocol/util/ByteBufWriteUtilTest.java | 18 +++++++++--------- 13 files changed, 31 insertions(+), 60 deletions(-) diff --git a/bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/PathIdUtil.java b/bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/PathIdUtil.java index 081226d3fe..950a8535a7 100644 --- a/bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/PathIdUtil.java +++ b/bgp/parser-spi/src/main/java/org/opendaylight/protocol/bgp/parser/spi/PathIdUtil.java @@ -56,7 +56,7 @@ public final class PathIdUtil { * @return Decoded PathId. */ public static PathId readPathId(final ByteBuf buffer) { - Preconditions.checkArgument(buffer != null && buffer.isReadable(ByteBufWriteUtil.INT_BYTES_LENGTH)); + Preconditions.checkArgument(buffer != null && buffer.isReadable(Integer.BYTES)); return new PathId(ByteBufUtils.readUint32(buffer)); } diff --git a/bmp/bmp-parser-impl/src/main/java/org/opendaylight/protocol/bmp/parser/message/StatisticsReportHandler.java b/bmp/bmp-parser-impl/src/main/java/org/opendaylight/protocol/bmp/parser/message/StatisticsReportHandler.java index fc5340de15..ba9282873e 100644 --- a/bmp/bmp-parser-impl/src/main/java/org/opendaylight/protocol/bmp/parser/message/StatisticsReportHandler.java +++ b/bmp/bmp-parser-impl/src/main/java/org/opendaylight/protocol/bmp/parser/message/StatisticsReportHandler.java @@ -5,10 +5,8 @@ * terms of the Eclipse Public License v1.0 which accompanies this distribution, * and is available at http://www.eclipse.org/legal/epl-v10.html */ - package org.opendaylight.protocol.bmp.parser.message; -import static org.opendaylight.protocol.util.ByteBufWriteUtil.INT_BYTES_LENGTH; import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeUnsignedInt; import com.google.common.base.Preconditions; @@ -62,7 +60,7 @@ public class StatisticsReportHandler extends AbstractBmpPerPeerMessageParser