From 8a4e70884781a567f6da28ade87633b0fe1c9f37 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Wed, 24 Apr 2013 17:43:24 +0900 Subject: [PATCH] Fix 'unsupported address type error' in UDP tests / Fix checkstyle --- common/src/main/java/io/netty/util/NetUtil.java | 3 ++- .../netty/testsuite/transport/socket/AbstractDatagramTest.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/io/netty/util/NetUtil.java b/common/src/main/java/io/netty/util/NetUtil.java index e52cbfb01b..0ae1922ac5 100644 --- a/common/src/main/java/io/netty/util/NetUtil.java +++ b/common/src/main/java/io/netty/util/NetUtil.java @@ -123,7 +123,8 @@ public final class NetUtil { // Create IPv6 loopback address. Inet6Address localhost6 = null; try { - localhost6 = (Inet6Address) InetAddress.getByAddress(new byte[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}); + localhost6 = (Inet6Address) InetAddress.getByAddress( + new byte[]{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}); } catch (Exception e) { // We should not get here as long as the length of the address is correct. PlatformDependent.throwException(e); diff --git a/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractDatagramTest.java b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractDatagramTest.java index ef75baa5a6..8288fb1458 100644 --- a/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractDatagramTest.java +++ b/testsuite/src/test/java/io/netty/testsuite/transport/socket/AbstractDatagramTest.java @@ -49,7 +49,7 @@ public abstract class AbstractDatagramTest { sb = e.getKey().newInstance(); cb = e.getValue().newInstance(); addr = new InetSocketAddress( - NetUtil.LOCALHOST, TestUtils.getFreePort()); + NetUtil.LOCALHOST4, TestUtils.getFreePort()); sb.localAddress(addr); cb.localAddress(0).remoteAddress(addr);