ID -> Id (#393 Ensure all fields follow our naming convention)

This commit is contained in:
Trustin Lee 2012-06-12 20:25:21 +09:00
parent 154198a385
commit 60de50d89e
5 changed files with 17 additions and 17 deletions

View File

@ -22,25 +22,25 @@ import io.netty.util.internal.StringUtil;
*/
public class DefaultSpdyPingFrame implements SpdyPingFrame {
private int ID;
private int id;
/**
* Creates a new instance.
*
* @param ID the unique ID of this frame
* @param id the unique ID of this frame
*/
public DefaultSpdyPingFrame(int ID) {
setID(ID);
public DefaultSpdyPingFrame(int id) {
setId(id);
}
@Override
public int getID() {
return ID;
public int getId() {
return id;
}
@Override
public void setID(int ID) {
this.ID = ID;
public void setId(int id) {
this.id = id;
}
@Override
@ -49,7 +49,7 @@ public class DefaultSpdyPingFrame implements SpdyPingFrame {
buf.append(getClass().getSimpleName());
buf.append(StringUtil.NEWLINE);
buf.append("--> ID = ");
buf.append(ID);
buf.append(id);
return buf.toString();
}
}

View File

@ -229,7 +229,7 @@ public class SpdyFrameEncoder extends MessageToByteEncoder<Object> {
out.writeShort(version | 0x8000);
out.writeShort(SPDY_PING_FRAME);
out.writeInt(4);
out.writeInt(spdyPingFrame.getID());
out.writeInt(spdyPingFrame.getId());
} else if (msg instanceof SpdyGoAwayFrame) {

View File

@ -23,10 +23,10 @@ public interface SpdyPingFrame {
/**
* Returns the ID of this frame.
*/
int getID();
int getId();
/**
* Sets the ID of this frame.
*/
void setID(int ID);
void setId(int id);
}

View File

@ -347,7 +347,7 @@ public class SpdySessionHandler
SpdyPingFrame spdyPingFrame = (SpdyPingFrame) msg;
if (isRemoteInitiatedID(spdyPingFrame.getID())) {
if (isRemoteInitiatedID(spdyPingFrame.getId())) {
ctx.write(spdyPingFrame);
return;
}
@ -629,9 +629,9 @@ public class SpdySessionHandler
} else if (msg instanceof SpdyPingFrame) {
SpdyPingFrame spdyPingFrame = (SpdyPingFrame) msg;
if (isRemoteInitiatedID(spdyPingFrame.getID())) {
if (isRemoteInitiatedID(spdyPingFrame.getId())) {
ctx.fireExceptionCaught(new IllegalArgumentException(
"invalid PING ID: " + spdyPingFrame.getID()));
"invalid PING ID: " + spdyPingFrame.getId()));
return;
}
pings.getAndIncrement();

View File

@ -80,7 +80,7 @@ public class SpdySessionHandlerTest {
Assert.assertNotNull(msg);
Assert.assertTrue(msg instanceof SpdyPingFrame);
SpdyPingFrame spdyPingFrame = (SpdyPingFrame) msg;
Assert.assertTrue(spdyPingFrame.getID() == ID);
Assert.assertTrue(spdyPingFrame.getId() == ID);
}
private static void assertGoAway(Object msg, int lastGoodStreamID) {
@ -226,7 +226,7 @@ public class SpdySessionHandlerTest {
// Check if session handler returns identical local PINGs
sessionHandler.writeInbound(localPingFrame);
assertPing(sessionHandler.readOutbound(), localPingFrame.getID());
assertPing(sessionHandler.readOutbound(), localPingFrame.getId());
Assert.assertNull(sessionHandler.readOutbound());
// Check if session handler ignores un-initiated remote PINGs