[jboss-dev] Braindead logging WAS [Fwd: [jboss-cvs] JBossAS SVN: r81764 - trunk/server/src/main/org/jboss/deployment.]

Ales Justin ales.justin at gmail.com
Fri Nov 28 08:04:23 EST 2008


Did you even check if it's a loop? ;-)

Like I already wrote you:
  * your code always does it - once per deploy(DU) invocation
  * my code _only_ does it _if_ deployment matches something from the 
list, then it calls 'return'

And the last time I checked return breaks out of a loop. ;-)
But I'm all ears on how your code is more efficient.

Adrian Brock wrote:
> Why? Do you know how inefficient it is to invoke
> isXXXEnabled() inside a loop?
> 
> This thing gets invoked for every file/subdeployment
> that gets deployed and for each one iterates over a big list
> of things to ignore.
> 
> -------- Forwarded Message --------
> From: jboss-cvs-commits at lists.jboss.org
> Reply-To: jboss-cvs-commits at lists.jboss.org
> To: jboss-cvs-commits at lists.jboss.org
> Subject: [jboss-cvs] JBossAS SVN: r81764 -
> trunk/server/src/main/org/jboss/deployment.
> Date: Fri, 28 Nov 2008 06:50:47 -0500
> 
> Author: alesj
> Date: 2008-11-28 06:50:46 -0500 (Fri, 28 Nov 2008)
> New Revision: 81764
> 
> Modified:
>    trunk/server/src/main/org/jboss/deployment/FileNameVirtualFileFilter.java
> Log:
> Undo Adrian's 'fix'.
> 
> Modified: trunk/server/src/main/org/jboss/deployment/FileNameVirtualFileFilter.java
> ===================================================================
> --- trunk/server/src/main/org/jboss/deployment/FileNameVirtualFileFilter.java	2008-11-28 10:55:58 UTC (rev 81763)
> +++ trunk/server/src/main/org/jboss/deployment/FileNameVirtualFileFilter.java	2008-11-28 11:50:46 UTC (rev 81764)
> @@ -58,8 +58,6 @@
>      */
>     public boolean accepts(VirtualFile file)
>     {
> -      boolean trace = log.isTraceEnabled();
> -      
>        String pathName = file.getPathName();
>        for (Map.Entry<String, Set<String>> entry : excludes.entrySet())
>        {
> @@ -70,7 +68,7 @@
>              Set<String> value = entry.getValue();
>              if (value == null || value.contains(simpleName))
>              {
> -               if (trace)
> +               if (log.isTraceEnabled())
>                    log.trace("Excluding " + pathName);
>                 
>                 return false;
> 
> _______________________________________________
> jboss-cvs-commits mailing list
> jboss-cvs-commits at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-cvs-commits



More information about the jboss-development mailing list