It definitely unnecessary code, so I think a bug-report is a good idea. <br><br><div class="gmail_quote">2013/1/10 Maarten Bosteels <span dir="ltr"><<a href="mailto:mbosteels.dns@gmail.com" target="_blank">mbosteels.dns@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<div><br></div><div><a href="https://github.com/qos-ch/slf4j/blob/master/jul-to-slf4j/src/main/java/org/slf4j/bridge/SLF4JBridgeHandler.java#L283" target="_blank">https://github.com/qos-ch/slf4j/blob/master/jul-to-slf4j/src/main/java/org/slf4j/bridge/SLF4JBridgeHandler.java#L283</a></div>
<div><br></div><div><br></div><div><pre style="margin-top:0px;margin-bottom:0px;padding:0px;border:0px"><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px">
<span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic"> </span></div><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px;background-color:rgb(255,255,204)">
<span style="margin:0px;padding:0px;border:0px;font-weight:bold">public</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(68,85,136);font-weight:bold">void</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,0,0);font-weight:bold">publish</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">(</span><span style="margin:0px;padding:0px;border:0px">LogRecord</span> <span style="margin:0px;padding:0px;border:0px">record</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">{</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">// Silently ignore null records.</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">(</span><span style="margin:0px;padding:0px;border:0px">record</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">null</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">{</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">return</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">;</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">}</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"><br></div><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px">
<span style="margin:0px;padding:0px;border:0px">Logger</span> <span style="margin:0px;padding:0px;border:0px">slf4jLogger</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">getSLF4JLogger</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">(</span><span style="margin:0px;padding:0px;border:0px">record</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">);</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"> <span style="margin:0px;padding:0px;border:0px">String</span> <span style="margin:0px;padding:0px;border:0px">message</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px">record</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">.</span><span style="margin:0px;padding:0px;border:0px;color:rgb(0,128,128)">getMessage</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">();</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">// can be null!</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">// this is a check to avoid calling the underlying logging system</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">// with a null message. While it is legitimate to invoke j.u.l. with</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">// a null message, other logging frameworks do not support this.</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"> <span style="margin:0px;padding:0px;border:0px;color:rgb(153,153,136);font-style:italic">// see also <a href="http://bugzilla.slf4j.org/show_bug.cgi?id=108" target="_blank">http://bugzilla.slf4j.org/show_bug.cgi?id=108</a></span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">(</span><span style="margin:0px;padding:0px;border:0px">message</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">==</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">null</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">{</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"> <span style="margin:0px;padding:0px;border:0px">message</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">=</span> <span style="margin:0px;padding:0px;border:0px;color:rgb(221,17,68)">""</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">;</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">}</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">if</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">(</span><span style="margin:0px;padding:0px;border:0px">slf4jLogger</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">instanceof</span> <span style="margin:0px;padding:0px;border:0px">LocationAwareLogger</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">)</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">{</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"> <span style="margin:0px;padding:0px;border:0px">callLocationAwareLogger</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">((</span><span style="margin:0px;padding:0px;border:0px">LocationAwareLogger</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">)</span> <span style="margin:0px;padding:0px;border:0px">slf4jLogger</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">,</span> <span style="margin:0px;padding:0px;border:0px">record</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">);</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">}</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">else</span> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">{</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"> <span style="margin:0px;padding:0px;border:0px">callPlainSLF4JLogger</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">(</span><span style="margin:0px;padding:0px;border:0px">slf4jLogger</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">,</span> <span style="margin:0px;padding:0px;border:0px">record</span><span style="margin:0px;padding:0px;border:0px;font-weight:bold">);</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">}</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"> <span style="margin:0px;padding:0px;border:0px;font-weight:bold">}</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold"><br>
</span></div><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px;font-weight:bold"><br>
</span></div><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px">I don't understand the point of changing the local variable message to the empty string since that local variable is not used afterwards.</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px">Shouldn't this be like this :</div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px;margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px"><br>
</span></div><div style="margin:0px;padding:0px 0px 0px 10px;border:0px"><span style="margin:0px;padding:0px;border:0px"><font color="#333333" face="Consolas, Liberation Mono, Courier, monospace"><span style="font-size:12px;line-height:16px"> if (message == null) {
record.setMessage("");
}
</span></font></span></div><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px"><span style="margin:0px;padding:0px;border:0px"><br></span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px"><span style="margin:0px;padding:0px;border:0px">Should a file a bug ?</span></div>
<div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px"><span style="margin:0px;padding:0px;border:0px"><br></span></div><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px">
Best regards</div><span class="HOEnZb"><font color="#888888"><div style="color:rgb(51,51,51);font-family:Consolas,'Liberation Mono',Courier,monospace;font-size:12px;line-height:16px">Maarten</div></font></span></pre>
</div>
<br>_______________________________________________<br>
slf4j-user mailing list<br>
<a href="mailto:slf4j-user@qos.ch">slf4j-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/slf4j-user" target="_blank">http://mailman.qos.ch/mailman/listinfo/slf4j-user</a><br></blockquote></div><br>