Fix more compiler warnings

This commit is contained in:
Trustin Lee 2012-09-01 17:00:24 +09:00
parent 85f8247cef
commit f1c07dbf0b
3 changed files with 16 additions and 16 deletions

View File

@ -103,7 +103,7 @@ public class UniqueName implements Comparable<UniqueName> {
return returnCode; return returnCode;
} }
return ((Integer) id).compareTo((Integer) other.id); return ((Integer) id).compareTo(other.id);
} }
@Override @Override

View File

@ -15,10 +15,11 @@
*/ */
package io.netty.util; package io.netty.util;
import static org.junit.Assert.*;
import java.net.InetAddress; import java.net.InetAddress;
import java.net.UnknownHostException; import java.net.UnknownHostException;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertSame;
import org.junit.Test; import org.junit.Test;
public class NetworkConstantsTest { public class NetworkConstantsTest {
@ -30,7 +31,7 @@ public class NetworkConstantsTest {
} }
@Test @Test
public void testLoopback() throws UnknownHostException { public void testLoopback() {
assertNotNull(NetworkConstants.LOOPBACK_IF); assertNotNull(NetworkConstants.LOOPBACK_IF);
} }

View File

@ -15,12 +15,11 @@
*/ */
package io.netty.util; package io.netty.util;
import static org.junit.Assert.*;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertSame;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
@ -31,7 +30,7 @@ public class UniqueNameTest {
* This is set up before each test * This is set up before each test
*/ */
private ConcurrentHashMap<String, Boolean> names; private ConcurrentHashMap<String, Boolean> names;
/** /**
* Registers a {@link UniqueName} * Registers a {@link UniqueName}
* *
@ -44,30 +43,30 @@ public class UniqueNameTest {
@Before @Before
public void initializeTest() { public void initializeTest() {
this.names = new ConcurrentHashMap<String, Boolean>(); names = new ConcurrentHashMap<String, Boolean>();
} }
@Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class)
public void testCannnotProvideNullMap() { public void testCannnotProvideNullMap() {
UniqueName nullName = new UniqueName(null, "Nothing"); new UniqueName(null, "Nothing");
} }
@Test(expected=NullPointerException.class) @Test(expected=NullPointerException.class)
public void testCannotProvideNullName() { public void testCannotProvideNullName() {
UniqueName nullName = new UniqueName(this.names, null); new UniqueName(names, null);
} }
@Test @Test
public void testArgsCanBePassed() { public void testArgsCanBePassed() {
UniqueName nullName = new UniqueName(this.names, "Argh, matey!", 2, 5, new Object()); new UniqueName(names, "Argh, matey!", 2, 5, new Object());
} }
@Test @Test
public void testRegisteringName() { public void testRegisteringName() {
registerName("Abcedrian"); registerName("Abcedrian");
assertTrue(this.names.get("Abcedrian")); assertTrue(names.get("Abcedrian"));
assertTrue(this.names.get("Hellyes") == null); assertTrue(names.get("Hellyes") == null);
} }
@Test @Test
@ -103,7 +102,7 @@ public class UniqueNameTest {
} }
} }
} }
@Test @Test
public void testCompareNames() { public void testCompareNames() {
UniqueName one = registerName("One"); UniqueName one = registerName("One");