Remove unnecessary throws clauses for unchecked exceptions
This commit is contained in:
parent
4b4c6a436b
commit
ac53b9e99e
@ -15,6 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
package org.jboss.netty.buffer;
|
package org.jboss.netty.buffer;
|
||||||
|
|
||||||
|
import org.jboss.netty.util.internal.DetectionUtil;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
@ -26,8 +28,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.jboss.netty.util.internal.DetectionUtil;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A virtual buffer which shows multiple buffers as a single merged buffer. It
|
* A virtual buffer which shows multiple buffers as a single merged buffer. It
|
||||||
* is recommended to use {@link ChannelBuffers#wrappedBuffer(ChannelBuffer...)}
|
* is recommended to use {@link ChannelBuffers#wrappedBuffer(ChannelBuffer...)}
|
||||||
@ -605,7 +605,7 @@ public class CompositeChannelBuffer extends AbstractChannelBuffer {
|
|||||||
* @throws IndexOutOfBoundsException when the specified {@code index} is
|
* @throws IndexOutOfBoundsException when the specified {@code index} is
|
||||||
* less than zero, or larger than {@code capacity()}
|
* less than zero, or larger than {@code capacity()}
|
||||||
*/
|
*/
|
||||||
public ChannelBuffer getBuffer(int index) throws IndexOutOfBoundsException {
|
public ChannelBuffer getBuffer(int index) {
|
||||||
if (index < 0 || index >= capacity()) {
|
if (index < 0 || index >= capacity()) {
|
||||||
throw new IndexOutOfBoundsException("Invalid index: " + index
|
throw new IndexOutOfBoundsException("Invalid index: " + index
|
||||||
+ " - Bytes needed: " + index + ", maximum is "
|
+ " - Bytes needed: " + index + ", maximum is "
|
||||||
|
@ -220,7 +220,7 @@ public class WebSocketClientHandshaker00 extends WebSocketClientHandshaker {
|
|||||||
* @throws WebSocketHandshakeException
|
* @throws WebSocketHandshakeException
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void finishHandshake(Channel channel, HttpResponse response) throws WebSocketHandshakeException {
|
public void finishHandshake(Channel channel, HttpResponse response) {
|
||||||
final HttpResponseStatus status = new HttpResponseStatus(101, "WebSocket Protocol Handshake");
|
final HttpResponseStatus status = new HttpResponseStatus(101, "WebSocket Protocol Handshake");
|
||||||
|
|
||||||
if (!response.getStatus().equals(status)) {
|
if (!response.getStatus().equals(status)) {
|
||||||
|
@ -201,7 +201,7 @@ public class WebSocketClientHandshaker13 extends WebSocketClientHandshaker {
|
|||||||
* @throws WebSocketHandshakeException
|
* @throws WebSocketHandshakeException
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void finishHandshake(Channel channel, HttpResponse response) throws WebSocketHandshakeException {
|
public void finishHandshake(Channel channel, HttpResponse response) {
|
||||||
final HttpResponseStatus status = HttpResponseStatus.SWITCHING_PROTOCOLS;
|
final HttpResponseStatus status = HttpResponseStatus.SWITCHING_PROTOCOLS;
|
||||||
|
|
||||||
if (!response.getStatus().equals(status)) {
|
if (!response.getStatus().equals(status)) {
|
||||||
|
@ -40,7 +40,7 @@ public class WebSocketClientHandshakerFactory {
|
|||||||
* @throws WebSocketHandshakeException
|
* @throws WebSocketHandshakeException
|
||||||
*/
|
*/
|
||||||
public WebSocketClientHandshaker newHandshaker(URI webSocketURL, WebSocketVersion version, String subprotocol,
|
public WebSocketClientHandshaker newHandshaker(URI webSocketURL, WebSocketVersion version, String subprotocol,
|
||||||
boolean allowExtensions, Map<String, String> customHeaders) throws WebSocketHandshakeException {
|
boolean allowExtensions, Map<String, String> customHeaders) {
|
||||||
return newHandshaker(webSocketURL, version, subprotocol, allowExtensions, customHeaders, Long.MAX_VALUE);
|
return newHandshaker(webSocketURL, version, subprotocol, allowExtensions, customHeaders, Long.MAX_VALUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,11 +61,11 @@ public class WebSocketClientHandshakerFactory {
|
|||||||
* @param maxFramePayloadLength
|
* @param maxFramePayloadLength
|
||||||
* Maximum allowable frame payload length. Setting this value to your application's
|
* Maximum allowable frame payload length. Setting this value to your application's
|
||||||
* requirement may reduce denial of service attacks using long data frames.
|
* requirement may reduce denial of service attacks using long data frames.
|
||||||
|
* @throws WebSocketHandshakeException
|
||||||
*/
|
*/
|
||||||
public WebSocketClientHandshaker newHandshaker(
|
public WebSocketClientHandshaker newHandshaker(
|
||||||
URI webSocketURL, WebSocketVersion version, String subprotocol,
|
URI webSocketURL, WebSocketVersion version, String subprotocol,
|
||||||
boolean allowExtensions, Map<String, String> customHeaders, long maxFramePayloadLength)
|
boolean allowExtensions, Map<String, String> customHeaders, long maxFramePayloadLength) {
|
||||||
throws WebSocketHandshakeException {
|
|
||||||
if (version == WebSocketVersion.V13) {
|
if (version == WebSocketVersion.V13) {
|
||||||
return new WebSocketClientHandshaker13(
|
return new WebSocketClientHandshaker13(
|
||||||
webSocketURL, version, subprotocol, allowExtensions, customHeaders, maxFramePayloadLength);
|
webSocketURL, version, subprotocol, allowExtensions, customHeaders, maxFramePayloadLength);
|
||||||
|
Loading…
Reference in New Issue
Block a user