Class Scope


  • public class Scope
    extends java.lang.Object
    Utility class to keep track of "logical" stack traces, which we can use to print better error reports.
    • Constructor Summary

      Constructors 
      Constructor Description
      Scope()  
    • Constructor Detail

      • Scope

        public Scope()
    • Method Detail

      • enter

        public static void enter​(Location location)
      • enter

        public static void enter​(ScopeProvider scopeProvider)
      • exit

        public static void exit()
      • registerError

        public static void registerError​(java.lang.String msg,
                                         ScopeProvider... scopeProviders)
        Convenience method to add an error in a known list of scopes, w/o adding try catch flows.

        This code actually starts entering the given scopes 1 by 1, starting from 0. When list is consumed, it creates the exception and defers if possible then exits from the provided scopes.

        Note that these scopes are added on top of the already existing scopes.

        Parameters:
        msg - The exception message
        scopeProviders - The list of additional scope providers to enter. Null scopes are automatically ignored.
      • assertNoError

        public static void assertNoError()