diff options
author | Simone Bordet | 2014-06-25 10:37:05 +0000 |
---|---|---|
committer | Simone Bordet | 2014-06-25 10:37:05 +0000 |
commit | 4c2c7e8352886cb6ed189fe5715c71f0a21e3158 (patch) | |
tree | 390ee1c0328dd342b554094cd2d29d665773a3f8 /jetty-http2 | |
parent | 66f3913527d060d8d003b00266c57728f4f28ced (diff) | |
download | org.eclipse.jetty.project-4c2c7e8352886cb6ed189fe5715c71f0a21e3158.tar.gz org.eclipse.jetty.project-4c2c7e8352886cb6ed189fe5715c71f0a21e3158.tar.xz org.eclipse.jetty.project-4c2c7e8352886cb6ed189fe5715c71f0a21e3158.zip |
Guarded calls to LOG.debug() with if (LOG.isDebugEnabled()) to reduce allocation of varargs Object[].
Diffstat (limited to 'jetty-http2')
3 files changed, 10 insertions, 5 deletions
diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Session.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Session.java index e8acbcc277..c2377b365b 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Session.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Session.java @@ -226,7 +226,8 @@ public abstract class HTTP2Session implements ISession, Parser.Listener if (LOG.isDebugEnabled()) { String reason = tryConvertPayload(frame.getPayload()); - LOG.debug("Received {}: {}/'{}'", frame.getType(), frame.getError(), reason); + if (LOG.isDebugEnabled()) + LOG.debug("Received {}: {}/'{}'", frame.getType(), frame.getError(), reason); } flusher.close(); diff --git a/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackDecoder.java b/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackDecoder.java index 136bb8541d..82efe316c3 100644 --- a/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackDecoder.java +++ b/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackDecoder.java @@ -87,7 +87,8 @@ public class HpackDecoder _context.get(index).removeFromRefSet(); else if (entry.isStatic()) { - LOG.debug("decode IdxStatic {}",entry); + if (LOG.isDebugEnabled()) + LOG.debug("decode IdxStatic {}",entry); // emit field _builder.emit(entry.getHttpField()); @@ -98,7 +99,8 @@ public class HpackDecoder } else { - LOG.debug("decode Idx {}",entry); + if (LOG.isDebugEnabled()) + LOG.debug("decode Idx {}",entry); // emit _builder.emit(entry.getHttpField()); // add to reference set @@ -227,7 +229,8 @@ public class HpackDecoder else if (f==3) { // clear reference set - LOG.debug("decode clear"); + if (LOG.isDebugEnabled()) + LOG.debug("decode clear"); _context.clearReferenceSet(); } } diff --git a/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackEncoder.java b/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackEncoder.java index 1ba7ae3adf..445e55370b 100644 --- a/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackEncoder.java +++ b/jetty-http2/http2-hpack/src/main/java/org/eclipse/jetty/http2/hpack/HpackEncoder.java @@ -345,7 +345,8 @@ public class HpackEncoder if (p>=0) { int e=buffer.position(); - LOG.debug("encoded '{}' by {} to '{}'",field,encoding,TypeUtil.toHexString(buffer.array(),buffer.arrayOffset()+p,e-p)); + if (LOG.isDebugEnabled()) + LOG.debug("encoded '{}' by {} to '{}'",field,encoding,TypeUtil.toHexString(buffer.array(),buffer.arrayOffset()+p,e-p)); } } } |