[ 
https://issues.apache.org/jira/browse/LOG4J2-2561?focusedWorklogId=206789&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-206789
 ]

ASF GitHub Bot logged work on LOG4J2-2561:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 02/Mar/19 21:00
            Start Date: 02/Mar/19 21:00
    Worklog Time Spent: 10m 
      Work Description: rgoers 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_r261841957
 
 

 ##########
 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:
   Personally, I dislike checking for versions. I much prefer checking for 
features. But seeing that this was already implemented I wouldn't expect you to 
change that.
   
   I am a bit confused by your question though. It looks like Constants has a 
getMajorVersion method that has the same problem. I would recommend you just 
fix that and then have AbstractStringLayout reference 
Constants.JAVA_MAJOR_VERSION. I don't know why you would need to move it from 
the API to core.
 
----------------------------------------------------------------
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: 206789)
    Time Spent: 1h 20m  (was: 1h 10m)

> 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: 1h 20m
>  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)

Reply via email to