From 611cb7278e3480995dd3b5c610ac374ff59526c7 Mon Sep 17 00:00:00 2001 From: Martin Kouba Date: Tue, 21 Jul 2015 08:48:04 +0200 Subject: [PATCH] WELD-1948 Bean store leak - build bean identifiers string only if debug level is enabled --- .../org/jboss/weld/context/http/HttpRequestContextImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/impl/src/main/java/org/jboss/weld/context/http/HttpRequestContextImpl.java b/impl/src/main/java/org/jboss/weld/context/http/HttpRequestContextImpl.java index 918297a2635..fa00fe90a96 100644 --- a/impl/src/main/java/org/jboss/weld/context/http/HttpRequestContextImpl.java +++ b/impl/src/main/java/org/jboss/weld/context/http/HttpRequestContextImpl.java @@ -54,7 +54,9 @@ public boolean associate(HttpServletRequest request) { BoundBeanStore beanStore = getBeanStore(); if (beanStore != null) { ContextLogger.LOG.beanStoreLeakDuringAssociation(this.getClass().getName(), request); - ContextLogger.LOG.beanStoreLeakAffectedBeanIdentifiers(this.getClass().getName(), Iterables.toMultiRowString(beanStore)); + if (ContextLogger.LOG.isDebugEnabled()) { + ContextLogger.LOG.beanStoreLeakAffectedBeanIdentifiers(this.getClass().getName(), Iterables.toMultiRowString(beanStore)); + } } // We always associate a new bean store to avoid possible leaks (security threats) beanStore = new RequestBeanStore(request, namingScheme);