Overall automated clean up

This commit is contained in:
Trustin Lee 2012-05-31 11:52:10 -07:00
parent fae19efd73
commit b0a2b43379
174 changed files with 1214 additions and 1209 deletions

View File

@ -17,18 +17,6 @@ package org.jboss.netty.channel.socket.nio;
import static org.jboss.netty.channel.Channels.*;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelException;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.socket.Worker;
import org.jboss.netty.channel.socket.nio.SocketSendBufferPool.SendBuffer;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.ThreadRenamingRunnable;
import org.jboss.netty.util.internal.DeadLockProofWorker;
import org.jboss.netty.util.internal.QueueFactory;
import java.io.IOException;
import java.nio.channels.AsynchronousCloseException;
import java.nio.channels.CancelledKeyException;
@ -47,6 +35,18 @@ import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelException;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.socket.Worker;
import org.jboss.netty.channel.socket.nio.SocketSendBufferPool.SendBuffer;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.ThreadRenamingRunnable;
import org.jboss.netty.util.internal.DeadLockProofWorker;
import org.jboss.netty.util.internal.QueueFactory;
abstract class AbstractNioWorker implements Worker {
@ -157,7 +157,7 @@ abstract class AbstractNioWorker implements Worker {
if (!started) {
// Open a selector if this worker didn't start yet.
try {
this.selector = Selector.open();
selector = Selector.open();
} catch (Throwable t) {
throw new ChannelException("Failed to create a selector.", t);
}
@ -175,7 +175,7 @@ abstract class AbstractNioWorker implements Worker {
} catch (Throwable t) {
logger.warn("Failed to close a selector.", t);
}
this.selector = null;
selector = null;
// The method will return to the caller at this point.
}
}

View File

@ -16,14 +16,14 @@
package org.jboss.netty.channel.socket.nio;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicInteger;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.socket.Worker;
import org.jboss.netty.util.ExternalResourceReleasable;
import org.jboss.netty.util.internal.ExecutorUtil;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicInteger;
/**
* Abstract base class for {@link WorkerPool} implementations that create the {@link Worker}'s up-front and return them in a "fair" fashion when calling
* {@link #nextWorker()}

View File

@ -15,7 +15,7 @@
*/
package org.jboss.netty.channel.socket.nio;
import static org.jboss.netty.channel.Channels.fireChannelOpen;
import static org.jboss.netty.channel.Channels.*;
import java.nio.channels.SocketChannel;

View File

@ -15,18 +15,7 @@
*/
package org.jboss.netty.channel.socket.nio;
import static org.jboss.netty.channel.Channels.fireChannelDisconnected;
import static org.jboss.netty.channel.Channels.fireChannelDisconnectedLater;
import static org.jboss.netty.channel.Channels.fireExceptionCaught;
import static org.jboss.netty.channel.Channels.fireExceptionCaughtLater;
import static org.jboss.netty.channel.Channels.fireMessageReceived;
import static org.jboss.netty.channel.Channels.succeededFuture;
import org.jboss.netty.buffer.ChannelBufferFactory;
import org.jboss.netty.channel.ChannelException;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.ReceiveBufferSizePredictor;
import static org.jboss.netty.channel.Channels.*;
import java.io.IOException;
import java.net.SocketAddress;
@ -39,6 +28,13 @@ import java.nio.channels.Selector;
import java.util.Queue;
import java.util.concurrent.Executor;
import org.jboss.netty.buffer.ChannelBufferFactory;
import org.jboss.netty.channel.ChannelException;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.ReceiveBufferSizePredictor;
/**
* A class responsible for registering channels with {@link Selector}.
* It also implements the {@link Selector} loop.

View File

@ -15,16 +15,7 @@
*/
package org.jboss.netty.channel.socket.nio;
import static org.jboss.netty.channel.Channels.fireChannelBound;
import static org.jboss.netty.channel.Channels.fireChannelConnected;
import static org.jboss.netty.channel.Channels.fireExceptionCaught;
import static org.jboss.netty.channel.Channels.fireMessageReceived;
import static org.jboss.netty.channel.Channels.succeededFuture;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBufferFactory;
import org.jboss.netty.channel.ChannelException;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ReceiveBufferSizePredictor;
import static org.jboss.netty.channel.Channels.*;
import java.io.IOException;
import java.net.SocketAddress;
@ -35,6 +26,12 @@ import java.nio.channels.Selector;
import java.nio.channels.SocketChannel;
import java.util.concurrent.Executor;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBufferFactory;
import org.jboss.netty.channel.ChannelException;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ReceiveBufferSizePredictor;
public class NioWorker extends AbstractNioWorker {
private final SocketReceiveBufferPool recvBufferPool = new SocketReceiveBufferPool();

View File

@ -267,7 +267,7 @@ final class SocketSendBufferPool {
GatheringSendBuffer(ByteBuffer[] buffers) {
this.buffers = buffers;
this.last = buffers.length - 1;
last = buffers.length - 1;
int total = 0;
for (ByteBuffer buf: buffers) {
total += buf.remaining();

View File

@ -16,15 +16,16 @@
package org.jboss.netty.channel.socket.oio;
import static org.jboss.netty.channel.Channels.*;
import java.io.IOException;
import java.util.Queue;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.channel.socket.Worker;
import org.jboss.netty.util.internal.QueueFactory;
import java.io.IOException;
import java.util.Queue;
/**
* Abstract base class for Oio-Worker implementations
*

View File

@ -15,8 +15,7 @@
*/
package org.jboss.netty.channel.socket.oio;
import static org.jboss.netty.channel.Channels.fireChannelBound;
import static org.jboss.netty.channel.Channels.fireChannelOpen;
import static org.jboss.netty.channel.Channels.*;
import java.io.IOException;
import java.io.OutputStream;

View File

@ -31,16 +31,16 @@ import org.jboss.netty.handler.codec.http.CookieEncoder;
import org.jboss.netty.handler.codec.http.DefaultHttpRequest;
import org.jboss.netty.handler.codec.http.HttpHeaders;
import org.jboss.netty.handler.codec.http.HttpMethod;
import org.jboss.netty.handler.codec.http.HttpRequest;
import org.jboss.netty.handler.codec.http.HttpVersion;
import org.jboss.netty.handler.codec.http.QueryStringEncoder;
import org.jboss.netty.handler.codec.http.multipart.DefaultHttpDataFactory;
import org.jboss.netty.handler.codec.http.multipart.DiskAttribute;
import org.jboss.netty.handler.codec.http.multipart.DiskFileUpload;
import org.jboss.netty.handler.codec.http.multipart.HttpDataFactory;
import org.jboss.netty.handler.codec.http.multipart.HttpPostRequestEncoder;
import org.jboss.netty.handler.codec.http.multipart.InterfaceHttpData;
import org.jboss.netty.handler.codec.http.multipart.HttpPostRequestEncoder.ErrorDataEncoderException;
import org.jboss.netty.handler.codec.http.HttpRequest;
import org.jboss.netty.handler.codec.http.HttpVersion;
import org.jboss.netty.handler.codec.http.QueryStringEncoder;
import org.jboss.netty.handler.codec.http.multipart.InterfaceHttpData;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;

View File

@ -44,6 +44,7 @@ import org.jboss.netty.handler.codec.http.HttpRequest;
import org.jboss.netty.handler.codec.http.HttpResponse;
import org.jboss.netty.handler.codec.http.HttpResponseStatus;
import org.jboss.netty.handler.codec.http.HttpVersion;
import org.jboss.netty.handler.codec.http.QueryStringDecoder;
import org.jboss.netty.handler.codec.http.multipart.Attribute;
import org.jboss.netty.handler.codec.http.multipart.DefaultHttpDataFactory;
import org.jboss.netty.handler.codec.http.multipart.DiskAttribute;
@ -51,13 +52,12 @@ import org.jboss.netty.handler.codec.http.multipart.DiskFileUpload;
import org.jboss.netty.handler.codec.http.multipart.FileUpload;
import org.jboss.netty.handler.codec.http.multipart.HttpDataFactory;
import org.jboss.netty.handler.codec.http.multipart.HttpPostRequestDecoder;
import org.jboss.netty.handler.codec.http.multipart.InterfaceHttpData;
import org.jboss.netty.handler.codec.http.multipart.HttpPostRequestDecoder.EndOfDataDecoderException;
import org.jboss.netty.handler.codec.http.multipart.HttpPostRequestDecoder.ErrorDataDecoderException;
import org.jboss.netty.handler.codec.http.multipart.HttpPostRequestDecoder.IncompatibleDataDecoderException;
import org.jboss.netty.handler.codec.http.multipart.HttpPostRequestDecoder.NotEnoughDataDecoderException;
import org.jboss.netty.handler.codec.http.multipart.InterfaceHttpData;
import org.jboss.netty.handler.codec.http.multipart.InterfaceHttpData.HttpDataType;
import org.jboss.netty.handler.codec.http.QueryStringDecoder;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.CharsetUtil;

View File

@ -15,7 +15,7 @@
*/
package org.jboss.netty.example.http.upload;
import static org.jboss.netty.channel.Channels.pipeline;
import static org.jboss.netty.channel.Channels.*;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;

View File

@ -249,7 +249,7 @@ public final class LocalTimeProtocol {
public static final int CONTINENT_FIELD_NUMBER = 1;
private org.jboss.netty.example.localtime.LocalTimeProtocol.Continent continent_;
public boolean hasContinent() {
return ((bitField0_ & 0x00000001) == 0x00000001);
return (bitField0_ & 0x00000001) == 0x00000001;
}
public org.jboss.netty.example.localtime.LocalTimeProtocol.Continent getContinent() {
return continent_;
@ -259,7 +259,7 @@ public final class LocalTimeProtocol {
public static final int CITY_FIELD_NUMBER = 2;
private java.lang.Object city_;
public boolean hasCity() {
return ((bitField0_ & 0x00000002) == 0x00000002);
return (bitField0_ & 0x00000002) == 0x00000002;
}
public String getCity() {
java.lang.Object ref = city_;
@ -294,7 +294,9 @@ public final class LocalTimeProtocol {
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (isInitialized != -1) {
return isInitialized == 1;
}
if (!hasContinent()) {
memoizedIsInitialized = 0;
@ -311,10 +313,10 @@ public final class LocalTimeProtocol {
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
if ((bitField0_ & 0x00000001) == 0x00000001) {
output.writeEnum(1, continent_.getNumber());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
if ((bitField0_ & 0x00000002) == 0x00000002) {
output.writeBytes(2, getCityBytes());
}
getUnknownFields().writeTo(output);
@ -323,14 +325,16 @@ public final class LocalTimeProtocol {
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
if (size != -1) {
return size;
}
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
if ((bitField0_ & 0x00000001) == 0x00000001) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(1, continent_.getNumber());
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
if ((bitField0_ & 0x00000002) == 0x00000002) {
size += com.google.protobuf.CodedOutputStream
.computeBytesSize(2, getCityBytes());
}
@ -459,9 +463,9 @@ public final class LocalTimeProtocol {
public Builder clear() {
super.clear();
continent_ = org.jboss.netty.example.localtime.LocalTimeProtocol.Continent.AFRICA;
bitField0_ = (bitField0_ & ~0x00000001);
bitField0_ = bitField0_ & ~0x00000001;
city_ = "";
bitField0_ = (bitField0_ & ~0x00000002);
bitField0_ = bitField0_ & ~0x00000002;
return this;
}
@ -500,11 +504,11 @@ public final class LocalTimeProtocol {
org.jboss.netty.example.localtime.LocalTimeProtocol.Location result = new org.jboss.netty.example.localtime.LocalTimeProtocol.Location(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
if ((from_bitField0_ & 0x00000001) == 0x00000001) {
to_bitField0_ |= 0x00000001;
}
result.continent_ = continent_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
if ((from_bitField0_ & 0x00000002) == 0x00000002) {
to_bitField0_ |= 0x00000002;
}
result.city_ = city_;
@ -523,14 +527,16 @@ public final class LocalTimeProtocol {
}
public Builder mergeFrom(org.jboss.netty.example.localtime.LocalTimeProtocol.Location other) {
if (other == org.jboss.netty.example.localtime.LocalTimeProtocol.Location.getDefaultInstance()) return this;
if (other == org.jboss.netty.example.localtime.LocalTimeProtocol.Location.getDefaultInstance()) {
return this;
}
if (other.hasContinent()) {
setContinent(other.getContinent());
}
if (other.hasCity()) {
setCity(other.getCity());
}
this.mergeUnknownFields(other.getUnknownFields());
mergeUnknownFields(other.getUnknownFields());
return this;
}
@ -552,18 +558,18 @@ public final class LocalTimeProtocol {
throws java.io.IOException {
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder(
this.getUnknownFields());
getUnknownFields());
while (true) {
int tag = input.readTag();
switch (tag) {
case 0:
this.setUnknownFields(unknownFields.build());
setUnknownFields(unknownFields.build());
onChanged();
return this;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
this.setUnknownFields(unknownFields.build());
setUnknownFields(unknownFields.build());
onChanged();
return this;
}
@ -594,7 +600,7 @@ public final class LocalTimeProtocol {
// required .org.jboss.netty.example.localtime.Continent continent = 1;
private org.jboss.netty.example.localtime.LocalTimeProtocol.Continent continent_ = org.jboss.netty.example.localtime.LocalTimeProtocol.Continent.AFRICA;
public boolean hasContinent() {
return ((bitField0_ & 0x00000001) == 0x00000001);
return (bitField0_ & 0x00000001) == 0x00000001;
}
public org.jboss.netty.example.localtime.LocalTimeProtocol.Continent getContinent() {
return continent_;
@ -609,7 +615,7 @@ public final class LocalTimeProtocol {
return this;
}
public Builder clearContinent() {
bitField0_ = (bitField0_ & ~0x00000001);
bitField0_ = bitField0_ & ~0x00000001;
continent_ = org.jboss.netty.example.localtime.LocalTimeProtocol.Continent.AFRICA;
onChanged();
return this;
@ -618,7 +624,7 @@ public final class LocalTimeProtocol {
// required string city = 2;
private java.lang.Object city_ = "";
public boolean hasCity() {
return ((bitField0_ & 0x00000002) == 0x00000002);
return (bitField0_ & 0x00000002) == 0x00000002;
}
public String getCity() {
java.lang.Object ref = city_;
@ -640,7 +646,7 @@ public final class LocalTimeProtocol {
return this;
}
public Builder clearCity() {
bitField0_ = (bitField0_ & ~0x00000002);
bitField0_ = bitField0_ & ~0x00000002;
city_ = getDefaultInstance().getCity();
onChanged();
return this;
@ -730,7 +736,9 @@ public final class LocalTimeProtocol {
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (isInitialized != -1) {
return isInitialized == 1;
}
for (int i = 0; i < getLocationCount(); i++) {
if (!getLocation(i).isInitialized()) {
@ -754,7 +762,9 @@ public final class LocalTimeProtocol {
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
if (size != -1) {
return size;
}
size = 0;
for (int i = 0; i < location_.size(); i++) {
@ -888,7 +898,7 @@ public final class LocalTimeProtocol {
super.clear();
if (locationBuilder_ == null) {
location_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
bitField0_ = bitField0_ & ~0x00000001;
} else {
locationBuilder_.clear();
}
@ -930,9 +940,9 @@ public final class LocalTimeProtocol {
org.jboss.netty.example.localtime.LocalTimeProtocol.Locations result = new org.jboss.netty.example.localtime.LocalTimeProtocol.Locations(this);
int from_bitField0_ = bitField0_;
if (locationBuilder_ == null) {
if (((bitField0_ & 0x00000001) == 0x00000001)) {
if ((bitField0_ & 0x00000001) == 0x00000001) {
location_ = java.util.Collections.unmodifiableList(location_);
bitField0_ = (bitField0_ & ~0x00000001);
bitField0_ = bitField0_ & ~0x00000001;
}
result.location_ = location_;
} else {
@ -952,12 +962,14 @@ public final class LocalTimeProtocol {
}
public Builder mergeFrom(org.jboss.netty.example.localtime.LocalTimeProtocol.Locations other) {
if (other == org.jboss.netty.example.localtime.LocalTimeProtocol.Locations.getDefaultInstance()) return this;
if (other == org.jboss.netty.example.localtime.LocalTimeProtocol.Locations.getDefaultInstance()) {
return this;
}
if (locationBuilder_ == null) {
if (!other.location_.isEmpty()) {
if (location_.isEmpty()) {
location_ = other.location_;
bitField0_ = (bitField0_ & ~0x00000001);
bitField0_ = bitField0_ & ~0x00000001;
} else {
ensureLocationIsMutable();
location_.addAll(other.location_);
@ -970,7 +982,7 @@ public final class LocalTimeProtocol {
locationBuilder_.dispose();
locationBuilder_ = null;
location_ = other.location_;
bitField0_ = (bitField0_ & ~0x00000001);
bitField0_ = bitField0_ & ~0x00000001;
locationBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getLocationFieldBuilder() : null;
@ -979,7 +991,7 @@ public final class LocalTimeProtocol {
}
}
}
this.mergeUnknownFields(other.getUnknownFields());
mergeUnknownFields(other.getUnknownFields());
return this;
}
@ -999,18 +1011,18 @@ public final class LocalTimeProtocol {
throws java.io.IOException {
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder(
this.getUnknownFields());
getUnknownFields());
while (true) {
int tag = input.readTag();
switch (tag) {
case 0:
this.setUnknownFields(unknownFields.build());
setUnknownFields(unknownFields.build());
onChanged();
return this;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
this.setUnknownFields(unknownFields.build());
setUnknownFields(unknownFields.build());
onChanged();
return this;
}
@ -1150,7 +1162,7 @@ public final class LocalTimeProtocol {
public Builder clearLocation() {
if (locationBuilder_ == null) {
location_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
bitField0_ = bitField0_ & ~0x00000001;
onChanged();
} else {
locationBuilder_.clear();
@ -1206,7 +1218,7 @@ public final class LocalTimeProtocol {
locationBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
org.jboss.netty.example.localtime.LocalTimeProtocol.Location, org.jboss.netty.example.localtime.LocalTimeProtocol.Location.Builder, org.jboss.netty.example.localtime.LocalTimeProtocol.LocationOrBuilder>(
location_,
((bitField0_ & 0x00000001) == 0x00000001),
(bitField0_ & 0x00000001) == 0x00000001,
getParentForChildren(),
isClean());
location_ = null;
@ -1289,7 +1301,7 @@ public final class LocalTimeProtocol {
public static final int YEAR_FIELD_NUMBER = 1;
private int year_;
public boolean hasYear() {
return ((bitField0_ & 0x00000001) == 0x00000001);
return (bitField0_ & 0x00000001) == 0x00000001;
}
public int getYear() {
return year_;
@ -1299,7 +1311,7 @@ public final class LocalTimeProtocol {
public static final int MONTH_FIELD_NUMBER = 2;
private int month_;
public boolean hasMonth() {
return ((bitField0_ & 0x00000002) == 0x00000002);
return (bitField0_ & 0x00000002) == 0x00000002;
}
public int getMonth() {
return month_;
@ -1309,7 +1321,7 @@ public final class LocalTimeProtocol {
public static final int DAYOFMONTH_FIELD_NUMBER = 4;
private int dayOfMonth_;
public boolean hasDayOfMonth() {
return ((bitField0_ & 0x00000004) == 0x00000004);
return (bitField0_ & 0x00000004) == 0x00000004;
}
public int getDayOfMonth() {
return dayOfMonth_;
@ -1319,7 +1331,7 @@ public final class LocalTimeProtocol {
public static final int DAYOFWEEK_FIELD_NUMBER = 5;
private org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek dayOfWeek_;
public boolean hasDayOfWeek() {
return ((bitField0_ & 0x00000008) == 0x00000008);
return (bitField0_ & 0x00000008) == 0x00000008;
}
public org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek getDayOfWeek() {
return dayOfWeek_;
@ -1329,7 +1341,7 @@ public final class LocalTimeProtocol {
public static final int HOUR_FIELD_NUMBER = 6;
private int hour_;
public boolean hasHour() {
return ((bitField0_ & 0x00000010) == 0x00000010);
return (bitField0_ & 0x00000010) == 0x00000010;
}
public int getHour() {
return hour_;
@ -1339,7 +1351,7 @@ public final class LocalTimeProtocol {
public static final int MINUTE_FIELD_NUMBER = 7;
private int minute_;
public boolean hasMinute() {
return ((bitField0_ & 0x00000020) == 0x00000020);
return (bitField0_ & 0x00000020) == 0x00000020;
}
public int getMinute() {
return minute_;
@ -1349,7 +1361,7 @@ public final class LocalTimeProtocol {
public static final int SECOND_FIELD_NUMBER = 8;
private int second_;
public boolean hasSecond() {
return ((bitField0_ & 0x00000040) == 0x00000040);
return (bitField0_ & 0x00000040) == 0x00000040;
}
public int getSecond() {
return second_;
@ -1367,7 +1379,9 @@ public final class LocalTimeProtocol {
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (isInitialized != -1) {
return isInitialized == 1;
}
if (!hasYear()) {
memoizedIsInitialized = 0;
@ -1404,25 +1418,25 @@ public final class LocalTimeProtocol {
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
getSerializedSize();
if (((bitField0_ & 0x00000001) == 0x00000001)) {
if ((bitField0_ & 0x00000001) == 0x00000001) {
output.writeUInt32(1, year_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
if ((bitField0_ & 0x00000002) == 0x00000002) {
output.writeUInt32(2, month_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
if ((bitField0_ & 0x00000004) == 0x00000004) {
output.writeUInt32(4, dayOfMonth_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
if ((bitField0_ & 0x00000008) == 0x00000008) {
output.writeEnum(5, dayOfWeek_.getNumber());
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
if ((bitField0_ & 0x00000010) == 0x00000010) {
output.writeUInt32(6, hour_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
if ((bitField0_ & 0x00000020) == 0x00000020) {
output.writeUInt32(7, minute_);
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
if ((bitField0_ & 0x00000040) == 0x00000040) {
output.writeUInt32(8, second_);
}
getUnknownFields().writeTo(output);
@ -1431,34 +1445,36 @@ public final class LocalTimeProtocol {
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
if (size != -1) {
return size;
}
size = 0;
if (((bitField0_ & 0x00000001) == 0x00000001)) {
if ((bitField0_ & 0x00000001) == 0x00000001) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(1, year_);
}
if (((bitField0_ & 0x00000002) == 0x00000002)) {
if ((bitField0_ & 0x00000002) == 0x00000002) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(2, month_);
}
if (((bitField0_ & 0x00000004) == 0x00000004)) {
if ((bitField0_ & 0x00000004) == 0x00000004) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(4, dayOfMonth_);
}
if (((bitField0_ & 0x00000008) == 0x00000008)) {
if ((bitField0_ & 0x00000008) == 0x00000008) {
size += com.google.protobuf.CodedOutputStream
.computeEnumSize(5, dayOfWeek_.getNumber());
}
if (((bitField0_ & 0x00000010) == 0x00000010)) {
if ((bitField0_ & 0x00000010) == 0x00000010) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(6, hour_);
}
if (((bitField0_ & 0x00000020) == 0x00000020)) {
if ((bitField0_ & 0x00000020) == 0x00000020) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(7, minute_);
}
if (((bitField0_ & 0x00000040) == 0x00000040)) {
if ((bitField0_ & 0x00000040) == 0x00000040) {
size += com.google.protobuf.CodedOutputStream
.computeUInt32Size(8, second_);
}
@ -1587,19 +1603,19 @@ public final class LocalTimeProtocol {
public Builder clear() {
super.clear();
year_ = 0;
bitField0_ = (bitField0_ & ~0x00000001);
bitField0_ = bitField0_ & ~0x00000001;
month_ = 0;
bitField0_ = (bitField0_ & ~0x00000002);
bitField0_ = bitField0_ & ~0x00000002;
dayOfMonth_ = 0;
bitField0_ = (bitField0_ & ~0x00000004);
bitField0_ = bitField0_ & ~0x00000004;
dayOfWeek_ = org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek.SUNDAY;
bitField0_ = (bitField0_ & ~0x00000008);
bitField0_ = bitField0_ & ~0x00000008;
hour_ = 0;
bitField0_ = (bitField0_ & ~0x00000010);
bitField0_ = bitField0_ & ~0x00000010;
minute_ = 0;
bitField0_ = (bitField0_ & ~0x00000020);
bitField0_ = bitField0_ & ~0x00000020;
second_ = 0;
bitField0_ = (bitField0_ & ~0x00000040);
bitField0_ = bitField0_ & ~0x00000040;
return this;
}
@ -1638,31 +1654,31 @@ public final class LocalTimeProtocol {
org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime result = new org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime(this);
int from_bitField0_ = bitField0_;
int to_bitField0_ = 0;
if (((from_bitField0_ & 0x00000001) == 0x00000001)) {
if ((from_bitField0_ & 0x00000001) == 0x00000001) {
to_bitField0_ |= 0x00000001;
}
result.year_ = year_;
if (((from_bitField0_ & 0x00000002) == 0x00000002)) {
if ((from_bitField0_ & 0x00000002) == 0x00000002) {
to_bitField0_ |= 0x00000002;
}
result.month_ = month_;
if (((from_bitField0_ & 0x00000004) == 0x00000004)) {
if ((from_bitField0_ & 0x00000004) == 0x00000004) {
to_bitField0_ |= 0x00000004;
}
result.dayOfMonth_ = dayOfMonth_;
if (((from_bitField0_ & 0x00000008) == 0x00000008)) {
if ((from_bitField0_ & 0x00000008) == 0x00000008) {
to_bitField0_ |= 0x00000008;
}
result.dayOfWeek_ = dayOfWeek_;
if (((from_bitField0_ & 0x00000010) == 0x00000010)) {
if ((from_bitField0_ & 0x00000010) == 0x00000010) {
to_bitField0_ |= 0x00000010;
}
result.hour_ = hour_;
if (((from_bitField0_ & 0x00000020) == 0x00000020)) {
if ((from_bitField0_ & 0x00000020) == 0x00000020) {
to_bitField0_ |= 0x00000020;
}
result.minute_ = minute_;
if (((from_bitField0_ & 0x00000040) == 0x00000040)) {
if ((from_bitField0_ & 0x00000040) == 0x00000040) {
to_bitField0_ |= 0x00000040;
}
result.second_ = second_;
@ -1681,7 +1697,9 @@ public final class LocalTimeProtocol {
}
public Builder mergeFrom(org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime other) {
if (other == org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.getDefaultInstance()) return this;
if (other == org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.getDefaultInstance()) {
return this;
}
if (other.hasYear()) {
setYear(other.getYear());
}
@ -1703,7 +1721,7 @@ public final class LocalTimeProtocol {
if (other.hasSecond()) {
setSecond(other.getSecond());
}
this.mergeUnknownFields(other.getUnknownFields());
mergeUnknownFields(other.getUnknownFields());
return this;
}
@ -1745,18 +1763,18 @@ public final class LocalTimeProtocol {
throws java.io.IOException {
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder(
this.getUnknownFields());
getUnknownFields());
while (true) {
int tag = input.readTag();
switch (tag) {
case 0:
this.setUnknownFields(unknownFields.build());
setUnknownFields(unknownFields.build());
onChanged();
return this;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
this.setUnknownFields(unknownFields.build());
setUnknownFields(unknownFields.build());
onChanged();
return this;
}
@ -1812,7 +1830,7 @@ public final class LocalTimeProtocol {
// required uint32 year = 1;
private int year_ ;
public boolean hasYear() {
return ((bitField0_ & 0x00000001) == 0x00000001);
return (bitField0_ & 0x00000001) == 0x00000001;
}
public int getYear() {
return year_;
@ -1824,7 +1842,7 @@ public final class LocalTimeProtocol {
return this;
}
public Builder clearYear() {
bitField0_ = (bitField0_ & ~0x00000001);
bitField0_ = bitField0_ & ~0x00000001;
year_ = 0;
onChanged();
return this;
@ -1833,7 +1851,7 @@ public final class LocalTimeProtocol {
// required uint32 month = 2;
private int month_ ;
public boolean hasMonth() {
return ((bitField0_ & 0x00000002) == 0x00000002);
return (bitField0_ & 0x00000002) == 0x00000002;
}
public int getMonth() {
return month_;
@ -1845,7 +1863,7 @@ public final class LocalTimeProtocol {
return this;
}
public Builder clearMonth() {
bitField0_ = (bitField0_ & ~0x00000002);
bitField0_ = bitField0_ & ~0x00000002;
month_ = 0;
onChanged();
return this;
@ -1854,7 +1872,7 @@ public final class LocalTimeProtocol {
// required uint32 dayOfMonth = 4;
private int dayOfMonth_ ;
public boolean hasDayOfMonth() {
return ((bitField0_ & 0x00000004) == 0x00000004);
return (bitField0_ & 0x00000004) == 0x00000004;
}
public int getDayOfMonth() {
return dayOfMonth_;
@ -1866,7 +1884,7 @@ public final class LocalTimeProtocol {
return this;
}
public Builder clearDayOfMonth() {
bitField0_ = (bitField0_ & ~0x00000004);
bitField0_ = bitField0_ & ~0x00000004;
dayOfMonth_ = 0;
onChanged();
return this;
@ -1875,7 +1893,7 @@ public final class LocalTimeProtocol {
// required .org.jboss.netty.example.localtime.DayOfWeek dayOfWeek = 5;
private org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek dayOfWeek_ = org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek.SUNDAY;
public boolean hasDayOfWeek() {
return ((bitField0_ & 0x00000008) == 0x00000008);
return (bitField0_ & 0x00000008) == 0x00000008;
}
public org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek getDayOfWeek() {
return dayOfWeek_;
@ -1890,7 +1908,7 @@ public final class LocalTimeProtocol {
return this;
}
public Builder clearDayOfWeek() {
bitField0_ = (bitField0_ & ~0x00000008);
bitField0_ = bitField0_ & ~0x00000008;
dayOfWeek_ = org.jboss.netty.example.localtime.LocalTimeProtocol.DayOfWeek.SUNDAY;
onChanged();
return this;
@ -1899,7 +1917,7 @@ public final class LocalTimeProtocol {
// required uint32 hour = 6;
private int hour_ ;
public boolean hasHour() {
return ((bitField0_ & 0x00000010) == 0x00000010);
return (bitField0_ & 0x00000010) == 0x00000010;
}
public int getHour() {
return hour_;
@ -1911,7 +1929,7 @@ public final class LocalTimeProtocol {
return this;
}
public Builder clearHour() {
bitField0_ = (bitField0_ & ~0x00000010);
bitField0_ = bitField0_ & ~0x00000010;
hour_ = 0;
onChanged();
return this;
@ -1920,7 +1938,7 @@ public final class LocalTimeProtocol {
// required uint32 minute = 7;
private int minute_ ;
public boolean hasMinute() {
return ((bitField0_ & 0x00000020) == 0x00000020);
return (bitField0_ & 0x00000020) == 0x00000020;
}
public int getMinute() {
return minute_;
@ -1932,7 +1950,7 @@ public final class LocalTimeProtocol {
return this;
}
public Builder clearMinute() {
bitField0_ = (bitField0_ & ~0x00000020);
bitField0_ = bitField0_ & ~0x00000020;
minute_ = 0;
onChanged();
return this;
@ -1941,7 +1959,7 @@ public final class LocalTimeProtocol {
// required uint32 second = 8;
private int second_ ;
public boolean hasSecond() {
return ((bitField0_ & 0x00000040) == 0x00000040);
return (bitField0_ & 0x00000040) == 0x00000040;
}
public int getSecond() {
return second_;
@ -1953,7 +1971,7 @@ public final class LocalTimeProtocol {
return this;
}
public Builder clearSecond() {
bitField0_ = (bitField0_ & ~0x00000040);
bitField0_ = bitField0_ & ~0x00000040;
second_ = 0;
onChanged();
return this;
@ -2038,7 +2056,9 @@ public final class LocalTimeProtocol {
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized != -1) return isInitialized == 1;
if (isInitialized != -1) {
return isInitialized == 1;
}
for (int i = 0; i < getLocalTimeCount(); i++) {
if (!getLocalTime(i).isInitialized()) {
@ -2062,7 +2082,9 @@ public final class LocalTimeProtocol {
private int memoizedSerializedSize = -1;
public int getSerializedSize() {
int size = memoizedSerializedSize;
if (size != -1) return size;
if (size != -1) {
return size;
}
size = 0;
for (int i = 0; i < localTime_.size(); i++) {
@ -2196,7 +2218,7 @@ public final class LocalTimeProtocol {
super.clear();
if (localTimeBuilder_ == null) {
localTime_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
bitField0_ = bitField0_ & ~0x00000001;
} else {
localTimeBuilder_.clear();
}
@ -2238,9 +2260,9 @@ public final class LocalTimeProtocol {
org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes result = new org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes(this);
int from_bitField0_ = bitField0_;
if (localTimeBuilder_ == null) {
if (((bitField0_ & 0x00000001) == 0x00000001)) {
if ((bitField0_ & 0x00000001) == 0x00000001) {
localTime_ = java.util.Collections.unmodifiableList(localTime_);
bitField0_ = (bitField0_ & ~0x00000001);
bitField0_ = bitField0_ & ~0x00000001;
}
result.localTime_ = localTime_;
} else {
@ -2260,12 +2282,14 @@ public final class LocalTimeProtocol {
}
public Builder mergeFrom(org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes other) {
if (other == org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes.getDefaultInstance()) return this;
if (other == org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimes.getDefaultInstance()) {
return this;
}
if (localTimeBuilder_ == null) {
if (!other.localTime_.isEmpty()) {
if (localTime_.isEmpty()) {
localTime_ = other.localTime_;
bitField0_ = (bitField0_ & ~0x00000001);
bitField0_ = bitField0_ & ~0x00000001;
} else {
ensureLocalTimeIsMutable();
localTime_.addAll(other.localTime_);
@ -2278,7 +2302,7 @@ public final class LocalTimeProtocol {
localTimeBuilder_.dispose();
localTimeBuilder_ = null;
localTime_ = other.localTime_;
bitField0_ = (bitField0_ & ~0x00000001);
bitField0_ = bitField0_ & ~0x00000001;
localTimeBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getLocalTimeFieldBuilder() : null;
@ -2287,7 +2311,7 @@ public final class LocalTimeProtocol {
}
}
}
this.mergeUnknownFields(other.getUnknownFields());
mergeUnknownFields(other.getUnknownFields());
return this;
}
@ -2307,18 +2331,18 @@ public final class LocalTimeProtocol {
throws java.io.IOException {
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder(
this.getUnknownFields());
getUnknownFields());
while (true) {
int tag = input.readTag();
switch (tag) {
case 0:
this.setUnknownFields(unknownFields.build());
setUnknownFields(unknownFields.build());
onChanged();
return this;
default: {
if (!parseUnknownField(input, unknownFields,
extensionRegistry, tag)) {
this.setUnknownFields(unknownFields.build());
setUnknownFields(unknownFields.build());
onChanged();
return this;
}
@ -2458,7 +2482,7 @@ public final class LocalTimeProtocol {
public Builder clearLocalTime() {
if (localTimeBuilder_ == null) {
localTime_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
bitField0_ = bitField0_ & ~0x00000001;
onChanged();
} else {
localTimeBuilder_.clear();
@ -2514,7 +2538,7 @@ public final class LocalTimeProtocol {
localTimeBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime, org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTime.Builder, org.jboss.netty.example.localtime.LocalTimeProtocol.LocalTimeOrBuilder>(
localTime_,
((bitField0_ & 0x00000001) == 0x00000001),
(bitField0_ & 0x00000001) == 0x00000001,
getParentForChildren(),
isClean());
localTime_ = null;

View File

@ -18,9 +18,9 @@ package org.jboss.netty.handler.codec.base64;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandler.Sharable;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelHandler.Sharable;
import org.jboss.netty.handler.codec.frame.DelimiterBasedFrameDecoder;
import org.jboss.netty.handler.codec.frame.Delimiters;
import org.jboss.netty.handler.codec.frame.FrameDecoder;

View File

@ -17,9 +17,9 @@ package org.jboss.netty.handler.codec.base64;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandler.Sharable;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelHandler.Sharable;
import org.jboss.netty.handler.codec.frame.DelimiterBasedFrameDecoder;
import org.jboss.netty.handler.codec.frame.Delimiters;
import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;

View File

@ -402,14 +402,14 @@ public class LengthFieldBasedFrameDecoder extends FrameDecoder {
long tooLongFrameLength = this.tooLongFrameLength;
this.tooLongFrameLength = 0;
discardingTooLongFrame = false;
if ((!failFast) ||
(failFast && firstDetectionOfTooLongFrame)) {
if (!failFast ||
failFast && firstDetectionOfTooLongFrame) {
fail(ctx, tooLongFrameLength);
}
} else {
// Keep discarding and notify handlers if necessary.
if (failFast && firstDetectionOfTooLongFrame) {
fail(ctx, this.tooLongFrameLength);
fail(ctx, tooLongFrameLength);
}
}

View File

@ -22,8 +22,8 @@ import java.nio.ByteOrder;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBufferFactory;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelHandler.Sharable;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;
/**

View File

@ -37,9 +37,9 @@ public class DefaultHttpDataFactory implements HttpDataFactory {
*/
public static long MINSIZE = 0x4000;
private boolean useDisk;
private final boolean useDisk;
private boolean checkSize;
private final boolean checkSize;
private long minSize;
@ -55,7 +55,7 @@ public class DefaultHttpDataFactory implements HttpDataFactory {
public DefaultHttpDataFactory() {
useDisk = false;
checkSize = true;
this.minSize = MINSIZE;
minSize = MINSIZE;
}
/**

View File

@ -147,9 +147,9 @@ final class HttpPostBodyUtil {
throw new SeekAheadNoBackArrayException();
}
this.buffer = buffer;
this.bytes = buffer.array();
this.pos = this.readerIndex = buffer.readerIndex();
this.limit = buffer.writerIndex();
bytes = buffer.array();
pos = readerIndex = buffer.readerIndex();
limit = buffer.writerIndex();
}
/**
@ -164,11 +164,11 @@ final class HttpPostBodyUtil {
}
void clear() {
this.buffer = null;
this.bytes = null;
this.limit = 0;
this.pos = 0;
this.readerIndex = 0;
buffer = null;
bytes = null;
limit = 0;
pos = 0;
readerIndex = 0;
}
}

View File

@ -119,7 +119,7 @@ public class CloseWebSocketFrame extends WebSocketFrame {
* a status code is set, -1 is returned.
*/
public int getStatusCode() {
ChannelBuffer binaryData = this.getBinaryData();
ChannelBuffer binaryData = getBinaryData();
if (binaryData == null || binaryData.capacity() == 0) {
return -1;
}
@ -136,7 +136,7 @@ public class CloseWebSocketFrame extends WebSocketFrame {
* text is not supplied, an empty string is returned.
*/
public String getReasonText() {
ChannelBuffer binaryData = this.getBinaryData();
ChannelBuffer binaryData = getBinaryData();
if (binaryData == null || binaryData.capacity() <= 2) {
return "";
}

View File

@ -17,8 +17,8 @@ package org.jboss.netty.handler.codec.http.websocketx;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelHandler.Sharable;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;
/**

View File

@ -78,7 +78,7 @@ public abstract class WebSocketClientHandshaker {
Map<String, String> customHeaders, long maxFramePayloadLength) {
this.webSocketUrl = webSocketUrl;
this.version = version;
this.expectedSubprotocol = subprotocol;
expectedSubprotocol = subprotocol;
this.customHeaders = customHeaders;
this.maxFramePayloadLength = maxFramePayloadLength;
}

View File

@ -156,7 +156,7 @@ public class WebSocketClientHandshaker08 extends WebSocketClientHandshaker {
// See https://github.com/netty/netty/issues/264
request.addHeader(Names.SEC_WEBSOCKET_ORIGIN, originValue);
String expectedSubprotocol = this.getExpectedSubprotocol();
String expectedSubprotocol = getExpectedSubprotocol();
if (expectedSubprotocol != null && !expectedSubprotocol.equals("")) {
request.addHeader(Names.SEC_WEBSOCKET_PROTOCOL, expectedSubprotocol);
}
@ -232,7 +232,7 @@ public class WebSocketClientHandshaker08 extends WebSocketClientHandshaker {
setHandshakeComplete();
channel.getPipeline().get(HttpResponseDecoder.class).replace("ws-decoder",
new WebSocket08FrameDecoder(false, allowExtensions, this.getMaxFramePayloadLength()));
new WebSocket08FrameDecoder(false, allowExtensions, getMaxFramePayloadLength()));
}

View File

@ -152,7 +152,7 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
}
request.addHeader(Names.ORIGIN, originValue);
String expectedSubprotocol = this.getExpectedSubprotocol();
String expectedSubprotocol = getExpectedSubprotocol();
if (expectedSubprotocol != null && !expectedSubprotocol.equals("")) {
request.addHeader(Names.SEC_WEBSOCKET_PROTOCOL, expectedSubprotocol);
}
@ -227,7 +227,7 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
setHandshakeComplete();
channel.getPipeline().get(HttpResponseDecoder.class).replace("ws-decoder",
new WebSocket13FrameDecoder(false, allowExtensions, this.getMaxFramePayloadLength()));
new WebSocket13FrameDecoder(false, allowExtensions, getMaxFramePayloadLength()));
}

View File

@ -112,7 +112,7 @@ public abstract class WebSocketServerHandshaker {
*/
public Set<String> getSubprotocols() {
Set<String> ret = new LinkedHashSet<String>();
for (String p : this.subprotocols) {
for (String p : subprotocols) {
ret.add(p);
}
return ret;

View File

@ -158,7 +158,7 @@ public class WebSocketServerHandshaker00 extends WebSocketServerHandshaker {
throw new WebSocketHandshakeException("Requested subprotocol(s) not supported: " + subprotocols);
} else {
res.addHeader(Names.SEC_WEBSOCKET_PROTOCOL, selectedSubprotocol);
this.setSelectedSubprotocol(selectedSubprotocol);
setSelectedSubprotocol(selectedSubprotocol);
}
}
@ -190,7 +190,7 @@ public class WebSocketServerHandshaker00 extends WebSocketServerHandshaker {
p.remove(HttpChunkAggregator.class);
}
p.replace(HttpRequestDecoder.class, "wsdecoder",
new WebSocket00FrameDecoder(this.getMaxFramePayloadLength()));
new WebSocket00FrameDecoder(getMaxFramePayloadLength()));
ChannelFuture future = channel.write(res);

View File

@ -163,7 +163,7 @@ public class WebSocketServerHandshaker08 extends WebSocketServerHandshaker {
throw new WebSocketHandshakeException("Requested subprotocol(s) not supported: " + subprotocols);
} else {
res.addHeader(Names.SEC_WEBSOCKET_PROTOCOL, selectedSubprotocol);
this.setSelectedSubprotocol(selectedSubprotocol);
setSelectedSubprotocol(selectedSubprotocol);
}
}
@ -176,7 +176,7 @@ public class WebSocketServerHandshaker08 extends WebSocketServerHandshaker {
}
p.replace(HttpRequestDecoder.class, "wsdecoder",
new WebSocket08FrameDecoder(true, allowExtensions, this.getMaxFramePayloadLength()));
new WebSocket08FrameDecoder(true, allowExtensions, getMaxFramePayloadLength()));
p.replace(HttpResponseEncoder.class, "wsencoder", new WebSocket08FrameEncoder(false));
return future;

View File

@ -15,8 +15,8 @@
*/
package org.jboss.netty.handler.codec.http.websocketx;
import static org.jboss.netty.handler.codec.http.HttpHeaders.Values.WEBSOCKET;
import static org.jboss.netty.handler.codec.http.HttpVersion.HTTP_1_1;
import static org.jboss.netty.handler.codec.http.HttpHeaders.Values.*;
import static org.jboss.netty.handler.codec.http.HttpVersion.*;
import java.io.UnsupportedEncodingException;
@ -25,14 +25,14 @@ import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelFutureListener;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.handler.codec.http.HttpChunkAggregator;
import org.jboss.netty.handler.codec.http.DefaultHttpResponse;
import org.jboss.netty.handler.codec.http.HttpChunkAggregator;
import org.jboss.netty.handler.codec.http.HttpHeaders.Names;
import org.jboss.netty.handler.codec.http.HttpRequest;
import org.jboss.netty.handler.codec.http.HttpRequestDecoder;
import org.jboss.netty.handler.codec.http.HttpResponse;
import org.jboss.netty.handler.codec.http.HttpResponseEncoder;
import org.jboss.netty.handler.codec.http.HttpResponseStatus;
import org.jboss.netty.handler.codec.http.HttpHeaders.Names;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.CharsetUtil;
@ -170,7 +170,7 @@ public class WebSocketServerHandshaker13 extends WebSocketServerHandshaker {
throw new WebSocketHandshakeException("Requested subprotocol(s) not supported: " + subprotocols);
} else {
res.addHeader(Names.SEC_WEBSOCKET_PROTOCOL, selectedSubprotocol);
this.setSelectedSubprotocol(selectedSubprotocol);
setSelectedSubprotocol(selectedSubprotocol);
}
}
@ -183,7 +183,7 @@ public class WebSocketServerHandshaker13 extends WebSocketServerHandshaker {
}
p.replace(HttpRequestDecoder.class, "wsdecoder",
new WebSocket13FrameDecoder(true, allowExtensions, this.getMaxFramePayloadLength()));
new WebSocket13FrameDecoder(true, allowExtensions, getMaxFramePayloadLength()));
p.replace(HttpResponseEncoder.class, "wsencoder", new WebSocket13FrameEncoder(false));
return future;

View File

@ -17,11 +17,11 @@ package org.jboss.netty.handler.codec.http.websocketx;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.handler.codec.http.DefaultHttpResponse;
import org.jboss.netty.handler.codec.http.HttpHeaders.Names;
import org.jboss.netty.handler.codec.http.HttpRequest;
import org.jboss.netty.handler.codec.http.HttpResponse;
import org.jboss.netty.handler.codec.http.HttpResponseStatus;
import org.jboss.netty.handler.codec.http.HttpVersion;
import org.jboss.netty.handler.codec.http.HttpHeaders.Names;
/**
* Instances the appropriate handshake class to use for servers

View File

@ -17,8 +17,8 @@ package org.jboss.netty.handler.codec.marshalling;
import org.jboss.marshalling.Marshaller;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelHandler.Sharable;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;
/**

View File

@ -18,8 +18,8 @@ package org.jboss.netty.handler.codec.marshalling;
import org.jboss.marshalling.Marshaller;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelHandler.Sharable;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;
/**

View File

@ -19,10 +19,10 @@ import static org.jboss.netty.buffer.ChannelBuffers.*;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandler.Sharable;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.ChannelHandler.Sharable;
import org.jboss.netty.handler.codec.frame.LengthFieldBasedFrameDecoder;
import org.jboss.netty.handler.codec.frame.LengthFieldPrepender;
import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;

View File

@ -20,8 +20,8 @@ import static org.jboss.netty.buffer.ChannelBuffers.*;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBufferOutputStream;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelHandler.Sharable;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;
import com.google.protobuf.CodedOutputStream;

View File

@ -423,7 +423,7 @@ public abstract class ReplayingDecoder<T extends Enum<T>>
if (cumulation == null) {
// the cumulation buffer is not created yet so just pass the input
// to callDecode(...) method
this.cumulation = input;
cumulation = input;
replayable = new ReplayingDecoderBuffer(input);
int oldReaderIndex = input.readerIndex();
@ -461,7 +461,7 @@ public abstract class ReplayingDecoder<T extends Enum<T>>
}
replayable = new ReplayingDecoderBuffer(cumulation);
} else {
this.cumulation = null;
cumulation = null;
replayable = ReplayingDecoderBuffer.EMPTY_BUFFER;
}
}
@ -489,12 +489,12 @@ public abstract class ReplayingDecoder<T extends Enum<T>>
ChannelBuffer buf;
if (fit) {
// the input fit in the cumulation buffer so copy it over
buf = this.cumulation;
buf = cumulation;
buf.writeBytes(input);
} else {
// wrap the cumulation and input
buf = ChannelBuffers.wrappedBuffer(cumulation, input);
this.cumulation = buf;
cumulation = buf;
replayable = new ReplayingDecoderBuffer(cumulation);
}
@ -506,13 +506,13 @@ public abstract class ReplayingDecoder<T extends Enum<T>>
} finally {
if (!buf.readable()) {
// nothing readable left so reset the state
this.cumulation = null;
cumulation = null;
replayable = ReplayingDecoderBuffer.EMPTY_BUFFER;
} else {
// create a new buffer and copy the readable buffer into it
this.cumulation = newCumulationBuffer(ctx, buf.readableBytes());
this.cumulation.writeBytes(buf);
replayable = new ReplayingDecoderBuffer(this.cumulation);
cumulation = newCumulationBuffer(ctx, buf.readableBytes());
cumulation.writeBytes(buf);
replayable = new ReplayingDecoderBuffer(cumulation);
}
}

View File

@ -17,8 +17,8 @@ package org.jboss.netty.handler.codec.rtsp;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelHandler.Sharable;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.http.HttpMessage;
import org.jboss.netty.handler.codec.http.HttpMessageEncoder;

View File

@ -98,7 +98,7 @@ public class ObjectDecoderInputStream extends InputStream implements
} else {
this.in = new DataInputStream(in);
}
this.classResolver = ClassResolvers.weakCachingResolver(classLoader);
classResolver = ClassResolvers.weakCachingResolver(classLoader);
this.maxObjectSize = maxObjectSize;
}

View File

@ -23,8 +23,8 @@ import java.io.ObjectOutputStream;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBufferOutputStream;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelHandler.Sharable;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;
/**

View File

@ -40,7 +40,7 @@ public class DefaultSpdyHeaderBlock implements SpdyHeaderBlock {
}
public void setInvalid() {
this.invalid = true;
invalid = true;
}
public void addHeader(final String name, final Object value) {

View File

@ -410,7 +410,7 @@ public class SpdyFrameDecoder extends FrameDecoder {
return new DefaultSpdyPingFrame(ID);
case SPDY_GOAWAY_FRAME:
int minLength = (version < 3) ? 4 : 8;
int minLength = version < 3 ? 4 : 8;
if (buffer.readableBytes() < minLength) {
return null;
}
@ -448,7 +448,7 @@ public class SpdyFrameDecoder extends FrameDecoder {
int streamID;
switch (type) {
case SPDY_SYN_STREAM_FRAME:
minLength = (version < 3) ? 12 : 10;
minLength = version < 3 ? 12 : 10;
if (buffer.readableBytes() < minLength) {
return null;
}
@ -477,7 +477,7 @@ public class SpdyFrameDecoder extends FrameDecoder {
return spdySynStreamFrame;
case SPDY_SYN_REPLY_FRAME:
minLength = (version < 3) ? 8 : 4;
minLength = version < 3 ? 8 : 4;
if (buffer.readableBytes() < minLength) {
return null;
}
@ -575,7 +575,7 @@ public class SpdyFrameDecoder extends FrameDecoder {
return;
}
int lengthFieldSize = (version < 3) ? 2 : 4;
int lengthFieldSize = version < 3 ? 2 : 4;
if (numHeaders == -1) {
// Read number of Name/Value pairs
@ -690,10 +690,10 @@ public class SpdyFrameDecoder extends FrameDecoder {
private boolean isValidControlFrameHeader() {
switch (type) {
case SPDY_SYN_STREAM_FRAME:
return (version < 3) ? length >= 12 : length >= 10;
return version < 3 ? length >= 12 : length >= 10;
case SPDY_SYN_REPLY_FRAME:
return (version < 3) ? length >= 8 : length >= 4;
return version < 3 ? length >= 8 : length >= 4;
case SPDY_RST_STREAM_FRAME:
return flags == 0 && length == 8;
@ -708,7 +708,7 @@ public class SpdyFrameDecoder extends FrameDecoder {
return length == 4;
case SPDY_GOAWAY_FRAME:
return (version < 3) ? length == 4 : length == 8;
return version < 3 ? length == 4 : length == 8;
case SPDY_HEADERS_FRAME:
if (version < 3) {

View File

@ -128,7 +128,7 @@ public class SpdyFrameEncoder extends OneToOneEncoder {
int headerBlockLength = data.readableBytes();
int length;
if (version < 3) {
length = (headerBlockLength == 0) ? 12 : 10 + headerBlockLength;
length = headerBlockLength == 0 ? 12 : 10 + headerBlockLength;
} else {
length = 10 + headerBlockLength;
}
@ -164,7 +164,7 @@ public class SpdyFrameEncoder extends OneToOneEncoder {
int headerBlockLength = data.readableBytes();
int length;
if (version < 3) {
length = (headerBlockLength == 0) ? 8 : 6 + headerBlockLength;
length = headerBlockLength == 0 ? 8 : 6 + headerBlockLength;
} else {
length = 4 + headerBlockLength;
}
@ -259,7 +259,7 @@ public class SpdyFrameEncoder extends OneToOneEncoder {
} else if (msg instanceof SpdyGoAwayFrame) {
SpdyGoAwayFrame spdyGoAwayFrame = (SpdyGoAwayFrame) msg;
int length = (version < 3) ? 4 : 8;
int length = version < 3 ? 4 : 8;
ChannelBuffer frame = ChannelBuffers.buffer(
ByteOrder.BIG_ENDIAN, SPDY_HEADER_SIZE + length);
frame.writeShort(version | 0x8000);
@ -280,7 +280,7 @@ public class SpdyFrameEncoder extends OneToOneEncoder {
int headerBlockLength = data.readableBytes();
int length;
if (version < 3) {
length = (headerBlockLength == 0) ? 4 : 6 + headerBlockLength;
length = headerBlockLength == 0 ? 4 : 6 + headerBlockLength;
} else {
length = 4 + headerBlockLength;
}

View File

@ -15,12 +15,12 @@
*/
package org.jboss.netty.handler.codec.spdy;
import static org.jboss.netty.handler.codec.spdy.SpdyCodecUtil.*;
import java.util.zip.Deflater;
import org.jboss.netty.buffer.ChannelBuffer;
import static org.jboss.netty.handler.codec.spdy.SpdyCodecUtil.*;
class SpdyHeaderBlockZlibCompressor extends SpdyHeaderBlockCompressor {
private final byte[] out = new byte[8192];

View File

@ -15,13 +15,13 @@
*/
package org.jboss.netty.handler.codec.spdy;
import static org.jboss.netty.handler.codec.spdy.SpdyCodecUtil.*;
import java.util.zip.DataFormatException;
import java.util.zip.Inflater;
import org.jboss.netty.buffer.ChannelBuffer;
import static org.jboss.netty.handler.codec.spdy.SpdyCodecUtil.*;
class SpdyHeaderBlockZlibDecompressor extends SpdyHeaderBlockDecompressor {
private final int version;

View File

@ -128,12 +128,12 @@ final class SpdySession {
public int getSendWindowSize(int streamID) {
StreamState state = activeStreams.get(new Integer(streamID));
return (state != null) ? state.getSendWindowSize() : -1;
return state != null ? state.getSendWindowSize() : -1;
}
public int updateSendWindowSize(int streamID, int deltaWindowSize) {
StreamState state = activeStreams.get(new Integer(streamID));
return (state != null) ? state.updateSendWindowSize(deltaWindowSize) : -1;
return state != null ? state.updateSendWindowSize(deltaWindowSize) : -1;
}
public int updateReceiveWindowSize(int streamID, int deltaWindowSize) {
@ -141,12 +141,12 @@ final class SpdySession {
if (deltaWindowSize > 0) {
state.setReceiveWindowSizeLowerBound(0);
}
return (state != null) ? state.updateReceiveWindowSize(deltaWindowSize) : -1;
return state != null ? state.updateReceiveWindowSize(deltaWindowSize) : -1;
}
public int getReceiveWindowSizeLowerBound(int streamID) {
StreamState state = activeStreams.get(new Integer(streamID));
return (state != null) ? state.getReceiveWindowSizeLowerBound() : 0;
return state != null ? state.getReceiveWindowSizeLowerBound() : 0;
}
public void updateAllReceiveWindowSizes(int deltaWindowSize) {
@ -165,12 +165,12 @@ final class SpdySession {
public MessageEvent getPendingWrite(int streamID) {
StreamState state = activeStreams.get(new Integer(streamID));
return (state != null) ? state.getPendingWrite() : null;
return state != null ? state.getPendingWrite() : null;
}
public MessageEvent removePendingWrite(int streamID) {
StreamState state = activeStreams.get(new Integer(streamID));
return (state != null) ? state.removePendingWrite() : null;
return state != null ? state.removePendingWrite() : null;
}
private static final class StreamState {
@ -179,10 +179,10 @@ final class SpdySession {
private volatile boolean remoteSideClosed;
private volatile boolean localSideClosed;
private boolean receivedReply;
private AtomicInteger sendWindowSize;
private AtomicInteger receiveWindowSize;
private final AtomicInteger sendWindowSize;
private final AtomicInteger receiveWindowSize;
private volatile int receiveWindowSizeLowerBound;
private ConcurrentLinkedQueue<MessageEvent> pendingWriteQueue =
private final ConcurrentLinkedQueue<MessageEvent> pendingWriteQueue =
new ConcurrentLinkedQueue<MessageEvent>();
public StreamState(

View File

@ -93,7 +93,7 @@ public class SpdySessionHandler extends SimpleChannelUpstreamHandler
"unsupported version: " + version);
}
this.server = server;
this.flowControl = version >= 3;
flowControl = version >= 3;
}
@Override

View File

@ -19,10 +19,10 @@ import java.nio.charset.Charset;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandler.Sharable;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.ChannelHandler.Sharable;
import org.jboss.netty.handler.codec.frame.DelimiterBasedFrameDecoder;
import org.jboss.netty.handler.codec.frame.Delimiters;
import org.jboss.netty.handler.codec.frame.FrameDecoder;

View File

@ -21,10 +21,10 @@ import java.nio.charset.Charset;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandler.Sharable;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.ChannelHandler.Sharable;
import org.jboss.netty.handler.codec.frame.DelimiterBasedFrameDecoder;
import org.jboss.netty.handler.codec.frame.Delimiters;
import org.jboss.netty.handler.codec.oneone.OneToOneEncoder;

View File

@ -15,18 +15,18 @@
*/
package org.jboss.netty.handler.execution;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelEvent;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelFutureListener;
import org.jboss.netty.util.ObjectSizeEstimator;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.RejectedExecutionException;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelEvent;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelFutureListener;
import org.jboss.netty.util.ObjectSizeEstimator;
/**
* {@link Executor} which should be used for downstream {@link ChannelEvent}'s. This implementation will take care of preserve the order of the events in a {@link Channel}.
* If you don't need to preserve the order just use one of the {@link Executor} implementations provided by the static methods of {@link Executors}.

View File

@ -141,7 +141,7 @@ public abstract class CIDR implements Comparable<CIDR> {
if (!(arg0 instanceof CIDR)) {
return false;
}
return this.compareTo((CIDR) arg0) == 0;
return compareTo((CIDR) arg0) == 0;
}
@Override

View File

@ -157,7 +157,7 @@ public abstract class IpFilteringHandlerImpl implements ChannelUpstreamHandler,
public void removeIpFilterListener() {
this.listener = null;
listener = null;
}

View File

@ -15,11 +15,12 @@
*/
package org.jboss.netty.handler.ipfilter;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import java.net.InetAddress;
import java.net.UnknownHostException;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
/**
* This class allows to check if an IP V4 or V6 Address is contained in a subnet.<BR>
* <p/>
@ -59,7 +60,7 @@ public class IpSubnet implements IpSet, Comparable<IpSubnet> {
InternalLoggerFactory.getInstance(IpSubnet.class);
/** Internal representation */
private CIDR cidr;
private final CIDR cidr;
/** Create IpSubnet for ALL (used for ALLOW or DENY ALL) */
public IpSubnet() {

View File

@ -295,7 +295,7 @@ public class ChunkedWriteHandler implements ChannelUpstreamHandler, ChannelDowns
}
if (acquired && (!channel.isConnected() || (channel.isWritable() && !queue.isEmpty()))) {
if (acquired && (!channel.isConnected() || channel.isWritable() && !queue.isEmpty())) {
flush(ctx, fireNow);
}
}

View File

@ -245,7 +245,7 @@ public class TrafficCounter {
* @param newcheckInterval
*/
public void configure(long newcheckInterval) {
long newInterval = (newcheckInterval / 10) * 10;
long newInterval = newcheckInterval / 10 * 10;
if (checkInterval.get() != newInterval) {
checkInterval.set(newInterval);
if (newInterval <= 0) {

View File

@ -454,7 +454,7 @@ public class HashedWheelTimer implements Timer {
//
// See https://github.com/netty/netty/issues/356
if (DetectionUtil.isWindows()) {
sleepTime = (sleepTime / 10) * 10;
sleepTime = sleepTime / 10 * 10;
}
if (sleepTime <= 0) {

View File

@ -22,8 +22,8 @@ import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.Map.Entry;
import java.util.NoSuchElementException;
import org.jboss.netty.channel.ChannelFactory;
import org.jboss.netty.channel.ChannelHandler;

View File

@ -15,21 +15,17 @@
*/
package org.jboss.netty.channel.local;
import org.junit.Assert;
import org.junit.Test;
import org.jboss.netty.bootstrap.ClientBootstrap;
import org.jboss.netty.bootstrap.ServerBootstrap;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.channel.ChannelEvent;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelPipeline;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
import org.jboss.netty.channel.local.DefaultLocalClientChannelFactory;
import org.jboss.netty.channel.local.DefaultLocalServerChannelFactory;
import org.jboss.netty.channel.local.LocalAddress;
import org.junit.Assert;
import org.junit.Test;
public class LocalAddressTest {
private static String LOCAL_ADDR_ID = "test.id";

View File

@ -15,8 +15,7 @@
*/
package org.jboss.netty.channel.local;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*;
import java.util.concurrent.CountDownLatch;

View File

@ -15,16 +15,7 @@
*/
package org.jboss.netty.channel.socket;
import static org.junit.Assert.assertTrue;
import org.jboss.netty.bootstrap.ConnectionlessBootstrap;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
import org.jboss.netty.channel.socket.DatagramChannelFactory;
import org.jboss.netty.util.internal.ExecutorUtil;
import static org.junit.Assert.*;
import java.net.InetSocketAddress;
import java.util.concurrent.CountDownLatch;
@ -33,6 +24,14 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import org.jboss.netty.bootstrap.ConnectionlessBootstrap;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
import org.jboss.netty.util.internal.ExecutorUtil;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;

View File

@ -15,8 +15,6 @@
*/
package org.jboss.netty.channel.socket.nio;
import org.jboss.netty.util.internal.DetectionUtil;
import java.io.IOException;
import java.net.Inet4Address;
import java.net.InetAddress;
@ -27,6 +25,7 @@ import java.util.Enumeration;
import junit.framework.Assert;
import org.jboss.netty.util.internal.DetectionUtil;
import org.junit.Test;
public class DefaultNioDatagramChannelConfigTest {

View File

@ -15,9 +15,7 @@
*/
package org.jboss.netty.handler.codec.http;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.*;
import java.text.DateFormat;
import java.util.Date;

View File

@ -15,8 +15,7 @@
*/
package org.jboss.netty.handler.codec.http;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.Assert.*;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;

View File

@ -15,9 +15,7 @@
*/
package org.jboss.netty.handler.codec.marshalling;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.junit.Assert.*;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

View File

@ -15,9 +15,8 @@
*/
package org.jboss.netty.handler.codec.spdy;
import static org.junit.Assert.*;
import static org.jboss.netty.handler.codec.spdy.SpdyCodecUtil.*;
import static org.junit.Assert.*;
import java.io.IOException;
import java.net.InetSocketAddress;
@ -32,11 +31,11 @@ import org.jboss.netty.bootstrap.ServerBootstrap;
import org.jboss.netty.buffer.ChannelBuffer;
import org.jboss.netty.buffer.ChannelBuffers;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.channel.ChannelFactory;
import org.jboss.netty.channel.ChannelFuture;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.channel.Channels;
import org.jboss.netty.channel.ExceptionEvent;
import org.jboss.netty.channel.MessageEvent;
import org.jboss.netty.channel.SimpleChannelUpstreamHandler;
@ -54,7 +53,7 @@ public abstract class AbstractSocketSpdyEchoTest {
private static ExecutorService executor;
private static ChannelBuffer createFrames(int version) {
int length = (version < 3) ? 1176 : 1174;
int length = version < 3 ? 1176 : 1174;
ChannelBuffer frames = ChannelBuffers.buffer(length);
// SPDY UNKNOWN Frame