GitHub user jasontedor opened a pull request:

    https://github.com/apache/logging-log4j2/pull/109

    Fix stack locator calc location on JDK 9

    This commit fixes a bug in StackLocator#calcLocation on JDK 9. The
    particular issue here is that on JDK 9, all stack trace locations report
    as line 71 of StackLocatorUtil. This is due to a bug in the JDK 9
    implementation of StackLocator. The bug is that instead of dropping the
    top frames of the stack until the first frame that matches the
    fully-qualified class name of the logger, the implementation would drop
    all frames from the top that match the fully-qualified class name of the
    logger. Of course, at this point in the stack trace, there would be
    none. The fix is to reverse the condition, that we drop all frames until
    we reach a frame matching the fully-qualified class name of the
    logger. This commit also adds a test that was broken before this change
    and now passes.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jasontedor/logging-log4j2 
java-9-stack-locator-calc-location

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/logging-log4j2/pull/109.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #109
    
----
commit f87c6d11da8da299757eb582a16e7227a33a7b4b
Author: Jason Tedor <[email protected]>
Date:   2017-09-01T15:26:18Z

    Fix stack locator calc location on JDK 9
    
    This commit fixes a bug in StackLocator#calcLocation on JDK 9. The
    particular issue here is that on JDK 9, all stack trace locations report
    as line 71 of StackLocatorUtil. This is due to a bug in the JDK 9
    implementation of StackLocator. The bug is that instead of dropping the
    top frames of the stack until the first frame that matches the
    fully-qualified class name of the logger, the implementation would drop
    all frames from the top that match the fully-qualified class name of the
    logger. Of course, at this point in the stack trace, there would be
    none. The fix is to reverse the condition, that we drop all frames until
    we reach a frame matching the fully-qualified class name of the
    logger. This commit also adds a test that was broken before this change
    and now passes.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to