You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@logging.apache.org by Filipp Gunbin <fg...@fastmail.fm> on 2019/06/19 19:30:47 UTC

Wrong java.version check in ThreadNameCachingStrategy?

Hi, I see this in ThreadNameCachingStrategy.java:

final String defaultStrategy = System.getProperty("java.version").compareTo("1.8.0_102") < 0
        ? "CACHED" // LOG4J2-2052 JDK 8u102 removed the String allocation in Thread.getName()
        : "UNCACHED";

This doesn't look right because java.version of, say, "1.8.0_77"
compares greater than "1.8.0_102" lexicographically.  This is why I have
failed tests when trying to build log4j-core.

Please CC me in replies as I'm not subscribed.

Thanks.
Filipp