[jboss-cvs] [Fwd: jboss-cvs-commits Digest, Vol 29, Issue 710]
Ales Justin
ales.justin at gmail.com
Fri Nov 28 01:54:49 EST 2008
What's so NOT pattern in here?
My case was more optimal than yours. ;-)
In your case log::isTraceEnabled will always get invoked,
where in my case it might be invoked once.
------------------------------
Message: 3
Date: Thu, 27 Nov 2008 11:31:48 -0500
From: jboss-cvs-commits at lists.jboss.org
Subject: [jboss-cvs] JBossAS SVN: r81740 -
trunk/server/src/main/org/jboss/deployment.
To: jboss-cvs-commits at lists.jboss.org
Message-ID: <E1L5jmO-0003az-49 at committer01.frg.pub.inap.atl.jboss.com>
Content-Type: text/plain; charset=UTF-8
Author: adrian at jboss.org
Date: 2008-11-27 11:31:47 -0500 (Thu, 27 Nov 2008)
New Revision: 81740
Modified:
trunk/server/src/main/org/jboss/deployment/FileNameVirtualFileFilter.java
Log:
Fix a classic example of how NOT to use log.isTraceEnabled()
Modified:
trunk/server/src/main/org/jboss/deployment/FileNameVirtualFileFilter.java
===================================================================
---
trunk/server/src/main/org/jboss/deployment/FileNameVirtualFileFilter.java
2008-11-27 16:26:55 UTC (rev 81739)
+++
trunk/server/src/main/org/jboss/deployment/FileNameVirtualFileFilter.java
2008-11-27 16:31:47 UTC (rev 81740)
@@ -58,6 +58,8 @@
*/
public boolean accepts(VirtualFile file)
{
+ boolean trace = log.isTraceEnabled();
+
String pathName = file.getPathName();
for (Map.Entry<String, Set<String>> entry : excludes.entrySet())
{
@@ -68,7 +70,7 @@
Set<String> value = entry.getValue();
if (value == null || value.contains(simpleName))
{
- if (log.isTraceEnabled())
+ if (trace)
log.trace("Excluding " + pathName);
return false;
More information about the jboss-cvs-commits
mailing list