SHOW_HIDDEN_FRAMES

Finally the enum constant option, SHOW_HIDDEN_FRAMES will include all the hidden frames, which contain reflective calls as well as call frames that are generated for lambda function calls.

Here is a simple demonstration of reflective and hidden frames:

    package packt; 
    import static java.lang.StackWalker.Option.SHOW_HIDDEN_FRAMES; 
    import static java.lang.StackWalker.Option.SHOW_REFLECT_FRAMES; 
    public class Main { 

The main method allowing us to execute this code directly calls the method simpleCall():

    public static void main(String[] args) { 
      simpleCall(); 
    } 

The method simpleCall() simply calls on as the name suggests:

    static void simpleCall() { 
      reflectCall(); 
    } 

The next method in the chain is a bit more complex. Although ...

Get Mastering Java 9 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.