Class VarInitializationVerifier


  • public class VarInitializationVerifier
    extends Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean doStatementsTerminate​(List<? extends IStatement> statements)  
      static void verifyFinalFields​(IGosuClass gsClass)
      Verifies initialization of final fields in the provided class and, recursively, all nested inner classes: Verifies that a final field is fully initialized either in the declaration or in the constructor[s] Verifies that an assignment to a final field is mutually exclusive wrt other assignments to the field Verifies that a reference to a final field is in a position in the source where the final field is fully initialized
      static void verifyLocalVars​(IGosuClass gsClass, boolean bFinalOnly)
      Verifies initialization of local vars in the provided class and, recursively, all nested inner classes: Verifies that a final local var is fully initialized either in the declaration or in the scope of the var Verifies that an assignment to a final local var is mutually exclusive wrt other assignments to the var Verifies that a reference to any local var, not just finals, is in a position in the source where the var is fully initialized
    • Method Detail

      • verifyFinalFields

        public static void verifyFinalFields​(IGosuClass gsClass)
        Verifies initialization of final fields in the provided class and, recursively, all nested inner classes:
        1. Verifies that a final field is fully initialized either in the declaration or in the constructor[s]
        2. Verifies that an assignment to a final field is mutually exclusive wrt other assignments to the field
        3. Verifies that a reference to a final field is in a position in the source where the final field is fully initialized
      • verifyLocalVars

        public static void verifyLocalVars​(IGosuClass gsClass,
                                           boolean bFinalOnly)
        Verifies initialization of local vars in the provided class and, recursively, all nested inner classes:
        1. Verifies that a final local var is fully initialized either in the declaration or in the scope of the var
        2. Verifies that an assignment to a final local var is mutually exclusive wrt other assignments to the var
        3. Verifies that a reference to any local var, not just finals, is in a position in the source where the var is fully initialized
      • doStatementsTerminate

        public static boolean doStatementsTerminate​(List<? extends IStatement> statements)