org.apache.bcel.verifier.statics
Class Pass1Verifier

java.lang.Object
  extended by org.apache.bcel.verifier.PassVerifier
      extended by org.apache.bcel.verifier.statics.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.

Version:
$Id: Pass1Verifier.java 371539 2006-01-23 14:08:00Z tcurdt $
See Also:
do_verify()

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.
 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

Pass1Verifier

public Pass1Verifier(Verifier owner)
Should only be instantiated by a Verifier.

See Also:
Verifier
Method Detail

do_verify

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).

Specified by:
do_verify in class PassVerifier
See Also:
Repository

getMessages

public 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.

Overrides:
getMessages in class PassVerifier
See Also:
PassVerifier.addMessage(String), PassVerifier.do_verify()


Copyright © 2002-2006 Apache Software Foundation. All Rights Reserved.