fb-contrib
fb-contrib copied to clipboard
Code compiled with target 11 (and not 1.8) does not find all bug warnings
This sample code should find the "LO_APPENDED_STRING_IN_FORMAT_STRING" bug warning :
package sample;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class Sample {
private static final Logger LOG = LogManager.getLogger();
public static void main(final String[] args) {
LOG.error("main args " + args.length); // should raise LO_APPENDED_STRING_IN_FORMAT_STRING bug warning
}
}
And does it, if compiled with target 1.8, but not if compiled with target 11. Tested with JDK 11, 17 and 21.