[slf4j-dev] slf4j First day, null fix

Joe Gooch mrwizard at k12system.com
Sun Sep 2 03:07:50 CEST 2007


So, it's my first day using slf4j, and I think it's great!  The message
formatter is wonderful and it's very simple to use.

However, I find with a message like this:

ComplexObject j;
logger.warn("This is my format {}", j);

I'm relying on MessageFormat to show a null intelligently. (Which
StringBuffer seems apt to do)  However, in this case, it appears when
running on JRE 1.6.0 b2, that the compiler thinks that a null j is
actually an Object[] instead of an Object, which means MessageFormat
gets a null array instead of a null object.

The fix is attached.

Thanks!

Joseph Gooch
Sapphire Suite Product Manager
K12 Systems, Inc.
(866) 366-9540

-------------- next part --------------
A non-text attachment was scrubbed...
Name: slf4j_messageFormat_fix.patch
Type: application/octet-stream
Size: 634 bytes
Desc: slf4j_messageFormat_fix.patch
URL: <http://qos.ch/pipermail/slf4j-dev/attachments/20070901/ef2d59fa/attachment.obj>


More information about the slf4j-dev mailing list