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 ((Integer) id).compareTo((Integer) other.id);
return ((Integer) id).compareTo(other.id);
}
@Override

View File

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

View File

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