jdk/src/java.base/share/classes/java/lang/StackStreamFactory.java
changeset 37781 71ed5645f17c
parent 37593 824750ada3d6
child 37819 8a2559d6fe5b
equal deleted inserted replaced
37780:06f3783b338f 37781:71ed5645f17c
    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 }