Rename get/setDecodeResult() to get/setDecoderResult()

This commit is contained in:
Trustin Lee 2012-09-28 15:20:02 +09:00
parent bf808b3486
commit 9155f58c64
9 changed files with 19 additions and 19 deletions

View File

@ -66,7 +66,7 @@ public class DefaultHttpChunk extends DefaultHttpObject implements HttpChunk {
}
buf.append(", decodeResult: ");
buf.append(getDecodeResult());
buf.append(getDecoderResult());
buf.append(')');
return buf.toString();

View File

@ -120,7 +120,7 @@ public class DefaultHttpChunkTrailer extends DefaultHttpObject implements HttpCh
}
buf.append(", decodeResult: ");
buf.append(getDecodeResult());
buf.append(getDecoderResult());
buf.append(')');
buf.append(StringUtil.NEWLINE);
appendHeaders(buf);

View File

@ -26,12 +26,12 @@ public class DefaultHttpObject implements HttpObject {
}
@Override
public DecoderResult getDecodeResult() {
public DecoderResult getDecoderResult() {
return decodeResult;
}
@Override
public void setDecodeResult(DecoderResult result) {
public void setDecoderResult(DecoderResult result) {
if (result == null) {
throw new NullPointerException("result");
}

View File

@ -71,7 +71,7 @@ public class DefaultHttpRequest extends DefaultHttpMessage implements HttpReques
buf.append("(transferEncoding: ");
buf.append(getTransferEncoding());
buf.append(", decodeResult: ");
buf.append(getDecodeResult());
buf.append(getDecoderResult());
buf.append(')');
buf.append(StringUtil.NEWLINE);
buf.append(getMethod().toString());

View File

@ -55,7 +55,7 @@ public class DefaultHttpResponse extends DefaultHttpMessage implements HttpRespo
buf.append("(transferEncoding: ");
buf.append(getTransferEncoding());
buf.append(", decodeResult: ");
buf.append(getDecodeResult());
buf.append(getDecoderResult());
buf.append(')');
buf.append(StringUtil.NEWLINE);
buf.append(getProtocolVersion().getText());

View File

@ -106,12 +106,12 @@ public interface HttpChunk extends HttpObject {
}
@Override
public DecoderResult getDecodeResult() {
public DecoderResult getDecoderResult() {
return DecoderResult.SUCCESS;
}
@Override
public void setDecodeResult(DecoderResult result) {
public void setDecoderResult(DecoderResult result) {
throw new IllegalStateException("read-only");
}
};

View File

@ -459,10 +459,10 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<Object, HttpMe
private HttpMessage invalidMessage(Exception cause) {
checkpoint(State.BAD_MESSAGE);
if (message != null) {
message.setDecodeResult(DecoderResult.partialFailure(cause));
message.setDecoderResult(DecoderResult.partialFailure(cause));
} else {
message = createInvalidMessage();
message.setDecodeResult(DecoderResult.failure(cause));
message.setDecoderResult(DecoderResult.failure(cause));
}
return message;
}
@ -470,7 +470,7 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder<Object, HttpMe
private HttpChunk invalidChunk(Exception cause) {
checkpoint(State.BAD_MESSAGE);
HttpChunk chunk = new DefaultHttpChunk(Unpooled.EMPTY_BUFFER);
chunk.setDecodeResult(DecoderResult.failure(cause));
chunk.setDecoderResult(DecoderResult.failure(cause));
return chunk;
}

View File

@ -18,6 +18,6 @@ package io.netty.handler.codec.http;
import io.netty.handler.codec.DecoderResult;
public interface HttpObject {
DecoderResult getDecodeResult();
void setDecodeResult(DecoderResult result);
DecoderResult getDecoderResult();
void setDecoderResult(DecoderResult result);
}

View File

@ -35,7 +35,7 @@ public class HttpInvalidMessageTest {
EmbeddedByteChannel ch = new EmbeddedByteChannel(new HttpRequestDecoder());
ch.writeInbound(Unpooled.copiedBuffer("GET / HTTP/1.0 with extra\r\n", CharsetUtil.UTF_8));
HttpRequest req = (HttpRequest) ch.readInbound();
DecoderResult dr = req.getDecodeResult();
DecoderResult dr = req.getDecoderResult();
Assert.assertFalse(dr.isSuccess());
Assert.assertFalse(dr.isPartial());
ensureInboundTrafficDiscarded(ch);
@ -49,7 +49,7 @@ public class HttpInvalidMessageTest {
ch.writeInbound(Unpooled.copiedBuffer("Bad=Name: Bad Value\r\n", CharsetUtil.UTF_8));
ch.writeInbound(Unpooled.copiedBuffer("\r\n", CharsetUtil.UTF_8));
HttpRequest req = (HttpRequest) ch.readInbound();
DecoderResult dr = req.getDecodeResult();
DecoderResult dr = req.getDecoderResult();
Assert.assertFalse(dr.isSuccess());
Assert.assertTrue(dr.isPartial());
Assert.assertEquals("Good Value", req.getHeader("Good_Name"));
@ -62,7 +62,7 @@ public class HttpInvalidMessageTest {
EmbeddedByteChannel ch = new EmbeddedByteChannel(new HttpResponseDecoder());
ch.writeInbound(Unpooled.copiedBuffer("HTTP/1.0 BAD_CODE Bad Server\r\n", CharsetUtil.UTF_8));
HttpResponse res = (HttpResponse) ch.readInbound();
DecoderResult dr = res.getDecodeResult();
DecoderResult dr = res.getDecoderResult();
Assert.assertFalse(dr.isSuccess());
Assert.assertFalse(dr.isPartial());
ensureInboundTrafficDiscarded(ch);
@ -76,7 +76,7 @@ public class HttpInvalidMessageTest {
ch.writeInbound(Unpooled.copiedBuffer("Bad=Name: Bad Value\r\n", CharsetUtil.UTF_8));
ch.writeInbound(Unpooled.copiedBuffer("\r\n", CharsetUtil.UTF_8));
HttpResponse res = (HttpResponse) ch.readInbound();
DecoderResult dr = res.getDecodeResult();
DecoderResult dr = res.getDecoderResult();
Assert.assertFalse(dr.isSuccess());
Assert.assertTrue(dr.isPartial());
Assert.assertEquals("Maybe OK", res.getStatus().getReasonPhrase());
@ -92,10 +92,10 @@ public class HttpInvalidMessageTest {
ch.writeInbound(Unpooled.copiedBuffer("BAD_LENGTH\r\n", CharsetUtil.UTF_8));
HttpRequest req = (HttpRequest) ch.readInbound();
Assert.assertTrue(req.getDecodeResult().isSuccess());
Assert.assertTrue(req.getDecoderResult().isSuccess());
HttpChunk chunk = (HttpChunk) ch.readInbound();
DecoderResult dr = chunk.getDecodeResult();
DecoderResult dr = chunk.getDecoderResult();
Assert.assertFalse(dr.isSuccess());
Assert.assertFalse(dr.isPartial());
ensureInboundTrafficDiscarded(ch);