bcel API: Class Pass1Verifier

Class Pass1Verifier


public final class Pass1Verifier
extends PassVerifier

This PassVerifier verifies a class file according to pass 1 as described in The Java Virtual Machine Specification, 2nd edition. More detailed information is to be found at the do_verify() method's documentation.

$Id: Pass1Verifier.java,v 2001/10/29 20:00:35 jvanzyl Exp $
Enver Haase
See Also:

Constructor Summary
Pass1Verifier(Verifier owner)
          Should only be instantiated by a Verifier.
Method Summary
 VerificationResult do_verify()
          Pass-one verification basically means loading in a class file.
 java.lang.String[] getMessages()
          Currently this returns an empty array of String.
Methods inherited from class org.apache.bcel.verifier.PassVerifier
addMessage, verify
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public Pass1Verifier(Verifier owner)
Should only be instantiated by a Verifier.
See Also:
Method Detail


public VerificationResult do_verify()
Pass-one verification basically means loading in a class file. The Java Virtual Machine Specification is not too precise about what makes the difference between passes one and two. The answer is that only pass one is performed on a class file as long as its resolution is not requested; whereas pass two and pass three are performed during the resolution process. Only four constraints to be checked are explicitely stated by The Java Virtual Machine Specification, 2nd edition: A more in-depth documentation of what pass one should do was written by Philip W. L. Fong: (From the Paper The Mysterious Pass One, first draft, September 2, 1997.)
However, most of this is done by parsing a class file or generating a class file into BCEL's internal data structure. Therefore, all that is really done here is look up the class file from BCEL's repository. This is also motivated by the fact that some omitted things (like the check for extra bytes at the end of the class file) are handy when actually using BCEL to repair a class file (otherwise you would not be able to load it into BCEL).
do_verify in class PassVerifier
See Also:


public java.lang.String[] getMessages()
Currently this returns an empty array of String. One could parse the error messages of BCEL (written to java.lang.System.err) when loading a class file such as detecting unknown attributes or trailing garbage at the end of a class file. However, Markus Dahm does not like the idea so this method is currently useless and therefore marked as TODO.
getMessages in class PassVerifier
Following copied from class: org.apache.bcel.verifier.PassVerifier
See Also:
PassVerifier.addMessage(String), PassVerifier.do_verify()