[infinispan-dev] Reminder on trickiness for guarding against log trace

Manik Surtani manik at jboss.org
Thu Feb 23 09:06:23 EST 2012


Not just boxing, but even unnecessary array creation.  Since tracef does have an overloaded signature of tracef(String fmt, Object… params)

So please do consider if (trace).  :)

On 22 Feb 2012, at 19:16, Sanne Grinovero wrote:

> It's easy to be fooled by the nice looking tracef API; can you see
> what's wrong with the next method?
> 
> log.tracef("%s: Committing view %s", cacheName, viewId);
> 
> 
> [solution below]
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> The signature for such a tracef method is
> tracef(String format, Object param1, Object param2);
> so integers, booleans, etcetera.. will be boxed into objects.
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Manik Surtani
manik at jboss.org
twitter.com/maniksurtani

Lead, Infinispan
http://www.infinispan.org






More information about the infinispan-dev mailing list