[
https://issues.apache.org/jira/browse/LOG4J2-2561?focusedWorklogId=206722&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-206722
]
ASF GitHub Bot logged work on LOG4J2-2561:
------------------------------------------
Author: ASF GitHub Bot
Created on: 02/Mar/19 12:55
Start Date: 02/Mar/19 12:55
Worklog Time Spent: 10m
Work Description: cakofony commented on pull request #260: [LOG4J2-2561]
JEP223 version detection fix for JDK 9 and up
URL: https://github.com/apache/logging-log4j2/pull/260#discussion_r261825957
##########
File path:
log4j-core/src/main/java/org/apache/logging/log4j/core/layout/AbstractStringLayout.java
##########
@@ -134,7 +134,13 @@ private static boolean isPreJava8() {
final String version = System.getProperty("java.version");
Review comment:
Can we make this method delegate to a package-private `static boolean
isPreJava8(String javaVersion)` which we can invoke directly from the test? The
reflective method is likely to cause failures if we refactor this code in the
future, and setting the `java.version` system property may have other
consequences which I'd prefer to avoid.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 206722)
Time Spent: 50m (was: 40m)
> In log4j-core AbstractStringLayout java version detection is not JEP223
> compatible
> ----------------------------------------------------------------------------------
>
> Key: LOG4J2-2561
> URL: https://issues.apache.org/jira/browse/LOG4J2-2561
> Project: Log4j 2
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.11.2
> Reporter: Ulrich Enslin
> Priority: Major
> Labels: easyfix, pull-request-available
> Time Spent: 50m
> Remaining Estimate: 0h
>
> The function isPreJava8() will detect java 9 and higher as being pre java 8,
> because the logic does not take JEP223 into account.
>
> The same logic is correct in
> org.apache.logging.log4j.util.Constants#getMajorVersion, so simply modified
> the logic in AbstractStringLayout to work the same in the PR.
>
> This seems like a small change, but it prevents log4j from being JDK 9 and up
> compatible.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)