Permalink
Browse files

improve formatting in TProtocolUtil.skip

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@1028140 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent e15bc70 commit b9621e9b63f6a40124e48c8a905e4b50a4c1c999 bryanduxbury committed Oct 27, 2010
Showing with 24 additions and 35 deletions.
  1. +24 −35 lib/java/src/org/apache/thrift/protocol/TProtocolUtil.java
@@ -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();
@@ -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;
}
}

0 comments on commit b9621e9

Please sign in to comment.