<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div style="margin: 0px;">I was wondering if just adding a new method to the BasicLogger interface could resolve the problem.</div><p style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande'; min-height: 16px;"> <br class="webkit-block-placeholder"></p><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande';"><span style="color: #931a68"><b>void</b></span> debugf(String format, <span style="color: #931a68"><b>Integer</b></span> arg);</div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande';"><span style="color: #931a68"><b>void</b></span> debugf(String format, <span style="color: #931a68"><b>Long</b></span> arg);</div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande'; min-height: 16px;"><br></div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande';">Correct me if I'm wrong, but the problem reported was a collateral effect of the the addition of : </div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande'; min-height: 16px;"><br></div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande';"><span style="color: #931a68"><b> void</b></span> debugf(String format, <span style="color: #931a68"><b>int </b></span>arg);</div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande';"><span style="color: #931a68"><b> void</b></span> debugf(String format, <span style="color: #931a68"><b>long </b></span>arg);</div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande'; min-height: 16px;"><br></div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande';"><a href="https://github.com/jboss-logging/jboss-logging/blob/master/src/main/java/org/jboss/logging/BasicLogger.java">https://github.com/jboss-logging/jboss-logging/blob/master/src/main/java/org/jboss/logging/BasicLogger.java</a></div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande'; min-height: 16px;"><br></div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande';">This was added last September, and with the additions of the Integer and Long types, the autoboxing will resolve our problems, and not cast will be necessary.</div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande'; min-height: 16px;"><br></div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande'; min-height: 16px;"><br></div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande';"><span style="color: #931a68"><b>int</b></span> i = 123;</div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande';">bl.debugf( <span style="color: #3933ff">"Number: %d"</span>, i );</div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande';">>> <span style="color: #931a68"><b>void</b></span> debugf(String format, <span style="color: #931a68"><b>int</b></span> arg);</div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande'; min-height: 16px;"><br></div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande';"><span style="color: #931a68"><b>Integer</b></span> i = 123;</div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande';">bl.debugf( <span style="color: #3933ff">"Number: %d"</span>, i );</div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande';"><span style="color: #931a68"><b>>> void</b></span> debugf(String format, Integer param1);</div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande'; min-height: 16px;"><br></div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande'; min-height: 16px;"><br></div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande';">Object i = <span style="color: #931a68"><b>new</b></span> Integer(123);</div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande';">bl.debugf( <span style="color: #3933ff">"Number: %d"</span>, i );</div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande';">>> <span style="color: #931a68"><b>void</b></span> debugf(String format, Object param1);</div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande'; min-height: 16px;"><br></div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande'; min-height: 16px;">(same thing to Long type)</div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande'; min-height: 16px;"><br></div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande'; min-height: 16px;"><br></div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande';">Since debugf methods are inherited from <span style="font-size: 12px; font-family: Helvetica;">BasicLogger.</span></div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande'; min-height: 16px;"><br></div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande'; min-height: 16px;"><br></div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande'; min-height: 16px;"><br></div><div style="margin: 0px; font-size: 13px; font-family: 'Lucida Grande'; min-height: 16px;"><br></div><div><div>On Feb 27, 2015, at 8:50 PM, James R. Perkins <<a href="mailto:jperkins@redhat.com">jperkins@redhat.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">We faced some odd compile errors with JDK 7 when we switched WildFly <br>Core to 3.2.1.Final. Really the only way to get around it would be to <br>cast int's or long's to their object types. Though that's not really <br>ideal either I realize.<br><br>That said it should be fine in WildFly 9 as we're using 3.2.1.Final now.<br><br>On 02/27/2015 12:08 PM, Sanne Grinovero wrote:<br><blockquote type="cite">Hi all,<br>today I've upgraded jboss-logging from version 3.1.4.GA to 3.2.1.Final<br>in an Hibernate project, and got some integration test failures.<br><br>The surprising aspect is that everything seemed fine at compile level:<br>just switch the version in the pom, and without needing any further<br>changes it compiles fine and runs all unit tests successfully.. but<br>fails when using the freshly built libraries in WildFly 8.2.<br><br>It's not a regression of jboss-logging, but one of its improvements<br>require a bit of attention.<br><br>This is what happened to us:<br>we have some log statements which look like this in source code (after<br>simplifying):<br><br> int i = ...<br> log.debugf( "Number: %d", i );<br><br>This does of course compile fine in both old an new versions of JBoss<br>Logger. And it all works as expected in unit tests.<br>But when deploying the modified version of this Hibernate library in<br>WildFly 8.2, you'd get some of these:<br> - java.lang.NoSuchMethodError:<br>org.hibernate.search.util.logging.impl.Log.debugf(Ljava/lang/String;J)V"}}<br><br>When using the older version of JBoss Logger (at compile time), the<br>above line of code is compiled as an invocation to:<br><br> void debugf(String format, Object param1);<br><br>(which is a method present in both versions)<br><br>When using the new version of JBoss Logger (at compile time), the same<br>line of code is interpreted as the (better) invocation to:<br><br> void debugf(String format, int arg);<br><br>So that's what the library is going to invoke at runtime - and that<br>method doesn't exist in WildFly 8.2.<br><br>Be aware of this when upgrading as it might look like a trivial<br>version bump but it makes it quite hard to guarantee backwards<br>compatibility with older versions of the logger.<br><br>Personally since I want to upgrade the logger but don't want to drop<br>compatibility with existing WildFly releases, I'm trying to figure how<br>to reliably validate that no logging statement is going to invoke one<br>of the new ones.. for now.<br><br>I guess this also means that users won't actually benefit from the<br>better performance of the new logging methods until we recompile all<br>of its client libraries using the new version ;-)<br>Auto-boxing is evil..<br><br>Sanne<br>_______________________________________________<br>wildfly-dev mailing list<br><a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/wildfly-dev<br></blockquote><br>-- <br>James R. Perkins<br>JBoss by Red Hat<br><br>_______________________________________________<br>wildfly-dev mailing list<br><a href="mailto:wildfly-dev@lists.jboss.org">wildfly-dev@lists.jboss.org</a><br>https://lists.jboss.org/mailman/listinfo/wildfly-dev<br></blockquote></div><br></body></html>