Skip to content

Commit

Permalink
improve formatting in TProtocolUtil.skip
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1028140 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
bryanduxbury committed Oct 27, 2010
1 parent e15bc70 commit b9621e9
Showing 1 changed file with 24 additions and 35 deletions.
59 changes: 24 additions & 35 deletions lib/java/src/org/apache/thrift/protocol/TProtocolUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,43 +74,35 @@ public static void skip(TProtocol prot, byte type, int maxDepth)
throw new TException("Maximum skip depth exceeded");
}
switch (type) {
case TType.BOOL:
{
case TType.BOOL:
prot.readBool();
break;
}
case TType.BYTE:
{

case TType.BYTE:
prot.readByte();
break;
}
case TType.I16:
{

case TType.I16:
prot.readI16();
break;
}
case TType.I32:
{

case TType.I32:
prot.readI32();
break;
}
case TType.I64:
{

case TType.I64:
prot.readI64();
break;
}
case TType.DOUBLE:
{

case TType.DOUBLE:
prot.readDouble();
break;
}
case TType.STRING:
{

case TType.STRING:
prot.readBinary();
break;
}
case TType.STRUCT:
{

case TType.STRUCT:
prot.readStructBegin();
while (true) {
TField field = prot.readFieldBegin();
Expand All @@ -122,37 +114,34 @@ public static void skip(TProtocol prot, byte type, int maxDepth)
}
prot.readStructEnd();
break;
}
case TType.MAP:
{

case TType.MAP:
TMap map = prot.readMapBegin();
for (int i = 0; i < map.size; i++) {
skip(prot, map.keyType, maxDepth - 1);
skip(prot, map.valueType, maxDepth - 1);
}
prot.readMapEnd();
break;
}
case TType.SET:
{

case TType.SET:
TSet set = prot.readSetBegin();
for (int i = 0; i < set.size; i++) {
skip(prot, set.elemType, maxDepth - 1);
}
prot.readSetEnd();
break;
}
case TType.LIST:
{

case TType.LIST:
TList list = prot.readListBegin();
for (int i = 0; i < list.size; i++) {
skip(prot, list.elemType, maxDepth - 1);
}
prot.readListEnd();
break;
}
default:
break;

default:
break;
}
}

Expand Down

0 comments on commit b9621e9

Please sign in to comment.