You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@thrift.apache.org by GitBox <gi...@apache.org> on 2020/09/16 09:30:32 UTC

[GitHub] [thrift] zeshuai007 commented on a change in pull request #2191: THRIFT-5237 Implement MAX_MESSAGE_SIZE and consolidate limits into a TConfiguration class(JAVA)

zeshuai007 commented on a change in pull request #2191:
URL: https://github.com/apache/thrift/pull/2191#discussion_r489298393



##########
File path: lib/java/src/org/apache/thrift/protocol/TCompactProtocol.java
##########
@@ -37,868 +38,930 @@
  * and i64 fields you have, the more benefit you'll see.
  */
 public class TCompactProtocol extends TProtocol {
-  private final static byte[] EMPTY_BYTES = new byte[0];
-  private final static ByteBuffer EMPTY_BUFFER = ByteBuffer.wrap(EMPTY_BYTES);
-
-  private final static long NO_LENGTH_LIMIT = -1;
-
-  private final static TStruct ANONYMOUS_STRUCT = new TStruct("");
-  private final static TField TSTOP = new TField("", TType.STOP, (short)0);
-
-  private final static byte[] ttypeToCompactType = new byte[16];
-
-  static {
-    ttypeToCompactType[TType.STOP] = TType.STOP;
-    ttypeToCompactType[TType.BOOL] = Types.BOOLEAN_TRUE;
-    ttypeToCompactType[TType.BYTE] = Types.BYTE;
-    ttypeToCompactType[TType.I16] = Types.I16;
-    ttypeToCompactType[TType.I32] = Types.I32;
-    ttypeToCompactType[TType.I64] = Types.I64;
-    ttypeToCompactType[TType.DOUBLE] = Types.DOUBLE;
-    ttypeToCompactType[TType.STRING] = Types.BINARY;
-    ttypeToCompactType[TType.LIST] = Types.LIST;
-    ttypeToCompactType[TType.SET] = Types.SET;
-    ttypeToCompactType[TType.MAP] = Types.MAP;
-    ttypeToCompactType[TType.STRUCT] = Types.STRUCT;
-  }
-
-  /**
-   * TProtocolFactory that produces TCompactProtocols.
-   */
-  public static class Factory implements TProtocolFactory {
+    private final static byte[] EMPTY_BYTES = new byte[0];
+    private final static ByteBuffer EMPTY_BUFFER = ByteBuffer.wrap(EMPTY_BYTES);
+
+    private final static long NO_LENGTH_LIMIT = -1;
+
+    private final static TStruct ANONYMOUS_STRUCT = new TStruct("");
+    private final static TField TSTOP = new TField("", TType.STOP, (short) 0);
+
+    private final static byte[] ttypeToCompactType = new byte[16];
+
+    static {
+        ttypeToCompactType[TType.STOP] = TType.STOP;
+        ttypeToCompactType[TType.BOOL] = Types.BOOLEAN_TRUE;
+        ttypeToCompactType[TType.BYTE] = Types.BYTE;
+        ttypeToCompactType[TType.I16] = Types.I16;

Review comment:
       I'm also surprised that IDEA has modified these spaces.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org