*
* Just like an ordinary primitive byte array, {@link ChannelBuffer} uses
- * zero-based indexing.
- * It means the index of the first byte is always {@code 0} and the index of
- * the last byte is always {@link #capacity() capacity - 1}. For example, to
- * iterate all bytes of a buffer, you can do the following, regardless of
- * its internal implementation:
+ * zero-based indexing.
+ * It means the index of the first byte is always {@code 0} and the index of the last byte is
+ * always {@link #capacity() capacity - 1}. For example, to iterate all bytes of a buffer, you
+ * can do the following, regardless of its internal implementation:
*
*
* {@link ChannelBuffer} buffer = ...;
diff --git a/buffer/src/main/java/io/netty/buffer/ChannelBuffers.java b/buffer/src/main/java/io/netty/buffer/ChannelBuffers.java
index 80c5a56b78..c66efd388d 100644
--- a/buffer/src/main/java/io/netty/buffer/ChannelBuffers.java
+++ b/buffer/src/main/java/io/netty/buffer/ChannelBuffers.java
@@ -226,7 +226,8 @@ public final class ChannelBuffers {
* More accurate estimation yields less unexpected reallocation overhead.
* The new buffer's {@code readerIndex} and {@code writerIndex} are {@code 0}.
*/
- public static ChannelBuffer dynamicBuffer(ByteOrder endianness, int estimatedLength, ChannelBufferFactory factory) {
+ public static ChannelBuffer dynamicBuffer(
+ ByteOrder endianness, int estimatedLength, ChannelBufferFactory factory) {
return new DynamicChannelBuffer(endianness, estimatedLength, factory);
}
@@ -1249,7 +1250,8 @@ public final class ChannelBuffers {
return -1;
}
- private static int firstIndexOf(ChannelBuffer buffer, int fromIndex, int toIndex, ChannelBufferIndexFinder indexFinder) {
+ private static int firstIndexOf(
+ ChannelBuffer buffer, int fromIndex, int toIndex, ChannelBufferIndexFinder indexFinder) {
fromIndex = Math.max(fromIndex, 0);
if (fromIndex >= toIndex || buffer.capacity() == 0) {
return -1;
@@ -1264,7 +1266,8 @@ public final class ChannelBuffers {
return -1;
}
- private static int lastIndexOf(ChannelBuffer buffer, int fromIndex, int toIndex, ChannelBufferIndexFinder indexFinder) {
+ private static int lastIndexOf(
+ ChannelBuffer buffer, int fromIndex, int toIndex, ChannelBufferIndexFinder indexFinder) {
fromIndex = Math.min(fromIndex, buffer.capacity());
if (fromIndex < 0 || buffer.capacity() == 0) {
return -1;
diff --git a/buffer/src/main/java/io/netty/buffer/DirectChannelBufferFactory.java b/buffer/src/main/java/io/netty/buffer/DirectChannelBufferFactory.java
index 20b733dc62..0eb4aabf29 100644
--- a/buffer/src/main/java/io/netty/buffer/DirectChannelBufferFactory.java
+++ b/buffer/src/main/java/io/netty/buffer/DirectChannelBufferFactory.java
@@ -56,11 +56,11 @@ public class DirectChannelBufferFactory extends AbstractChannelBufferFactory {
private final Object bigEndianLock = new Object();
private final Object littleEndianLock = new Object();
- private final int preallocatedBufferCapacity;
- private ChannelBuffer preallocatedBigEndianBuffer;
- private int preallocatedBigEndianBufferPosition;
- private ChannelBuffer preallocatedLittleEndianBuffer;
- private int preallocatedLittleEndianBufferPosition;
+ private final int preallocatedBufCapacity;
+ private ChannelBuffer preallocatedBEBuf;
+ private int preallocatedBEBufPos;
+ private ChannelBuffer preallocatedLEBuf;
+ private int preallocatedLEBufPos;
/**
* Creates a new factory whose default {@link ByteOrder} is
@@ -96,10 +96,10 @@ public class DirectChannelBufferFactory extends AbstractChannelBufferFactory {
super(defaultOrder);
if (preallocatedBufferCapacity <= 0) {
throw new IllegalArgumentException(
- "preallocatedBufferCapacity must be greater than 0: " + preallocatedBufferCapacity);
+ "preallocatedBufCapacity must be greater than 0: " + preallocatedBufferCapacity);
}
- this.preallocatedBufferCapacity = preallocatedBufferCapacity;
+ preallocatedBufCapacity = preallocatedBufferCapacity;
}
@Override
@@ -113,7 +113,7 @@ public class DirectChannelBufferFactory extends AbstractChannelBufferFactory {
if (capacity == 0) {
return ChannelBuffers.EMPTY_BUFFER;
}
- if (capacity >= preallocatedBufferCapacity) {
+ if (capacity >= preallocatedBufCapacity) {
return ChannelBuffers.directBuffer(order, capacity);
}
@@ -163,17 +163,17 @@ public class DirectChannelBufferFactory extends AbstractChannelBufferFactory {
private ChannelBuffer allocateBigEndianBuffer(int capacity) {
ChannelBuffer slice;
synchronized (bigEndianLock) {
- if (preallocatedBigEndianBuffer == null) {
- preallocatedBigEndianBuffer = ChannelBuffers.directBuffer(ByteOrder.BIG_ENDIAN, preallocatedBufferCapacity);
- slice = preallocatedBigEndianBuffer.slice(0, capacity);
- preallocatedBigEndianBufferPosition = capacity;
- } else if (preallocatedBigEndianBuffer.capacity() - preallocatedBigEndianBufferPosition >= capacity) {
- slice = preallocatedBigEndianBuffer.slice(preallocatedBigEndianBufferPosition, capacity);
- preallocatedBigEndianBufferPosition += capacity;
+ if (preallocatedBEBuf == null) {
+ preallocatedBEBuf = ChannelBuffers.directBuffer(ByteOrder.BIG_ENDIAN, preallocatedBufCapacity);
+ slice = preallocatedBEBuf.slice(0, capacity);
+ preallocatedBEBufPos = capacity;
+ } else if (preallocatedBEBuf.capacity() - preallocatedBEBufPos >= capacity) {
+ slice = preallocatedBEBuf.slice(preallocatedBEBufPos, capacity);
+ preallocatedBEBufPos += capacity;
} else {
- preallocatedBigEndianBuffer = ChannelBuffers.directBuffer(ByteOrder.BIG_ENDIAN, preallocatedBufferCapacity);
- slice = preallocatedBigEndianBuffer.slice(0, capacity);
- preallocatedBigEndianBufferPosition = capacity;
+ preallocatedBEBuf = ChannelBuffers.directBuffer(ByteOrder.BIG_ENDIAN, preallocatedBufCapacity);
+ slice = preallocatedBEBuf.slice(0, capacity);
+ preallocatedBEBufPos = capacity;
}
}
return slice;
@@ -182,17 +182,17 @@ public class DirectChannelBufferFactory extends AbstractChannelBufferFactory {
private ChannelBuffer allocateLittleEndianBuffer(int capacity) {
ChannelBuffer slice;
synchronized (littleEndianLock) {
- if (preallocatedLittleEndianBuffer == null) {
- preallocatedLittleEndianBuffer = ChannelBuffers.directBuffer(ByteOrder.LITTLE_ENDIAN, preallocatedBufferCapacity);
- slice = preallocatedLittleEndianBuffer.slice(0, capacity);
- preallocatedLittleEndianBufferPosition = capacity;
- } else if (preallocatedLittleEndianBuffer.capacity() - preallocatedLittleEndianBufferPosition >= capacity) {
- slice = preallocatedLittleEndianBuffer.slice(preallocatedLittleEndianBufferPosition, capacity);
- preallocatedLittleEndianBufferPosition += capacity;
+ if (preallocatedLEBuf == null) {
+ preallocatedLEBuf = ChannelBuffers.directBuffer(ByteOrder.LITTLE_ENDIAN, preallocatedBufCapacity);
+ slice = preallocatedLEBuf.slice(0, capacity);
+ preallocatedLEBufPos = capacity;
+ } else if (preallocatedLEBuf.capacity() - preallocatedLEBufPos >= capacity) {
+ slice = preallocatedLEBuf.slice(preallocatedLEBufPos, capacity);
+ preallocatedLEBufPos += capacity;
} else {
- preallocatedLittleEndianBuffer = ChannelBuffers.directBuffer(ByteOrder.LITTLE_ENDIAN, preallocatedBufferCapacity);
- slice = preallocatedLittleEndianBuffer.slice(0, capacity);
- preallocatedLittleEndianBufferPosition = capacity;
+ preallocatedLEBuf = ChannelBuffers.directBuffer(ByteOrder.LITTLE_ENDIAN, preallocatedBufCapacity);
+ slice = preallocatedLEBuf.slice(0, capacity);
+ preallocatedLEBufPos = capacity;
}
}
return slice;
diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java b/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java
index b81c1edfd3..86a411f524 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java
@@ -707,7 +707,8 @@ public class HttpHeaders {
/**
* Adds a new date header with the specified name and value. The specified
- * value is formatted as defined in RFC2616
+ * value is formatted as defined in
+ * RFC2616
*/
public static void addDateHeader(HttpMessage message, String name, Date value) {
message.addHeader(name, value);
diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/HttpMethod.java b/codec-http/src/main/java/io/netty/handler/codec/http/HttpMethod.java
index 5f766b4e0b..6a97242a56 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/http/HttpMethod.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/http/HttpMethod.java
@@ -26,28 +26,32 @@ import java.util.Map;
*/
public class HttpMethod implements Comparable {
/**
- * The OPTIONS method represents a request for information about the communication options available on the request/response
- * chain identified by the Request-URI. This method allows the client to determine the options and/or requirements
- * associated with a resource, or the capabilities of a server, without implying a resource action or initiating a
- * resource retrieval.
+ * The OPTIONS method represents a request for information about the communication options
+ * available on the request/response chain identified by the Request-URI. This method allows
+ * the client to determine the options and/or requirements associated with a resource, or the
+ * capabilities of a server, without implying a resource action or initiating a resource
+ * retrieval.
*/
public static final HttpMethod OPTIONS = new HttpMethod("OPTIONS");
/**
- * The GET method means retrieve whatever information (in the form of an entity) is identified by the Request-URI.
- * If the Request-URI refers to a data-producing process, it is the produced data which shall be returned as the entity
- * in the response and not the source text of the process, unless that text happens to be the output of the process.
+ * The GET method means retrieve whatever information (in the form of an entity) is identified
+ * by the Request-URI. If the Request-URI refers to a data-producing process, it is the
+ * produced data which shall be returned as the entity in the response and not the source text
+ * of the process, unless that text happens to be the output of the process.
*/
public static final HttpMethod GET = new HttpMethod("GET");
/**
- * The HEAD method is identical to GET except that the server MUST NOT return a message-body in the response.
+ * The HEAD method is identical to GET except that the server MUST NOT return a message-body
+ * in the response.
*/
public static final HttpMethod HEAD = new HttpMethod("HEAD");
/**
- * The POST method is used to request that the origin server accept the entity enclosed in the request as a new
- * subordinate of the resource identified by the Request-URI in the Request-Line.
+ * The POST method is used to request that the origin server accept the entity enclosed in the
+ * request as a new subordinate of the resource identified by the Request-URI in the
+ * Request-Line.
*/
public static final HttpMethod POST = new HttpMethod("POST");
@@ -63,17 +67,20 @@ public class HttpMethod implements Comparable {
public static final HttpMethod PATCH = new HttpMethod("PATCH");
/**
- * The DELETE method requests that the origin server delete the resource identified by the Request-URI.
+ * The DELETE method requests that the origin server delete the resource identified by the
+ * Request-URI.
*/
public static final HttpMethod DELETE = new HttpMethod("DELETE");
/**
- * The TRACE method is used to invoke a remote, application-layer loop- back of the request message.
+ * The TRACE method is used to invoke a remote, application-layer loop- back of the request
+ * message.
*/
public static final HttpMethod TRACE = new HttpMethod("TRACE");
/**
- * This specification reserves the method name CONNECT for use with a proxy that can dynamically switch to being a tunnel
+ * This specification reserves the method name CONNECT for use with a proxy that can dynamically
+ * switch to being a tunnel
*/
public static final HttpMethod CONNECT = new HttpMethod("CONNECT");
diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/HttpResponseDecoder.java b/codec-http/src/main/java/io/netty/handler/codec/http/HttpResponseDecoder.java
index 200dc35f19..cf1826724b 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/http/HttpResponseDecoder.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/http/HttpResponseDecoder.java
@@ -101,7 +101,9 @@ public class HttpResponseDecoder extends HttpMessageDecoder {
@Override
protected HttpMessage createMessage(String[] initialLine) {
- return new DefaultHttpResponse(HttpVersion.valueOf(initialLine[0]), new HttpResponseStatus(Integer.valueOf(initialLine[1]), initialLine[2]));
+ return new DefaultHttpResponse(
+ HttpVersion.valueOf(initialLine[0]),
+ new HttpResponseStatus(Integer.valueOf(initialLine[1]), initialLine[2]));
}
@Override
diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/HttpResponseStatus.java b/codec-http/src/main/java/io/netty/handler/codec/http/HttpResponseStatus.java
index 16e5d5f841..c74c5150a3 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/http/HttpResponseStatus.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/http/HttpResponseStatus.java
@@ -56,7 +56,8 @@ public class HttpResponseStatus implements Comparable {
/**
* 203 Non-Authoritative Information (since HTTP/1.1)
*/
- public static final HttpResponseStatus NON_AUTHORITATIVE_INFORMATION = new HttpResponseStatus(203, "Non-Authoritative Information");
+ public static final HttpResponseStatus NON_AUTHORITATIVE_INFORMATION =
+ new HttpResponseStatus(203, "Non-Authoritative Information");
/**
* 204 No Content
@@ -151,7 +152,8 @@ public class HttpResponseStatus implements Comparable {
/**
* 407 Proxy Authentication Required
*/
- public static final HttpResponseStatus PROXY_AUTHENTICATION_REQUIRED = new HttpResponseStatus(407, "Proxy Authentication Required");
+ public static final HttpResponseStatus PROXY_AUTHENTICATION_REQUIRED =
+ new HttpResponseStatus(407, "Proxy Authentication Required");
/**
* 408 Request Timeout
@@ -181,7 +183,8 @@ public class HttpResponseStatus implements Comparable {
/**
* 413 Request Entity Too Large
*/
- public static final HttpResponseStatus REQUEST_ENTITY_TOO_LARGE = new HttpResponseStatus(413, "Request Entity Too Large");
+ public static final HttpResponseStatus REQUEST_ENTITY_TOO_LARGE =
+ new HttpResponseStatus(413, "Request Entity Too Large");
/**
* 414 Request-URI Too Long
@@ -191,12 +194,14 @@ public class HttpResponseStatus implements Comparable {
/**
* 415 Unsupported Media Type
*/
- public static final HttpResponseStatus UNSUPPORTED_MEDIA_TYPE = new HttpResponseStatus(415, "Unsupported Media Type");
+ public static final HttpResponseStatus UNSUPPORTED_MEDIA_TYPE =
+ new HttpResponseStatus(415, "Unsupported Media Type");
/**
* 416 Requested Range Not Satisfiable
*/
- public static final HttpResponseStatus REQUESTED_RANGE_NOT_SATISFIABLE = new HttpResponseStatus(416, "Requested Range Not Satisfiable");
+ public static final HttpResponseStatus REQUESTED_RANGE_NOT_SATISFIABLE =
+ new HttpResponseStatus(416, "Requested Range Not Satisfiable");
/**
* 417 Expectation Failed
@@ -231,7 +236,8 @@ public class HttpResponseStatus implements Comparable {
/**
* 500 Internal Server Error
*/
- public static final HttpResponseStatus INTERNAL_SERVER_ERROR = new HttpResponseStatus(500, "Internal Server Error");
+ public static final HttpResponseStatus INTERNAL_SERVER_ERROR =
+ new HttpResponseStatus(500, "Internal Server Error");
/**
* 501 Not Implemented
@@ -256,12 +262,14 @@ public class HttpResponseStatus implements Comparable {
/**
* 505 HTTP Version Not Supported
*/
- public static final HttpResponseStatus HTTP_VERSION_NOT_SUPPORTED = new HttpResponseStatus(505, "HTTP Version Not Supported");
+ public static final HttpResponseStatus HTTP_VERSION_NOT_SUPPORTED =
+ new HttpResponseStatus(505, "HTTP Version Not Supported");
/**
* 506 Variant Also Negotiates (RFC2295)
*/
- public static final HttpResponseStatus VARIANT_ALSO_NEGOTIATES = new HttpResponseStatus(506, "Variant Also Negotiates");
+ public static final HttpResponseStatus VARIANT_ALSO_NEGOTIATES =
+ new HttpResponseStatus(506, "Variant Also Negotiates");
/**
* 507 Insufficient Storage (WebDAV, RFC4918)
diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/QueryStringDecoder.java b/codec-http/src/main/java/io/netty/handler/codec/http/QueryStringDecoder.java
index 9470c9b707..e5e37307ac 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/http/QueryStringDecoder.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/http/QueryStringDecoder.java
@@ -46,10 +46,10 @@ import java.util.Map;
*
*
HashDOS vulnerability fix
*
- * As a workaround to the HashDOS
- * vulnerability, the decoder limits the maximum number of decoded key-value
- * parameter pairs, up to {@literal 1024} by default, and you can configure it
- * when you construct the decoder by passing an additional integer parameter.
+ * As a workaround to the HashDOS vulnerability, the decoder
+ * limits the maximum number of decoded key-value parameter pairs, up to {@literal 1024} by
+ * default, and you can configure it when you construct the decoder by passing an additional
+ * integer parameter.
*
* @see QueryStringEncoder
*
diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/ContinuationWebSocketFrame.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/ContinuationWebSocketFrame.java
index b653d8121d..e741e5e6c3 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/ContinuationWebSocketFrame.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/ContinuationWebSocketFrame.java
@@ -20,8 +20,8 @@ import io.netty.buffer.ChannelBuffers;
import io.netty.util.CharsetUtil;
/**
- * Web Socket continuation frame containing continuation text or binary data. This is used for fragmented messages where
- * the contents of a messages is contained more than 1 frame.
+ * Web Socket continuation frame containing continuation text or binary data. This is used for
+ * fragmented messages where the contents of a messages is contained more than 1 frame.
*/
public class ContinuationWebSocketFrame extends WebSocketFrame {
@@ -35,10 +35,10 @@ public class ContinuationWebSocketFrame extends WebSocketFrame {
}
/**
- * Creates a new continuation frame with the specified binary data. The final fragment flag is set to true.
+ * Creates a new continuation frame with the specified binary data. The final fragment flag is
+ * set to true.
*
- * @param binaryData
- * the content of the frame.
+ * @param binaryData the content of the frame.
*/
public ContinuationWebSocketFrame(ChannelBuffer binaryData) {
setBinaryData(binaryData);
@@ -70,9 +70,11 @@ public class ContinuationWebSocketFrame extends WebSocketFrame {
* @param binaryData
* the content of the frame.
* @param aggregatedText
- * Aggregated text set by decoder on the final continuation frame of a fragmented text message
+ * Aggregated text set by decoder on the final continuation frame of a fragmented
+ * text message
*/
- public ContinuationWebSocketFrame(boolean finalFragment, int rsv, ChannelBuffer binaryData, String aggregatedText) {
+ public ContinuationWebSocketFrame(
+ boolean finalFragment, int rsv, ChannelBuffer binaryData, String aggregatedText) {
setFinalFragment(finalFragment);
setRsv(rsv);
setBinaryData(binaryData);
diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/UTF8Exception.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/UTF8Exception.java
index c4fdb964e9..9580b72073 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/UTF8Exception.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/UTF8Exception.java
@@ -18,19 +18,20 @@
*
* Copyright (c) 2008-2009 Bjoern Hoehrmann
*
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
*
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions
- * of the Software.
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
*
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.netty.handler.codec.http.websocketx;
diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/UTF8Output.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/UTF8Output.java
index 4756f9afde..0cd07262f9 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/UTF8Output.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/UTF8Output.java
@@ -18,19 +18,20 @@
*
* Copyright (c) 2008-2009 Bjoern Hoehrmann
*
- * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
- * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
- * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
*
- * The above copyright notice and this permission notice shall be included in all copies or substantial portions
- * of the Software.
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
*
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
- * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
- * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
package io.netty.handler.codec.http.websocketx;
@@ -41,20 +42,23 @@ final class UTF8Output {
private static final int UTF8_ACCEPT = 0;
private static final int UTF8_REJECT = 12;
- private static final byte[] TYPES = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 11,
- 6, 6, 6, 5, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8 };
+ private static final byte[] TYPES = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8,
+ 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 3, 3, 11, 6, 6, 6, 5, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8 };
- private static final byte[] STATES = { 0, 12, 24, 36, 60, 96, 84, 12, 12, 12, 48, 72, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 0, 12, 12, 12, 12, 12, 0, 12, 0, 12, 12, 12, 24, 12, 12, 12, 12, 12, 24, 12, 24,
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 24, 12, 12, 12, 12, 12, 24, 12, 12, 12, 12, 12, 12, 12, 24, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 36, 12, 36, 12, 12, 12, 36, 12, 12, 12, 12, 12, 36, 12, 36, 12, 12, 12, 36, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12 };
+ private static final byte[] STATES = { 0, 12, 24, 36, 60, 96, 84, 12, 12, 12, 48, 72, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 0, 12, 12, 12, 12, 12, 0, 12, 0, 12, 12,
+ 12, 24, 12, 12, 12, 12, 12, 24, 12, 24, 12, 12, 12, 12, 12, 12, 12, 12, 12, 24, 12, 12,
+ 12, 12, 12, 24, 12, 12, 12, 12, 12, 12, 12, 24, 12, 12, 12, 12, 12, 12, 12, 12, 12, 36,
+ 12, 36, 12, 12, 12, 36, 12, 12, 12, 12, 12, 36, 12, 36, 12, 12, 12, 36, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12 };
private int state = UTF8_ACCEPT;
private int codep;
diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket08FrameDecoder.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket08FrameDecoder.java
index 3f95f639a1..fc114a876a 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket08FrameDecoder.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocket08FrameDecoder.java
@@ -401,7 +401,8 @@ public class WebSocket08FrameDecoder extends ReplayingDecoder customHeaders, int maxFramePayloadLength) {
if (version == WebSocketVersion.V13) {
- return new WebSocketClientHandshaker13(webSocketURL, version, subprotocol, allowExtensions, customHeaders, maxFramePayloadLength);
+ return new WebSocketClientHandshaker13(
+ webSocketURL, version, subprotocol, allowExtensions, customHeaders, maxFramePayloadLength);
}
if (version == WebSocketVersion.V08) {
- return new WebSocketClientHandshaker08(webSocketURL, version, subprotocol, allowExtensions, customHeaders, maxFramePayloadLength);
+ return new WebSocketClientHandshaker08(
+ webSocketURL, version, subprotocol, allowExtensions, customHeaders, maxFramePayloadLength);
}
if (version == WebSocketVersion.V00) {
- return new WebSocketClientHandshaker00(webSocketURL, version, subprotocol, customHeaders, maxFramePayloadLength);
+ return new WebSocketClientHandshaker00(
+ webSocketURL, version, subprotocol, customHeaders, maxFramePayloadLength);
}
throw new WebSocketHandshakeException("Protocol version " + version.toString() + " not supported.");
diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker08.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker08.java
index 7faa65fb08..f4be1b93a0 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker08.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker08.java
@@ -52,17 +52,18 @@ public class WebSocketServerHandshaker08 extends WebSocketServerHandshaker {
* Constructor specifying the destination web socket location
*
* @param webSocketURL
- * URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
- * sent to this URL.
+ * URL for web socket communications. e.g "ws://myhost.com/mypath".
+ * Subsequent web socket frames will be sent to this URL.
* @param subprotocols
* CSV of supported protocols
* @param allowExtensions
* Allow extensions to be used in the reserved bits of the web socket frame
* @param maxFramePayloadLength
- * Maximum allowable frame payload length. Setting this value to your application's requirement may
- * reduce denial of service attacks using long data frames.
+ * Maximum allowable frame payload length. Setting this value to your application's
+ * requirement may reduce denial of service attacks using long data frames.
*/
- public WebSocketServerHandshaker08(String webSocketURL, String subprotocols, boolean allowExtensions, int maxFramePayloadLength) {
+ public WebSocketServerHandshaker08(
+ String webSocketURL, String subprotocols, boolean allowExtensions, int maxFramePayloadLength) {
super(WebSocketVersion.V08, webSocketURL, subprotocols, maxFramePayloadLength);
this.allowExtensions = allowExtensions;
}
diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker13.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker13.java
index e8b89c2392..95737bd23e 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker13.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshaker13.java
@@ -35,10 +35,8 @@ import io.netty.util.CharsetUtil;
/**
*
*/
public class WebSocketServerHandshaker13 extends WebSocketServerHandshaker {
@@ -53,17 +51,18 @@ public class WebSocketServerHandshaker13 extends WebSocketServerHandshaker {
* Constructor specifying the destination web socket location
*
* @param webSocketURL
- * URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
- * sent to this URL.
+ * URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web
+ * socket frames will be sent to this URL.
* @param subprotocols
- * CSV of supported protocols
+ * CSV of supported protocols
* @param allowExtensions
- * Allow extensions to be used in the reserved bits of the web socket frame
+ * Allow extensions to be used in the reserved bits of the web socket frame
* @param maxFramePayloadLength
- * Maximum allowable frame payload length. Setting this value to your application's requirement may
- * reduce denial of service attacks using long data frames.
+ * Maximum allowable frame payload length. Setting this value to your application's
+ * requirement may reduce denial of service attacks using long data frames.
*/
- public WebSocketServerHandshaker13(String webSocketURL, String subprotocols, boolean allowExtensions, int maxFramePayloadLength) {
+ public WebSocketServerHandshaker13(
+ String webSocketURL, String subprotocols, boolean allowExtensions, int maxFramePayloadLength) {
super(WebSocketVersion.V13, webSocketURL, subprotocols, maxFramePayloadLength);
this.allowExtensions = allowExtensions;
}
@@ -136,7 +135,8 @@ public class WebSocketServerHandshaker13 extends WebSocketServerHandshaker {
if (subprotocols != null) {
String selectedSubprotocol = selectSubprotocol(subprotocols);
if (selectedSubprotocol == null) {
- throw new WebSocketHandshakeException("Requested subprotocol(s) not supported: " + subprotocols);
+ throw new WebSocketHandshakeException(
+ "Requested subprotocol(s) not supported: " + subprotocols);
} else {
res.addHeader(Names.SEC_WEBSOCKET_PROTOCOL, selectedSubprotocol);
setSelectedSubprotocol(selectedSubprotocol);
diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshakerFactory.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshakerFactory.java
index ea45f5aa50..4e8b48f25d 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshakerFactory.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketServerHandshakerFactory.java
@@ -40,8 +40,8 @@ public class WebSocketServerHandshakerFactory {
* Constructor specifying the destination web socket location
*
* @param webSocketURL
- * URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
- * sent to this URL.
+ * URL for web socket communications. e.g "ws://myhost.com/mypath".
+ * Subsequent web socket frames will be sent to this URL.
* @param subprotocols
* CSV of supported protocols. Null if sub protocols not supported.
* @param allowExtensions
@@ -56,15 +56,15 @@ public class WebSocketServerHandshakerFactory {
* Constructor specifying the destination web socket location
*
* @param webSocketURL
- * URL for web socket communications. e.g "ws://myhost.com/mypath". Subsequent web socket frames will be
- * sent to this URL.
+ * URL for web socket communications. e.g "ws://myhost.com/mypath".
+ * Subsequent web socket frames will be sent to this URL.
* @param subprotocols
* CSV of supported protocols. Null if sub protocols not supported.
* @param allowExtensions
* Allow extensions to be used in the reserved bits of the web socket frame
* @param maxFramePayloadLength
- * Maximum allowable frame payload length. Setting this value to your application's requirement may
- * reduce denial of service attacks using long data frames.
+ * Maximum allowable frame payload length. Setting this value to your application's
+ * requirement may reduce denial of service attacks using long data frames.
*/
public WebSocketServerHandshakerFactory(
String webSocketURL, String subprotocols, boolean allowExtensions,
@@ -78,8 +78,8 @@ public class WebSocketServerHandshakerFactory {
/**
* Instances a new handshaker
*
- * @return A new WebSocketServerHandshaker for the requested web socket version. Null if web socket version is not
- * supported.
+ * @return A new WebSocketServerHandshaker for the requested web socket version. Null if web
+ * socket version is not supported.
*/
public WebSocketServerHandshaker newHandshaker(HttpRequest req) {
@@ -87,10 +87,12 @@ public class WebSocketServerHandshakerFactory {
if (version != null) {
if (version.equals(WebSocketVersion.V13.toHttpHeaderValue())) {
// Version 13 of the wire protocol - RFC 6455 (version 17 of the draft hybi specification).
- return new WebSocketServerHandshaker13(webSocketURL, subprotocols, allowExtensions, maxFramePayloadLength);
+ return new WebSocketServerHandshaker13(
+ webSocketURL, subprotocols, allowExtensions, maxFramePayloadLength);
} else if (version.equals(WebSocketVersion.V08.toHttpHeaderValue())) {
// Version 8 of the wire protocol - version 10 of the draft hybi specification.
- return new WebSocketServerHandshaker08(webSocketURL, subprotocols, allowExtensions, maxFramePayloadLength);
+ return new WebSocketServerHandshaker08(
+ webSocketURL, subprotocols, allowExtensions, maxFramePayloadLength);
} else {
return null;
}
@@ -114,5 +116,4 @@ public class WebSocketServerHandshakerFactory {
res.setHeader(Names.SEC_WEBSOCKET_VERSION, WebSocketVersion.V13.toHttpHeaderValue());
channel.write(res);
}
-
}
diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/package-info.java b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/package-info.java
index 833d1c80fe..05fedcfaa8 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/package-info.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/http/websocketx/package-info.java
@@ -21,9 +21,10 @@
* This package supports different web socket specification versions (hence the X suffix).
* The specification current supported are:
*
diff --git a/codec-http/src/main/java/io/netty/handler/codec/rtsp/RtspMethods.java b/codec-http/src/main/java/io/netty/handler/codec/rtsp/RtspMethods.java
index 684722916d..7954749daa 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/rtsp/RtspMethods.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/rtsp/RtspMethods.java
@@ -27,10 +27,11 @@ import java.util.Map;
public final class RtspMethods {
/**
- * The OPTIONS method represents a request for information about the communication options available on the request/response
- * chain identified by the Request-URI. This method allows the client to determine the options and/or requirements
- * associated with a resource, or the capabilities of a server, without implying a resource action or initiating a
- * resource retrieval.
+ * The OPTIONS method represents a request for information about the communication options
+ * available on the request/response chain identified by the Request-URI. This method allows
+ * the client to determine the options and/or requirements associated with a resource, or the
+ * capabilities of a server, without implying a resource action or initiating a resource
+ * retrieval.
*/
public static final HttpMethod OPTIONS = HttpMethod.OPTIONS;
diff --git a/codec-http/src/main/java/io/netty/handler/codec/rtsp/RtspResponseStatuses.java b/codec-http/src/main/java/io/netty/handler/codec/rtsp/RtspResponseStatuses.java
index 4c1c4ce084..b53548135e 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/rtsp/RtspResponseStatuses.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/rtsp/RtspResponseStatuses.java
@@ -107,7 +107,8 @@ public final class RtspResponseStatuses {
/**
* 407 Proxy Authentication Required
*/
- public static final HttpResponseStatus PROXY_AUTHENTICATION_REQUIRED = HttpResponseStatus.PROXY_AUTHENTICATION_REQUIRED;
+ public static final HttpResponseStatus PROXY_AUTHENTICATION_REQUIRED =
+ HttpResponseStatus.PROXY_AUTHENTICATION_REQUIRED;
/**
* 408 Request Timeout
diff --git a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpEncoder.java b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpEncoder.java
index 81a1d94b91..b2e2ed22ee 100644
--- a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpEncoder.java
+++ b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpEncoder.java
@@ -239,7 +239,8 @@ public class SpdyHttpEncoder extends MessageToMessageEncoder