From: Robert Varga Date: Tue, 26 Nov 2019 15:12:31 +0000 (+0100) Subject: Use direct conversion X-Git-Tag: release/magnesium~56 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=76b41741f63455ebce2f79828962da76e7e7464f;p=bgpcep.git Use direct conversion Uint types have utility converters for simple conversion among them, use toUint16() without going through an int (and related checks). Change-Id: I68927011a5eb933cc67fb1afba258b5d254973d9 Signed-off-by: Robert Varga --- diff --git a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionState.java b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionState.java index ce5dd96852..74756d1202 100644 --- a/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionState.java +++ b/pcep/impl/src/main/java/org/opendaylight/protocol/pcep/impl/PCEPSessionState.java @@ -5,7 +5,6 @@ * 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.pcep.impl; import static java.util.Objects.requireNonNull; @@ -78,7 +77,7 @@ final class PCEPSessionState { .setDeadtimer(open.getDeadTimer()) .setKeepalive(open.getKeepalive()) .setIpAddress(((InetSocketAddress) channel.localAddress()).getAddress().getHostAddress()) - .setSessionId(Uint16.valueOf(open.getSessionId().intValue())); + .setSessionId(open.getSessionId().toUint16()); return peerBuilder.build(); } @@ -119,7 +118,7 @@ final class PCEPSessionState { peerBuilder.setDeadtimer(open.getDeadTimer()) .setKeepalive(open.getKeepalive()) .setIpAddress(((InetSocketAddress) channel.remoteAddress()).getAddress().getHostAddress()) - .setSessionId(Uint16.valueOf(open.getSessionId().intValue())); + .setSessionId(open.getSessionId().toUint16()); return peerBuilder.build(); }