[8u] RFR 8253932: SSL debug log prints incorrect caller info

Hohensee, Paul hohensee at amazon.com
Wed Oct 28 19:22:02 UTC 2020


Hi, Alexey,

The JDK 11 code is

        private static String formatCaller() {
            return StackWalker.getInstance().walk(s ->
                s.dropWhile(f ->
                    f.getClassName().startsWith("sun.security.ssl.SSLLogger") ||
                    f.getClassName().startsWith("java.lang.System"))
                .map(f -> f.getFileName() + ":" + f.getLineNumber())
                .findFirst().orElse("unknown caller"));
        }

While replacing "sun.security.ssl.SSLLogger" with SSLLogger.class.getName() looks like it doesn't change the semantics of the sub-expression, replacing "java.lang.System" with Logger.class.getName() looks like it does. Maybe add Logger.class.getName() rather than replacing "java.lang.System"?

I didn't review the TLS 1.3 backport, so if the above doesn't make sense, please excuse my ignorance. :)

Thanks,
Paul

On 10/2/20, 6:19 AM, "jdk8u-dev on behalf of Alexey Bakhtin" <jdk8u-dev-retn at openjdk.java.net on behalf of alexey at azul.com> wrote:

    Hi All,

    Please review small fix for SSL debug logger caused by JDK-8245466

    JBS: https://bugs.openjdk.java.net/browse/JDK-8253932
    Webrev: http://cr.openjdk.java.net/~abakhtin/8253932/webrev.v0/

    Regards
    Alexey




More information about the jdk8u-dev mailing list