http-client-branch: (HttpClient) cleanup before JDK-8196962. Removing a legacy logging for HPACK decoding. The HPACK core provides a more robust one. http-client-branch
authorprappo
Wed, 07 Feb 2018 22:49:25 +0000
branchhttp-client-branch
changeset 56094 881f0ecb513f
parent 56093 22d94c4a3641
child 56097 15dc43936d39
http-client-branch: (HttpClient) cleanup before JDK-8196962. Removing a legacy logging for HPACK decoding. The HPACK core provides a more robust one.
src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java
--- a/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java	Wed Feb 07 22:09:31 2018 +0000
+++ b/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java	Wed Feb 07 22:49:25 2018 +0000
@@ -620,7 +620,7 @@
                 if (frame instanceof HeaderFrame) {
                     // always decode the headers as they may affect
                     // connection-level HPACK decoding state
-                    HeaderDecoder decoder = new LoggingHeaderDecoder(new HeaderDecoder());
+                    HeaderDecoder decoder = new HeaderDecoder();
                     decodeHeaders((HeaderFrame) frame, decoder);
                 }
 
@@ -658,7 +658,7 @@
     {
         // always decode the headers as they may affect connection-level HPACK
         // decoding state
-        HeaderDecoder decoder = new LoggingHeaderDecoder(new HeaderDecoder());
+        HeaderDecoder decoder = new HeaderDecoder();
         decodeHeaders(pp, decoder);
 
         HttpRequestImpl parentReq = parent.request;
@@ -1139,106 +1139,6 @@
                     + connection.getConnectionFlow() + ")";
     }
 
-    final class LoggingHeaderDecoder extends HeaderDecoder {
-
-        private final HeaderDecoder delegate;
-        private final System.Logger debugHpack =
-                Utils.getHpackLogger(this::dbgString, DEBUG_HPACK);
-
-        LoggingHeaderDecoder(HeaderDecoder delegate) {
-            this.delegate = delegate;
-        }
-
-        String dbgString() {
-            return Http2Connection.this.dbgString() + "/LoggingHeaderDecoder";
-        }
-
-        @Override
-        public void onDecoded(CharSequence name, CharSequence value) {
-            delegate.onDecoded(name, value);
-        }
-
-        @Override
-        public void onIndexed(int index,
-                              CharSequence name,
-                              CharSequence value) {
-            debugHpack.log(Level.DEBUG, "onIndexed(%s, %s, %s)%n",
-                           index, name, value);
-            delegate.onIndexed(index, name, value);
-        }
-
-        @Override
-        public void onLiteral(int index,
-                              CharSequence name,
-                              CharSequence value,
-                              boolean valueHuffman) {
-            debugHpack.log(Level.DEBUG, "onLiteral(%s, %s, %s, %s)%n",
-                              index, name, value, valueHuffman);
-            delegate.onLiteral(index, name, value, valueHuffman);
-        }
-
-        @Override
-        public void onLiteral(CharSequence name,
-                              boolean nameHuffman,
-                              CharSequence value,
-                              boolean valueHuffman) {
-            debugHpack.log(Level.DEBUG, "onLiteral(%s, %s, %s, %s)%n",
-                           name, nameHuffman, value, valueHuffman);
-            delegate.onLiteral(name, nameHuffman, value, valueHuffman);
-        }
-
-        @Override
-        public void onLiteralNeverIndexed(int index,
-                                          CharSequence name,
-                                          CharSequence value,
-                                          boolean valueHuffman) {
-            debugHpack.log(Level.DEBUG, "onLiteralNeverIndexed(%s, %s, %s, %s)%n",
-                           index, name, value, valueHuffman);
-            delegate.onLiteralNeverIndexed(index, name, value, valueHuffman);
-        }
-
-        @Override
-        public void onLiteralNeverIndexed(CharSequence name,
-                                          boolean nameHuffman,
-                                          CharSequence value,
-                                          boolean valueHuffman) {
-            debugHpack.log(Level.DEBUG, "onLiteralNeverIndexed(%s, %s, %s, %s)%n",
-                           name, nameHuffman, value, valueHuffman);
-            delegate.onLiteralNeverIndexed(name, nameHuffman, value, valueHuffman);
-        }
-
-        @Override
-        public void onLiteralWithIndexing(int index,
-                                          CharSequence name,
-                                          CharSequence value,
-                                          boolean valueHuffman) {
-            debugHpack.log(Level.DEBUG, "onLiteralWithIndexing(%s, %s, %s, %s)%n",
-                           index, name, value, valueHuffman);
-            delegate.onLiteralWithIndexing(index, name, value, valueHuffman);
-        }
-
-        @Override
-        public void onLiteralWithIndexing(CharSequence name,
-                                          boolean nameHuffman,
-                                          CharSequence value,
-                                          boolean valueHuffman) {
-            debugHpack.log(Level.DEBUG, "onLiteralWithIndexing(%s, %s, %s, %s)%n",
-                              name, nameHuffman, value, valueHuffman);
-            delegate.onLiteralWithIndexing(name, nameHuffman, value, valueHuffman);
-        }
-
-        @Override
-        public void onSizeUpdate(int capacity) {
-            debugHpack.log(Level.DEBUG, "onSizeUpdate(%s)%n", capacity);
-            delegate.onSizeUpdate(capacity);
-        }
-
-        @Override
-        HttpHeadersImpl headers() {
-            return delegate.headers();
-        }
-    }
-
     static class HeaderDecoder implements DecodingCallback {
         HttpHeadersImpl headers;