Class TypeVerifier


  • public class TypeVerifier
    extends Object
    Abstract-interpretation type checker for a method body, walking the bytecode to a fixpoint and reporting stack, local and return type errors to a collector.
    • Constructor Detail

      • TypeVerifier

        public TypeVerifier​(ClassFile classFile,
                            ClassPool classPool)
        Creates a verifier for one class.
        Parameters:
        classFile - the class whose methods will be verified, its pool supplies type names
        classPool - the pool used to answer assignability questions
    • Method Detail

      • verify

        public void verify​(MethodEntry method,
                           ErrorCollector collector)
        Type checks a method body, doing nothing if it has no code, no constant pool or no bytecode, or if the code cannot be decoded.
        Parameters:
        method - the method to check
        collector - receives the errors and warnings found, and can stop the walk early