Enum StackTypesValidator

  • All Implemented Interfaces:
    Serializable, Comparable<StackTypesValidator>, BodyValidator, Validator<Body>

    public enum StackTypesValidator
    extends Enum<StackTypesValidator>
    implements BodyValidator
    Checks if the locals and the operand stack will contain the correct types for each instruction in the BafBody. NOTE: This validator assumes that each local will hold a single Type throughout the method. However, that is actually a stronger requirement than necessary for bytecode. In fact, after running the LocalPacker pass, there will likely be cases that are reported by this validator which are actually safe for bytecode.
    Author:
    Timothy Hoffman
    • Method Detail

      • values

        public static StackTypesValidator[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (StackTypesValidator c : StackTypesValidator.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static StackTypesValidator valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • isBasicValidator

        public boolean isBasicValidator()
        Description copied from interface: BodyValidator
        Basic validators run essential checks and are run always if validate is called.
        If this method returns false and the caller of the validator respects this property,
        the checks will only be run if the debug or validation option is activated.
        Specified by:
        isBasicValidator in interface BodyValidator
        Specified by:
        isBasicValidator in interface Validator<Body>
        Returns:
        whether this validator is a basic validator