From 22b3885fe58b5a6055fac98b17f422a769b7c259 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Mon, 8 Dec 2008 08:24:48 +0000 Subject: [PATCH] Automatic code cleanup --- .../org/jboss/netty/handler/codec/http/HttpMethod.java | 2 +- .../jboss/netty/handler/codec/http/HttpVersion.java | 10 +++++----- .../org/jboss/netty/util/TimeBasedUuidGenerator.java | 2 +- .../jboss/netty/channel/CompleteChannelFutureTest.java | 2 +- .../socket/NioClientSocketShutdownTimeTest.java | 3 ++- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/jboss/netty/handler/codec/http/HttpMethod.java b/src/main/java/org/jboss/netty/handler/codec/http/HttpMethod.java index 6f6187997f..82930b7531 100644 --- a/src/main/java/org/jboss/netty/handler/codec/http/HttpMethod.java +++ b/src/main/java/org/jboss/netty/handler/codec/http/HttpMethod.java @@ -108,7 +108,7 @@ public class HttpMethod implements Comparable { } } - private String method; + private final String method; public HttpMethod(String method) { if (method == null) { diff --git a/src/main/java/org/jboss/netty/handler/codec/http/HttpVersion.java b/src/main/java/org/jboss/netty/handler/codec/http/HttpVersion.java index 4607c7479d..d6dd89c455 100644 --- a/src/main/java/org/jboss/netty/handler/codec/http/HttpVersion.java +++ b/src/main/java/org/jboss/netty/handler/codec/http/HttpVersion.java @@ -68,10 +68,10 @@ public class HttpVersion implements Comparable { throw new IllegalArgumentException("invalid version format: " + value); } - this.protocolName = m.group(1); - this.majorVersion = Integer.parseInt(m.group(2)); - this.minorVersion = Integer.parseInt(m.group(3)); - this.string = protocolName + '/' + majorVersion + '.' + minorVersion; + protocolName = m.group(1); + majorVersion = Integer.parseInt(m.group(2)); + minorVersion = Integer.parseInt(m.group(3)); + string = protocolName + '/' + majorVersion + '.' + minorVersion; } public HttpVersion( @@ -101,7 +101,7 @@ public class HttpVersion implements Comparable { this.protocolName = protocolName; this.majorVersion = majorVersion; this.minorVersion = minorVersion; - this.string = protocolName + '/' + majorVersion + '.' + minorVersion; + string = protocolName + '/' + majorVersion + '.' + minorVersion; } public String getProtocolName() { diff --git a/src/main/java/org/jboss/netty/util/TimeBasedUuidGenerator.java b/src/main/java/org/jboss/netty/util/TimeBasedUuidGenerator.java index 77702b157a..54f9b613d2 100644 --- a/src/main/java/org/jboss/netty/util/TimeBasedUuidGenerator.java +++ b/src/main/java/org/jboss/netty/util/TimeBasedUuidGenerator.java @@ -128,7 +128,7 @@ public class TimeBasedUuidGenerator { final long ts; final int cs; synchronized (counterLock) { - cs = (clockSeq ++) & 0x3FFF; // 0~16383 + cs = clockSeq ++ & 0x3FFF; // 0~16383 if (cs == 0) { // Not all platform has millisecond precision for // System.currentTimeMillis() - Just focus on generating diff --git a/src/test/java/org/jboss/netty/channel/CompleteChannelFutureTest.java b/src/test/java/org/jboss/netty/channel/CompleteChannelFutureTest.java index a7fe779bee..26ac877bb5 100644 --- a/src/test/java/org/jboss/netty/channel/CompleteChannelFutureTest.java +++ b/src/test/java/org/jboss/netty/channel/CompleteChannelFutureTest.java @@ -112,7 +112,7 @@ public class CompleteChannelFutureTest { throw new Error(); } } - + private static class ExpectedError extends Error { private static final long serialVersionUID = 7059276744882005047L; diff --git a/src/test/java/org/jboss/netty/channel/socket/NioClientSocketShutdownTimeTest.java b/src/test/java/org/jboss/netty/channel/socket/NioClientSocketShutdownTimeTest.java index f6693a086e..33bbf1dc8e 100644 --- a/src/test/java/org/jboss/netty/channel/socket/NioClientSocketShutdownTimeTest.java +++ b/src/test/java/org/jboss/netty/channel/socket/NioClientSocketShutdownTimeTest.java @@ -22,6 +22,8 @@ */ package org.jboss.netty.channel.socket; +import static org.junit.Assert.*; + import java.io.IOException; import java.net.InetAddress; import java.net.InetSocketAddress; @@ -33,7 +35,6 @@ import org.jboss.netty.channel.ChannelFuture; import org.jboss.netty.channel.socket.nio.NioClientSocketChannelFactory; import org.jboss.netty.util.DummyHandler; import org.jboss.netty.util.TimeBasedUuidGenerator; -import static org.junit.Assert.*; import org.junit.Test;