From 154198a385e5dbdb2938057895d1a3f5e0c3f2fc Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Tue, 12 Jun 2012 20:20:24 +0900 Subject: [PATCH] ID -> Id (#393 Ensure all fields follow our naming convention) --- .../codec/spdy/DefaultSpdySynStreamFrame.java | 44 +++++++++---------- .../handler/codec/spdy/SpdyFrameEncoder.java | 4 +- .../handler/codec/spdy/SpdyHttpDecoder.java | 4 +- .../handler/codec/spdy/SpdyHttpEncoder.java | 4 +- .../codec/spdy/SpdySessionHandler.java | 4 +- .../codec/spdy/SpdySynStreamFrame.java | 8 ++-- .../codec/spdy/SpdySessionHandlerTest.java | 16 +++---- 7 files changed, 42 insertions(+), 42 deletions(-) diff --git a/codec-http/src/main/java/io/netty/handler/codec/spdy/DefaultSpdySynStreamFrame.java b/codec-http/src/main/java/io/netty/handler/codec/spdy/DefaultSpdySynStreamFrame.java index 55fc1e64b2..e5796e84b5 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/spdy/DefaultSpdySynStreamFrame.java +++ b/codec-http/src/main/java/io/netty/handler/codec/spdy/DefaultSpdySynStreamFrame.java @@ -23,8 +23,8 @@ import io.netty.util.internal.StringUtil; public class DefaultSpdySynStreamFrame extends DefaultSpdyHeaderBlock implements SpdySynStreamFrame { - private int streamID; - private int associatedToStreamID; + private int streamId; + private int associatedToStreamId; private byte priority; private boolean last; private boolean unidirectional; @@ -32,44 +32,44 @@ public class DefaultSpdySynStreamFrame extends DefaultSpdyHeaderBlock /** * Creates a new instance. * - * @param streamID the Stream-ID of this frame - * @param associatedToStreamID the Associated-To-Stream-ID of this frame + * @param streamId the Stream-ID of this frame + * @param associatedToStreamId the Associated-To-Stream-ID of this frame * @param priority the priority of the stream */ public DefaultSpdySynStreamFrame( - int streamID, int associatedToStreamID, byte priority) { - setStreamID(streamID); - setAssociatedToStreamID(associatedToStreamID); + int streamId, int associatedToStreamId, byte priority) { + setStreamId(streamId); + setAssociatedToStreamId(associatedToStreamId); setPriority(priority); } @Override - public int getStreamID() { - return streamID; + public int getStreamId() { + return streamId; } @Override - public void setStreamID(int streamID) { - if (streamID <= 0) { + public void setStreamId(int streamId) { + if (streamId <= 0) { throw new IllegalArgumentException( - "Stream-ID must be positive: " + streamID); + "Stream-ID must be positive: " + streamId); } - this.streamID = streamID; + this.streamId = streamId; } @Override - public int getAssociatedToStreamID() { - return associatedToStreamID; + public int getAssociatedToStreamId() { + return associatedToStreamId; } @Override - public void setAssociatedToStreamID(int associatedToStreamID) { - if (associatedToStreamID < 0) { + public void setAssociatedToStreamId(int associatedToStreamId) { + if (associatedToStreamId < 0) { throw new IllegalArgumentException( "Associated-To-Stream-ID cannot be negative: " + - associatedToStreamID); + associatedToStreamId); } - this.associatedToStreamID = associatedToStreamID; + this.associatedToStreamId = associatedToStreamId; } @Override @@ -117,11 +117,11 @@ public class DefaultSpdySynStreamFrame extends DefaultSpdyHeaderBlock buf.append(')'); buf.append(StringUtil.NEWLINE); buf.append("--> Stream-ID = "); - buf.append(streamID); + buf.append(streamId); buf.append(StringUtil.NEWLINE); - if (associatedToStreamID != 0) { + if (associatedToStreamId != 0) { buf.append("--> Associated-To-Stream-ID = "); - buf.append(associatedToStreamID); + buf.append(associatedToStreamId); buf.append(StringUtil.NEWLINE); } buf.append("--> Priority = "); diff --git a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyFrameEncoder.java b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyFrameEncoder.java index ca33356e89..bb0bf45f36 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyFrameEncoder.java +++ b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyFrameEncoder.java @@ -122,8 +122,8 @@ public class SpdyFrameEncoder extends MessageToByteEncoder { out.writeShort(SPDY_SYN_STREAM_FRAME); out.writeByte(flags); out.writeMedium(length); - out.writeInt(spdySynStreamFrame.getStreamID()); - out.writeInt(spdySynStreamFrame.getAssociatedToStreamID()); + out.writeInt(spdySynStreamFrame.getStreamId()); + out.writeInt(spdySynStreamFrame.getAssociatedToStreamId()); if (version < 3) { // Restrict priorities for SPDY/2 to between 0 and 3 byte priority = spdySynStreamFrame.getPriority(); diff --git a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpDecoder.java b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpDecoder.java index 9c6deeb7e2..1d2a8f0184 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpDecoder.java +++ b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdyHttpDecoder.java @@ -70,11 +70,11 @@ public class SpdyHttpDecoder extends MessageToMessageDecoder { HttpRequest httpRequest = (HttpRequest) msg; SpdySynStreamFrame spdySynStreamFrame = createSynStreamFrame(httpRequest); - int streamID = spdySynStreamFrame.getStreamID(); + int streamID = spdySynStreamFrame.getStreamId(); out.add(spdySynStreamFrame); addContent(out, streamID, httpRequest); @@ -160,7 +160,7 @@ public class SpdyHttpEncoder extends MessageToMessageEncoder { HttpResponse httpResponse = (HttpResponse) msg; if (httpResponse.containsHeader(SpdyHttpHeaders.Names.ASSOCIATED_TO_STREAM_ID)) { SpdySynStreamFrame spdySynStreamFrame = createSynStreamFrame(httpResponse); - int streamID = spdySynStreamFrame.getStreamID(); + int streamID = spdySynStreamFrame.getStreamId(); out.add(spdySynStreamFrame); addContent(out, streamID, httpResponse); } else { diff --git a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySessionHandler.java b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySessionHandler.java index 3bc438ce08..7fb6b0d35a 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySessionHandler.java +++ b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySessionHandler.java @@ -236,7 +236,7 @@ public class SpdySessionHandler */ SpdySynStreamFrame spdySynStreamFrame = (SpdySynStreamFrame) msg; - int streamID = spdySynStreamFrame.getStreamID(); + int streamID = spdySynStreamFrame.getStreamId(); // Check if we received a valid SYN_STREAM frame if (spdySynStreamFrame.isInvalid() || @@ -564,7 +564,7 @@ public class SpdySessionHandler } else if (msg instanceof SpdySynStreamFrame) { SpdySynStreamFrame spdySynStreamFrame = (SpdySynStreamFrame) msg; - int streamID = spdySynStreamFrame.getStreamID(); + int streamID = spdySynStreamFrame.getStreamId(); if (isRemoteInitiatedID(streamID)) { ctx.fireExceptionCaught(PROTOCOL_EXCEPTION); diff --git a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySynStreamFrame.java b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySynStreamFrame.java index d2c0668a02..82282b86ab 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySynStreamFrame.java +++ b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySynStreamFrame.java @@ -23,23 +23,23 @@ public interface SpdySynStreamFrame extends SpdyHeaderBlock { /** * Returns the Stream-ID of this frame. */ - int getStreamID(); + int getStreamId(); /** * Sets the Stream-ID of this frame. The Stream-ID must be positive. */ - void setStreamID(int streamID); + void setStreamId(int streamId); /** * Returns the Associated-To-Stream-ID of this frame. */ - int getAssociatedToStreamID(); + int getAssociatedToStreamId(); /** * Sets the Associated-To-Stream-ID of this frame. * The Associated-To-Stream-ID cannot be negative. */ - void setAssociatedToStreamID(int associatedToStreamID); + void setAssociatedToStreamId(int associatedToStreamId); /** * Returns the priority of the stream. diff --git a/codec-http/src/test/java/io/netty/handler/codec/spdy/SpdySessionHandlerTest.java b/codec-http/src/test/java/io/netty/handler/codec/spdy/SpdySessionHandlerTest.java index 31dc3ccc69..5722cb3836 100644 --- a/codec-http/src/test/java/io/netty/handler/codec/spdy/SpdySessionHandlerTest.java +++ b/codec-http/src/test/java/io/netty/handler/codec/spdy/SpdySessionHandlerTest.java @@ -156,7 +156,7 @@ public class SpdySessionHandlerTest { // Check if session handler closed the streams using the number // of concurrent streams and that it returns REFUSED_STREAM // if it receives a SYN_STREAM frame it does not wish to accept - spdySynStreamFrame.setStreamID(localStreamID); + spdySynStreamFrame.setStreamId(localStreamID); spdySynStreamFrame.setLast(true); spdySynStreamFrame.setUnidirectional(true); sessionHandler.writeInbound(spdySynStreamFrame); @@ -184,11 +184,11 @@ public class SpdySessionHandlerTest { // Check if session handler returns PROTOCOL_ERROR if it receives // a SYN_STREAM frame with an invalid Stream-ID - spdySynStreamFrame.setStreamID(localStreamID - 1); + spdySynStreamFrame.setStreamId(localStreamID - 1); sessionHandler.writeInbound(spdySynStreamFrame); assertRstStream(sessionHandler.readOutbound(), localStreamID - 1, SpdyStreamStatus.PROTOCOL_ERROR); Assert.assertNull(sessionHandler.readOutbound()); - spdySynStreamFrame.setStreamID(localStreamID); + spdySynStreamFrame.setStreamId(localStreamID); // Check if session handler correctly limits the number of // concurrent streams in the SETTINGS frame @@ -241,7 +241,7 @@ public class SpdySessionHandlerTest { // Check if session handler returns REFUSED_STREAM if it receives // SYN_STREAM frames after sending a GOAWAY frame - spdySynStreamFrame.setStreamID(localStreamID); + spdySynStreamFrame.setStreamId(localStreamID); sessionHandler.writeInbound(spdySynStreamFrame); assertRstStream(sessionHandler.readOutbound(), localStreamID, SpdyStreamStatus.REFUSED_STREAM); Assert.assertNull(sessionHandler.readOutbound()); @@ -290,11 +290,11 @@ public class SpdySessionHandlerTest { new DefaultSpdySynStreamFrame(streamID, 0, (byte) 0); spdySynStreamFrame.setLast(true); ctx.write(spdySynStreamFrame); - spdySynStreamFrame.setStreamID(spdySynStreamFrame.getStreamID() + 2); + spdySynStreamFrame.setStreamId(spdySynStreamFrame.getStreamId() + 2); ctx.write(spdySynStreamFrame); - spdySynStreamFrame.setStreamID(spdySynStreamFrame.getStreamID() + 2); + spdySynStreamFrame.setStreamId(spdySynStreamFrame.getStreamId() + 2); ctx.write(spdySynStreamFrame); - spdySynStreamFrame.setStreamID(spdySynStreamFrame.getStreamID() + 2); + spdySynStreamFrame.setStreamId(spdySynStreamFrame.getStreamId() + 2); ctx.write(spdySynStreamFrame); // Limit the number of concurrent streams to 3 @@ -317,7 +317,7 @@ public class SpdySessionHandlerTest { SpdySynStreamFrame spdySynStreamFrame = (SpdySynStreamFrame) msg; if (!spdySynStreamFrame.isUnidirectional()) { - int streamID = spdySynStreamFrame.getStreamID(); + int streamID = spdySynStreamFrame.getStreamId(); SpdySynReplyFrame spdySynReplyFrame = new DefaultSpdySynReplyFrame(streamID); spdySynReplyFrame.setLast(spdySynStreamFrame.isLast()); for (Map.Entry entry: spdySynStreamFrame.getHeaders()) {