Use Java StandardCharsets 79/41979/3
authorRobert Varga <rovarga@cisco.com>
Mon, 18 Jul 2016 14:32:37 +0000 (16:32 +0200)
committerRobert Varga <nite@hq.sk>
Tue, 19 Jul 2016 10:20:27 +0000 (10:20 +0000)
Guava's Charsets are not needed with our Java version.

Change-Id: Ibe12548f2068d6fa5b381e56b66a565837810fd8
Signed-off-by: Robert Varga <rovarga@cisco.com>
19 files changed:
bgp/bmp-impl/src/main/java/org/opendaylight/controller/config/yang/bmp/impl/BmpMonitorImplModule.java
bgp/bmp-impl/src/main/java/org/opendaylight/protocol/bmp/impl/tlv/DescriptionTlvHandler.java
bgp/bmp-impl/src/main/java/org/opendaylight/protocol/bmp/impl/tlv/NameTlvHandler.java
bgp/bmp-impl/src/main/java/org/opendaylight/protocol/bmp/impl/tlv/StringTlvHandler.java
bgp/bmp-spi/src/main/java/org/opendaylight/protocol/bmp/spi/parser/TlvUtil.java
bgp/bmp-spi/src/test/java/org/opendaylight/protocol/bmp/spi/parser/AbstractBmpMessageWithTlvParserTest.java
bgp/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/attribute/LinkAttributesParser.java
bgp/linkstate/src/main/java/org/opendaylight/protocol/bgp/linkstate/impl/attribute/NodeAttributesParser.java
bgp/rib-impl/src/main/java/org/opendaylight/controller/config/yang/bgp/rib/impl/BGPPeerModule.java
bgp/topology-provider/src/test/java/org/opendaylight/bgpcep/bgp/topology/provider/LinkstateTopologyBuilderTest.java
concepts/src/main/java/org/opendaylight/protocol/concepts/KeyMapping.java
pcep/ietf-stateful07/src/main/java/org/opendaylight/protocol/pcep/ietf/stateful07/Stateful07RSVPErrorSpecTlvParser.java
pcep/pcc-mock/src/main/java/org/opendaylight/protocol/pcep/pcc/mock/spi/MsgBuilderUtil.java
pcep/pcc-mock/src/test/java/org/opendaylight/protocol/pcep/pcc/mock/PCCTunnelManagerImplTest.java
pcep/segment-routing/src/test/java/org/opendaylight/protocol/pcep/segment/routing/TopologyProviderTest.java
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/Stateful07TopologySessionListener.java
pcep/topology-provider/src/main/java/org/opendaylight/controller/config/yang/pcep/topology/provider/PCEPTopologyProviderModule.java
rsvp/impl/src/main/java/org/opendaylight/protocol/rsvp/parser/impl/te/SessionAttributeLspObjectParser.java
rsvp/impl/src/main/java/org/opendaylight/protocol/rsvp/parser/impl/te/SessionAttributeLspRaObjectParser.java

index 9540ecdf302ff4e70d3056486c6f8e76b7f6506f..66c144c1b85b9b8da490f860a7e5219d92b17c90 100644 (file)
@@ -8,11 +8,11 @@
 
 package org.opendaylight.controller.config.yang.bmp.impl;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.net.InetAddresses;
 import io.netty.util.internal.PlatformDependent;
+import java.nio.charset.StandardCharsets;
 import java.security.AccessControlException;
 import org.opendaylight.controller.config.api.JmxAttributeValidationException;
 import org.opendaylight.controller.sal.core.api.model.SchemaService;
@@ -64,7 +64,7 @@ public class BmpMonitorImplModule extends org.opendaylight.controller.config.yan
                 final Rfc2385Key rfc2385KeyPassword = mr.getPassword();
                 if (rfc2385KeyPassword != null && !rfc2385KeyPassword.getValue().isEmpty()) {
                     final String s = getAddressString(mr.getAddress());
-                    ret.put(InetAddresses.forString(s), rfc2385KeyPassword.getValue().getBytes(Charsets.US_ASCII));
+                    ret.put(InetAddresses.forString(s), rfc2385KeyPassword.getValue().getBytes(StandardCharsets.US_ASCII));
                 }
             }
         }
index 5090d9f2a3a07981bdeb0be10d12e02ab963ea92..5baad5e52ffda10053c36a20aa8695e7b51dea26 100644 (file)
@@ -8,9 +8,9 @@
 
 package org.opendaylight.protocol.bmp.impl.tlv;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
+import java.nio.charset.StandardCharsets;
 import org.opendaylight.protocol.bmp.spi.parser.BmpDeserializationException;
 import org.opendaylight.protocol.bmp.spi.parser.BmpTlvParser;
 import org.opendaylight.protocol.bmp.spi.parser.BmpTlvSerializer;
@@ -34,7 +34,7 @@ public class DescriptionTlvHandler implements BmpTlvParser, BmpTlvSerializer {
         if (buffer == null) {
             return null;
         }
-        return new DescriptionTlvBuilder().setDescription(buffer.toString(Charsets.US_ASCII)).build();
+        return new DescriptionTlvBuilder().setDescription(buffer.toString(StandardCharsets.US_ASCII)).build();
     }
 
 }
index 179062145662a0df812f57ef3062a3bced686647..1f522d280c8c12506dcf2360028cfd01b0332efb 100644 (file)
@@ -8,9 +8,9 @@
 
 package org.opendaylight.protocol.bmp.impl.tlv;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
+import java.nio.charset.StandardCharsets;
 import org.opendaylight.protocol.bmp.spi.parser.BmpDeserializationException;
 import org.opendaylight.protocol.bmp.spi.parser.BmpTlvParser;
 import org.opendaylight.protocol.bmp.spi.parser.BmpTlvSerializer;
@@ -34,7 +34,7 @@ public class NameTlvHandler implements BmpTlvParser, BmpTlvSerializer {
         if (buffer == null) {
             return null;
         }
-        return new NameTlvBuilder().setName(buffer.toString(Charsets.US_ASCII)).build();
+        return new NameTlvBuilder().setName(buffer.toString(StandardCharsets.US_ASCII)).build();
     }
 
 }
index 8f26cb155a7949273388fd9006c469cbb5821b37..d9a5e36d1097a6b99b03e9a843e65a3435c8c32b 100644 (file)
@@ -8,9 +8,9 @@
 
 package org.opendaylight.protocol.bmp.impl.tlv;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
+import java.nio.charset.StandardCharsets;
 import org.opendaylight.protocol.bmp.spi.parser.BmpDeserializationException;
 import org.opendaylight.protocol.bmp.spi.parser.BmpTlvParser;
 import org.opendaylight.protocol.bmp.spi.parser.BmpTlvSerializer;
@@ -34,7 +34,7 @@ public class StringTlvHandler implements BmpTlvParser, BmpTlvSerializer {
         if (buffer == null) {
             return null;
         }
-        return new StringTlvBuilder().setStringInfo(buffer.toString(Charsets.UTF_8)).build();
+        return new StringTlvBuilder().setStringInfo(buffer.toString(StandardCharsets.UTF_8)).build();
     }
 
 }
index 4ff9ce8fb1904250fa08c4ac4d4bd234d898b4cf..0c9d6ec8eefb894e7ad934230236ee88db0880be 100644 (file)
@@ -11,9 +11,9 @@ package org.opendaylight.protocol.bmp.spi.parser;
 import static org.opendaylight.protocol.util.ByteBufWriteUtil.INT_BYTES_LENGTH;
 import static org.opendaylight.protocol.util.ByteBufWriteUtil.LONG_BYTES_LENGTH;
 import static org.opendaylight.protocol.util.ByteBufWriteUtil.SHORT_BYTES_LENGTH;
-import com.google.common.base.Charsets;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import java.nio.charset.StandardCharsets;
 import org.opendaylight.protocol.util.ByteBufWriteUtil;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Counter32;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Gauge64;
@@ -53,13 +53,13 @@ public final class TlvUtil {
 
     public static void formatTlvUtf8(final int type, final String value, final ByteBuf out) {
         if (value != null) {
-            TlvUtil.formatTlv(type, Unpooled.copiedBuffer(value, Charsets.UTF_8), out);
+            TlvUtil.formatTlv(type, Unpooled.copiedBuffer(value, StandardCharsets.UTF_8), out);
         }
     }
 
     public static void formatTlvAscii(final int type, final String value, final ByteBuf out) {
         if (value != null) {
-            TlvUtil.formatTlv(type, Unpooled.copiedBuffer(value, Charsets.US_ASCII), out);
+            TlvUtil.formatTlv(type, Unpooled.copiedBuffer(value, StandardCharsets.US_ASCII), out);
         }
 
     }
index 796043d5cd06da92dfb51873dddba9d5c25eb5bd..3b907ed9135e4fdb3ca4ed2a05c2d69da7d007df 100644 (file)
@@ -12,10 +12,10 @@ import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
-import com.google.common.base.Charsets;
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import java.nio.charset.StandardCharsets;
 import org.junit.Before;
 import org.junit.Test;
 import org.opendaylight.protocol.bmp.spi.registry.SimpleBmpTlvRegistry;
@@ -47,7 +47,7 @@ public class AbstractBmpMessageWithTlvParserTest {
             if (buffer == null) {
                 return null;
             }
-            return new DescriptionTlvBuilder().setDescription(buffer.toString(Charsets.US_ASCII)).build();
+            return new DescriptionTlvBuilder().setDescription(buffer.toString(StandardCharsets.US_ASCII)).build();
         }
     };
 
index a22747d15835f259202f46a8e116532e51d68928..933cebdde2d64531a6cd46942e830af354623b42 100644 (file)
@@ -8,11 +8,11 @@
 package org.opendaylight.protocol.bgp.linkstate.impl.attribute;
 
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Charsets;
 import com.google.common.collect.Multimap;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufUtil;
 import io.netty.buffer.Unpooled;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map.Entry;
@@ -168,7 +168,7 @@ public final class LinkAttributesParser {
                 LOG.debug("Parsed Opaque value : {}", ByteBufUtil.hexDump(value));
                 break;
             case LINK_NAME:
-                builder.setLinkName(new String(ByteArray.readAllBytes(value), Charsets.US_ASCII));
+                builder.setLinkName(new String(ByteArray.readAllBytes(value), StandardCharsets.US_ASCII));
                 LOG.debug("Parsed Link Name : {}", builder.getLinkName());
                 break;
             case SR_ADJ_ID:
@@ -250,7 +250,7 @@ public final class LinkAttributesParser {
         serializeMplsProtocolMask(linkAttributes.getMplsProtocol(), output);
         ifPresentApply(linkAttributes.getMetric(), value -> TlvUtil.writeTLV(METRIC, Unpooled.copyMedium(((Metric) value).getValue().intValue()), output));
         serializeSrlg(linkAttributes.getSharedRiskLinkGroups(), output);
-        ifPresentApply(linkAttributes.getLinkName(), value -> TlvUtil.writeTLV(LINK_NAME, Unpooled.wrappedBuffer(Charsets.UTF_8.encode((String) value)), output));
+        ifPresentApply(linkAttributes.getLinkName(), value -> TlvUtil.writeTLV(LINK_NAME, Unpooled.wrappedBuffer(StandardCharsets.UTF_8.encode((String) value)), output));
         ifPresentApply(linkAttributes.getSrAdjIds(), value -> SrLinkAttributesParser.serializeAdjacencySegmentIdentifiers((List<SrAdjIds>) value, SR_ADJ_ID, output));
         ifPresentApply(linkAttributes.getSrLanAdjIds(), value -> SrLinkAttributesParser.serializeLanAdjacencySegmentIdentifiers((List<SrLanAdjIds>) value, output));
         ifPresentApply(linkAttributes.getPeerNodeSid(), value -> TlvUtil.writeTLV(PEER_NODE_SID_CODE, SrLinkAttributesParser.serializeAdjacencySegmentIdentifier((PeerNodeSid) value), output));
index 39979b9d906a708e6bc688cc96cc3db5a3e0b304..40c6749016ee107ba01159db25b08459ba8b2f20 100644 (file)
@@ -8,7 +8,6 @@
 package org.opendaylight.protocol.bgp.linkstate.impl.attribute;
 
 import com.google.common.annotations.VisibleForTesting;
-import com.google.common.base.Charsets;
 import com.google.common.collect.Multimap;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.ByteBufUtil;
@@ -16,6 +15,7 @@ import io.netty.buffer.Unpooled;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map.Entry;
+import java.nio.charset.StandardCharsets;
 import org.opendaylight.protocol.bgp.linkstate.impl.attribute.sr.SrNodeAttributesParser;
 import org.opendaylight.protocol.bgp.linkstate.spi.TlvUtil;
 import org.opendaylight.protocol.util.BitArray;
@@ -91,7 +91,7 @@ public final class NodeAttributesParser {
                 }
                 break;
             case DYNAMIC_HOSTNAME:
-                builder.setDynamicHostname(new String(ByteArray.readAllBytes(value), Charsets.US_ASCII));
+                builder.setDynamicHostname(new String(ByteArray.readAllBytes(value), StandardCharsets.US_ASCII));
                 LOG.debug("Parsed Node Name {}", builder.getDynamicHostname());
                 break;
             case ISIS_AREA_IDENTIFIER:
@@ -151,7 +151,7 @@ public final class NodeAttributesParser {
         serializeTopologyId(nodeAttributes.getTopologyIdentifier(), byteAggregator);
         serializeNodeFlagBits(nodeAttributes.getNodeFlags(), byteAggregator);
         if (nodeAttributes.getDynamicHostname() != null) {
-            TlvUtil.writeTLV(DYNAMIC_HOSTNAME, Unpooled.wrappedBuffer(Charsets.UTF_8.encode(nodeAttributes.getDynamicHostname())), byteAggregator);
+            TlvUtil.writeTLV(DYNAMIC_HOSTNAME, Unpooled.wrappedBuffer(StandardCharsets.UTF_8.encode(nodeAttributes.getDynamicHostname())), byteAggregator);
         }
         final List<IsisAreaIdentifier> isisList = nodeAttributes.getIsisAreaId();
         if (isisList != null) {
index 856dd59cf44b9ed863231ed575e8dd07d26b9088..1cd73d8843a00ecb5f2f914fe2d93c5dcb945464 100755 (executable)
  */
 package org.opendaylight.controller.config.yang.bgp.rib.impl;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.net.InetAddresses;
 import io.netty.channel.epoll.Epoll;
 import io.netty.util.concurrent.Future;
 import java.net.InetSocketAddress;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -280,7 +280,7 @@ public final class BGPPeerModule extends org.opendaylight.controller.config.yang
     }
 
     private static Optional<byte[]> getMD5Password(final Rfc2385Key password) {
-        return getOptionalPassword(password).isPresent() ? Optional.of(password.getValue().getBytes(Charsets.US_ASCII)) : Optional.absent();
+        return getOptionalPassword(password).isPresent() ? Optional.of(password.getValue().getBytes(StandardCharsets.US_ASCII)) : Optional.absent();
     }
 
 }
index 5432ff60d6ca17c905c2c9b1520835db9db463e4..3875b11d68c036e8f982768339b70944b101141d 100755 (executable)
@@ -14,11 +14,11 @@ import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Optional;
 import com.google.common.collect.Lists;
 import io.netty.buffer.Unpooled;
 import java.math.BigInteger;
+import java.nio.charset.StandardCharsets;
 import java.util.Collections;
 import org.junit.Test;
 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
@@ -81,7 +81,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 
 public class LinkstateTopologyBuilderTest extends AbstractTopologyBuilderTest {
 
-    private static final byte[] LINKSTATE_ROUTE_KEY = Unpooled.wrappedBuffer(Charsets.UTF_8.encode("linkstate-route")).array();
+    private static final byte[] LINKSTATE_ROUTE_KEY = Unpooled.wrappedBuffer(StandardCharsets.UTF_8.encode("linkstate-route")).array();
     private static final String ROUTER_1_ID = "127.0.0.1";
     private static final String ROUTER_2_ID = "127.0.0.2";
     private static final String NODE_1_PREFIX = "127.0.1.1/32";
index 5c45526065c19d9103f06b7ed0130978424127f0..b6a6c668e984e02e664a2f04a4c71b55f822f0ec 100644 (file)
@@ -9,9 +9,9 @@ package org.opendaylight.protocol.concepts;
 
 import static com.google.common.base.Strings.isNullOrEmpty;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Optional;
 import java.net.InetAddress;
+import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
 import java.util.Map;
 import javax.annotation.Nonnull;
@@ -40,7 +40,7 @@ public final class KeyMapping extends HashMap<InetAddress, byte[]> {
     public static KeyMapping getKeyMapping(@Nonnull final InetAddress inetAddress, @Nullable final String password){
         if (!isNullOrEmpty(password)) {
             final KeyMapping keyMapping = new KeyMapping();
-            keyMapping.put(inetAddress, password.getBytes(Charsets.US_ASCII));
+            keyMapping.put(inetAddress, password.getBytes(StandardCharsets.US_ASCII));
             return keyMapping;
         }
         return null;
index 0ca07e1a7854b42847956f6a7204aebd2c02772b..24699e7036d8abd576cf9aa50c5675e9e701ae41 100644 (file)
@@ -13,10 +13,10 @@ import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeUnsignedByte;
 import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeUnsignedInt;
 import static org.opendaylight.protocol.util.ByteBufWriteUtil.writeUnsignedShort;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import java.nio.charset.StandardCharsets;
 import org.opendaylight.protocol.pcep.spi.PCEPDeserializerException;
 import org.opendaylight.protocol.pcep.spi.TlvParser;
 import org.opendaylight.protocol.pcep.spi.TlvSerializer;
@@ -107,7 +107,7 @@ public final class Stateful07RSVPErrorSpecTlvParser implements TlvParser, TlvSer
     }
 
     private void serializerUserError(final UserError ue, final ByteBuf body) {
-        final byte[] desc = (ue.getDescription() == null) ? new byte[0] : ue.getDescription().getBytes(Charsets.UTF_8);
+        final byte[] desc = (ue.getDescription() == null) ? new byte[0] : ue.getDescription().getBytes(StandardCharsets.UTF_8);
         final ByteBuf userErrorBuf = Unpooled.buffer();
         Preconditions.checkArgument(ue.getEnterprise() != null, "EnterpriseNumber is mandatory");
         writeUnsignedInt(ue.getEnterprise().getValue(), userErrorBuf);
index 759e92c7e2423f9b82038b7a2230da6b8aade8d9..1187ed9fe486de98769c8d107a77a55a465efc79 100644 (file)
@@ -8,10 +8,10 @@
 
 package org.opendaylight.protocol.pcep.pcc.mock.spi;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Optional;
 import com.google.common.collect.Lists;
 import java.math.BigInteger;
+import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.List;
 import javax.annotation.Nonnull;
@@ -180,7 +180,7 @@ public final class MsgBuilderUtil {
     }
 
     public static byte[] getDefaultPathName(final String address, final long lspId) {
-        return ("pcc_" + address + "_tunnel_" + lspId).getBytes(Charsets.UTF_8);
+        return ("pcc_" + address + "_tunnel_" + lspId).getBytes(StandardCharsets.UTF_8);
     }
 
 }
index 574bdc7a730001fa1770ba34e4a218180f7463da..a1b462031cd1b9fd8d4ba3c2801c4969e91a1ef8 100644 (file)
@@ -10,13 +10,13 @@ package org.opendaylight.protocol.pcep.pcc.mock;
 
 import static org.junit.Assert.assertEquals;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Optional;
 import com.google.common.collect.Lists;
 import com.google.common.net.InetAddresses;
 import io.netty.util.HashedWheelTimer;
 import io.netty.util.Timer;
 import java.net.InetAddress;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
 import org.junit.After;
@@ -59,7 +59,7 @@ public class PCCTunnelManagerImplTest {
 
     private static final InetAddress ADDRESS = InetAddresses.forString("1.2.4.5");
     private static final Timer TIMER = new HashedWheelTimer();
-    private static final byte[] SYMBOLIC_NAME = "tets".getBytes(Charsets.UTF_8);
+    private static final byte[] SYMBOLIC_NAME = "tets".getBytes(StandardCharsets.UTF_8);
     private static final Ero ERO = new EroBuilder()
         .setSubobject(Lists.newArrayList(new SubobjectBuilder().setSubobjectType(new IpPrefixCaseBuilder().setIpPrefix(
             new IpPrefixBuilder().setIpPrefix(new IpPrefix(new Ipv4Prefix("127.0.0.2/32"))).build()).build()).build())).build();
@@ -356,4 +356,4 @@ public class PCCTunnelManagerImplTest {
         return PCEPErrors.forValue(errorObject.getType(), errorObject.getValue());
     }
 
-}
\ No newline at end of file
+}
index 815891b55c78c338a956c0f193840209e087d0f7..5f1ee6a9c466be4a87ebcc14af8285e1364fcfc6 100644 (file)
@@ -8,8 +8,8 @@
 
 package org.opendaylight.protocol.pcep.segment.routing;
 
-import com.google.common.base.Charsets;
 import com.google.common.collect.Lists;
+import java.nio.charset.StandardCharsets;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
 import org.junit.Assert;
@@ -111,7 +111,7 @@ public class TopologyProviderTest extends AbstractPCEPSessionTest<Stateful07Topo
         return new PcrptBuilder().setPcrptMessage(new PcrptMessageBuilder().setReports(Lists.newArrayList(new ReportsBuilder()
             .setLsp(new LspBuilder().setPlspId(new PlspId(plspId)).setRemove(false).setSync(true).setAdministrative(true).setDelegate(true)
                     .setTlvs(lspTlvBuilder
-                        .setSymbolicPathName(new SymbolicPathNameBuilder().setPathName(new SymbolicPathName(pathName.getBytes(Charsets.UTF_8))).build()).build()).build())
+                        .setSymbolicPathName(new SymbolicPathNameBuilder().setPathName(new SymbolicPathName(pathName.getBytes(StandardCharsets.UTF_8))).build()).build()).build())
             .setSrp(new SrpBuilder().setOperationId(new SrpIdNumber(0L)).setTlvs(
                     new org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.ietf.stateful.rev131222.srp.object.srp.TlvsBuilder()
                         .setPathSetupType(new PathSetupTypeBuilder().setPst((short) 1).build()).build()).build())
index b96dd9e5efb9777e72fa79c6bbacd318e718159a..2dd33d1712c901e170169474b8444dd43c46d4d1 100644 (file)
@@ -7,7 +7,6 @@
  */
 package org.opendaylight.bgpcep.pcep.topology.provider;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Function;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
@@ -16,6 +15,7 @@ import com.google.common.util.concurrent.Futures;
 import com.google.common.util.concurrent.ListenableFuture;
 import java.net.InetAddress;
 import java.nio.ByteBuffer;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
@@ -357,7 +357,7 @@ class Stateful07TopologySessionListener extends AbstractTopologySessionListener<
 
         String name = lookupLspName(plspid);
         if (lsp.getTlvs() != null && lsp.getTlvs().getSymbolicPathName() != null) {
-            name = Charsets.UTF_8.decode(ByteBuffer.wrap(lsp.getTlvs().getSymbolicPathName().getPathName().getValue())).toString();
+            name = StandardCharsets.UTF_8.decode(ByteBuffer.wrap(lsp.getTlvs().getSymbolicPathName().getPathName().getValue())).toString();
         }
         //get LspDB from LSP and write it to pcc's node
         final LspDbVersion lspDbVersion = geLspDbVersionTlv(lsp);
@@ -467,7 +467,7 @@ class Stateful07TopologySessionListener extends AbstractTopologySessionListener<
                 tlvsBuilder = new TlvsBuilder();
             }
             tlvsBuilder.setSymbolicPathName(
-                new SymbolicPathNameBuilder().setPathName(new SymbolicPathName(this.input.getName().getBytes(Charsets.UTF_8))).build());
+                new SymbolicPathNameBuilder().setPathName(new SymbolicPathName(this.input.getName().getBytes(StandardCharsets.UTF_8))).build());
 
             final SrpBuilder srpBuilder = new SrpBuilder();
             srpBuilder.setOperationId(nextRequest());
index e9e36cf6b773aef6c740754fba59a8f5d6883654..deb9da54cd0a918e7422e97f5cd80dbc832cca7b 100755 (executable)
  */
 package org.opendaylight.controller.config.yang.pcep.topology.provider;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Optional;
 import com.google.common.base.Preconditions;
 import com.google.common.net.InetAddresses;
 import io.netty.channel.epoll.Epoll;
 import java.net.InetAddress;
 import java.net.InetSocketAddress;
+import java.nio.charset.StandardCharsets;
 import java.util.List;
 import java.util.concurrent.ExecutionException;
 import org.opendaylight.bgpcep.pcep.topology.provider.PCEPTopologyProvider;
@@ -74,7 +74,7 @@ public final class PCEPTopologyProviderModule extends
                 final Rfc2385Key rfc2385KeyPassword = c.getPassword();
                 if (rfc2385KeyPassword != null && !rfc2385KeyPassword.getValue().isEmpty()) {
                     final String s = getAddressString(c.getAddress());
-                    ret.put(InetAddresses.forString(s), rfc2385KeyPassword.getValue().getBytes(Charsets.US_ASCII));
+                    ret.put(InetAddresses.forString(s), rfc2385KeyPassword.getValue().getBytes(StandardCharsets.US_ASCII));
                 }
             }
         }
index b03fc8a4378bbb361adaddcc84196e8243ccbdb1..bf55743552d9e16d527485ee6c69c94f39b93914 100644 (file)
@@ -8,10 +8,10 @@
 
 package org.opendaylight.protocol.rsvp.parser.impl.te;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import java.nio.charset.StandardCharsets;
 import org.opendaylight.protocol.rsvp.parser.spi.RSVPParsingException;
 import org.opendaylight.protocol.rsvp.parser.spi.subobjects.AbstractRSVPObjectParser;
 import org.opendaylight.protocol.util.BitArray;
@@ -44,7 +44,7 @@ public final class SessionAttributeLspObjectParser extends AbstractRSVPObjectPar
         builder.setSeStyleDesired(bs.get(SE_STYLE));
         final short nameLenght = byteBuf.readUnsignedByte();
         final ByteBuf auxBuf = byteBuf.readSlice(nameLenght);
-        final String name = new String(ByteArray.readAllBytes(auxBuf), Charsets.US_ASCII);
+        final String name = new String(ByteArray.readAllBytes(auxBuf), StandardCharsets.US_ASCII);
         builder.setSessionName(name);
         return builder.build();
     }
@@ -54,7 +54,7 @@ public final class SessionAttributeLspObjectParser extends AbstractRSVPObjectPar
         Preconditions.checkArgument(teLspObject instanceof BasicSessionAttributeObject, "SessionAttributeObject is mandatory.");
 
         final BasicSessionAttributeObject sessionObject = (BasicSessionAttributeObject) teLspObject;
-        final ByteBuf sessionName = Unpooled.wrappedBuffer(Charsets.US_ASCII.encode(sessionObject.getSessionName()));
+        final ByteBuf sessionName = Unpooled.wrappedBuffer(StandardCharsets.US_ASCII.encode(sessionObject.getSessionName()));
         final int pad = getPadding(sessionName.readableBytes());
         serializeAttributeHeader(BODY_SIZE_C7 + pad + sessionName.readableBytes(), CLASS_NUM, CTYPE, output);
         output.writeByte(sessionObject.getSetupPriority());
index 71d55e7997d918580aa79dd740b01220f55c7c59..3f879b6e924bd898eee0ae9b21ab8cd178057d1d 100644 (file)
@@ -7,10 +7,10 @@
  */
 package org.opendaylight.protocol.rsvp.parser.impl.te;
 
-import com.google.common.base.Charsets;
 import com.google.common.base.Preconditions;
 import io.netty.buffer.ByteBuf;
 import io.netty.buffer.Unpooled;
+import java.nio.charset.StandardCharsets;
 import org.opendaylight.protocol.rsvp.parser.spi.RSVPParsingException;
 import org.opendaylight.protocol.rsvp.parser.spi.subobjects.AbstractRSVPObjectParser;
 import org.opendaylight.protocol.util.BitArray;
@@ -39,7 +39,7 @@ public final class SessionAttributeLspRaObjectParser extends AbstractRSVPObjectP
         builder.setSeStyleDesired(bs.get(SessionAttributeLspObjectParser.SE_STYLE));
         final short nameLenght = byteBuf.readUnsignedByte();
         final ByteBuf auxBuf = byteBuf.readSlice(nameLenght);
-        final String name = new String(ByteArray.readAllBytes(auxBuf), Charsets.US_ASCII);
+        final String name = new String(ByteArray.readAllBytes(auxBuf), StandardCharsets.US_ASCII);
         builder.setSessionName(name);
         return builder.build();
     }
@@ -49,7 +49,7 @@ public final class SessionAttributeLspRaObjectParser extends AbstractRSVPObjectP
         Preconditions.checkArgument(teLspObject instanceof SessionAttributeObjectWithResourcesAffinities, "SessionAttributeObject is mandatory.");
 
         final SessionAttributeObjectWithResourcesAffinities sessionObject = (SessionAttributeObjectWithResourcesAffinities) teLspObject;
-        final ByteBuf sessionName = Unpooled.wrappedBuffer(Charsets.US_ASCII.encode(sessionObject.getSessionName()));
+        final ByteBuf sessionName = Unpooled.wrappedBuffer(StandardCharsets.US_ASCII.encode(sessionObject.getSessionName()));
         final int pad = SessionAttributeLspObjectParser.getPadding(sessionName.readableBytes());
 
         serializeAttributeHeader(BODY_SIZE_C1 + pad + sessionName.readableBytes(), CLASS_NUM, CTYPE, output);
@@ -64,7 +64,7 @@ public final class SessionAttributeLspRaObjectParser extends AbstractRSVPObjectP
         bs.set(SessionAttributeLspObjectParser.SE_STYLE, sessionObject.isSeStyleDesired());
         bs.toByteBuf(output);
         output.writeByte(sessionName.readableBytes());
-        output.writeBytes(Unpooled.wrappedBuffer(Charsets.US_ASCII.encode(sessionObject.getSessionName())));
+        output.writeBytes(Unpooled.wrappedBuffer(StandardCharsets.US_ASCII.encode(sessionObject.getSessionName())));
         output.writeZero(pad);
     }
 }