Verification ensures that the binary representation of a class or interface is structurally correct. For example, it checks that every instruction has a valid operation code; that every branch instruction branches to the start of some other instruction, rather than into the middle of an instruction; that every method is provided with a structurally correct signature; and that every instruction obeys the type discipline of the Java language.
For a more detailed description of the verification process, see the separate volume of this series, The Java Virtual Machine Specification.
If an error occurs during verification, then an instance of the following subclass of class LinkageError
will be thrown at the point in the Java program that caused the class to be verified:
VerifyError
: The binary definition for a class or interface failed to pass a set of required checks to verify that it obeys the semantics of the Java language and that it cannot violate the integrity of the Java Virtual Machine. (See §13.4.2, §13.4.4, §13.4.8, and §13.4.16 for some examples.)