You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2019/12/07 07:07:00 UTC

[jira] [Commented] (LOG4J2-2635) Wrong java.version check in ThreadNameCachingStrategy

    [ https://issues.apache.org/jira/browse/LOG4J2-2635?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16990376#comment-16990376 ] 

ASF subversion and git services commented on LOG4J2-2635:
---------------------------------------------------------

Commit e5cf573900cdd89b9f6cbcf7bc1e11088a1f9075 in logging-log4j2's branch refs/heads/master from Ralph Goers
[ https://gitbox.apache.org/repos/asf?p=logging-log4j2.git;h=e5cf573 ]

LOG4J2-2635 - Wrong java version check in ThreadNameCachingStrategy


> Wrong java.version check in ThreadNameCachingStrategy
> -----------------------------------------------------
>
>                 Key: LOG4J2-2635
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2635
>             Project: Log4j 2
>          Issue Type: Bug
>            Reporter: Filipp Gunbin
>            Priority: Major
>
> I see this in ThreadNameCachingStrategy.java:
> {code: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";{code}
> 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.
> Similar check is also present in AsyncLoggerThreadNameStrategyTest.java.
> This was initially added in https://issues.apache.org/jira/browse/LOG4J2-2052
> [posted this on dev mailing list first, but got no response, so creating issue here]



--
This message was sent by Atlassian Jira
(v8.3.4#803005)