提交 32f3be23 编写于 作者: L lbourges

8144526: Remove Marlin logging use of deleted internal API

Reviewed-by: phh, andrew
上级 f3f387ed
......@@ -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 {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册