From 32f3be236cf1c0a8daf4776d34dd40cebc4f5372 Mon Sep 17 00:00:00 2001 From: lbourges Date: Thu, 27 Feb 2020 06:19:54 +0000 Subject: [PATCH] 8144526: Remove Marlin logging use of deleted internal API Reviewed-by: phh, andrew --- .../sun/java2d/marlin/MarlinUtils.java | 27 ------------------- 1 file changed, 27 deletions(-) diff --git a/src/share/classes/sun/java2d/marlin/MarlinUtils.java b/src/share/classes/sun/java2d/marlin/MarlinUtils.java index 95cd30ac7..d218d06f5 100644 --- a/src/share/classes/sun/java2d/marlin/MarlinUtils.java +++ b/src/share/classes/sun/java2d/marlin/MarlinUtils.java @@ -25,8 +25,6 @@ package sun.java2d.marlin; -import sun.misc.JavaLangAccess; -import sun.misc.SharedSecrets; public final class MarlinUtils { // TODO: use sun.util.logging.PlatformLogger once in JDK9 @@ -70,31 +68,6 @@ public final class MarlinUtils { String sourceClassName = null; String sourceMethodName = null; - JavaLangAccess access = SharedSecrets.getJavaLangAccess(); - Throwable throwable = new Throwable(); - int depth = access.getStackTraceDepth(throwable); - - boolean lookingForClassName = true; - for (int ix = 0; ix < depth; ix++) { - // Calling getStackTraceElement directly prevents the VM - // from paying the cost of building the entire stack frame. - StackTraceElement frame = access.getStackTraceElement(throwable, ix); - String cname = frame.getClassName(); - if (lookingForClassName) { - // Skip all frames until we have found the first frame having the class name. - if (cname.equals(className)) { - lookingForClassName = false; - } - } else { - if (!cname.equals(className)) { - // We've found the relevant frame. - sourceClassName = cname; - sourceMethodName = frame.getMethodName(); - break; - } - } - } - if (sourceClassName != null) { return sourceClassName + " " + sourceMethodName; } else { -- GitLab