equal
deleted
inserted
replaced
76 /* |
76 /* |
77 * For Throwable to use StackWalker, set useNewThrowable to true. |
77 * For Throwable to use StackWalker, set useNewThrowable to true. |
78 * Performance work and extensive testing is needed to replace the |
78 * Performance work and extensive testing is needed to replace the |
79 * VM built-in backtrace filled in Throwable with the StackWalker. |
79 * VM built-in backtrace filled in Throwable with the StackWalker. |
80 */ |
80 */ |
81 final static boolean isDebug = getProperty("stackwalk.debug", false); |
81 final static boolean isDebug = |
|
82 "true".equals(GetPropertyAction.privilegedGetProperty("stackwalk.debug")); |
82 |
83 |
83 static <T> StackFrameTraverser<T> |
84 static <T> StackFrameTraverser<T> |
84 makeStackTraverser(StackWalker walker, Function<? super Stream<StackFrame>, ? extends T> function) |
85 makeStackTraverser(StackWalker walker, Function<? super Stream<StackFrame>, ? extends T> function) |
85 { |
86 { |
86 if (walker.hasLocalsOperandsOption()) |
87 if (walker.hasLocalsOperandsOption()) |
986 return c == Method.class || |
987 return c == Method.class || |
987 MethodAccessor.class.isAssignableFrom(c) || |
988 MethodAccessor.class.isAssignableFrom(c) || |
988 c.getName().startsWith("java.lang.invoke.LambdaForm"); |
989 c.getName().startsWith("java.lang.invoke.LambdaForm"); |
989 } |
990 } |
990 |
991 |
991 private static boolean getProperty(String key, boolean value) { |
|
992 String s = GetPropertyAction.getProperty(key); |
|
993 if (s != null) { |
|
994 return Boolean.parseBoolean(s); |
|
995 } |
|
996 return value; |
|
997 } |
|
998 } |
992 } |