BCEL's class file verifier "JustIce"

de.fub.bytecode.verifier.statics
Class Pass1Verifier

java.lang.Object
  |
  +--de.fub.bytecode.verifier.PassVerifier
        |
        +--de.fub.bytecode.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,v 1.21 2001/08/30 08:45:42 ehaase Exp $
Author:
Enver Haase
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.
 java.lang.String[] getMessages()
          Currently this returns an empty array of String.
 
Methods inherited from class de.fub.bytecode.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).
Overrides:
do_verify in class PassVerifier
See Also:
Repository

getMessages

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.
Overrides:
getMessages in class PassVerifier
Following copied from class: de.fub.bytecode.verifier.PassVerifier
See Also:
PassVerifier.addMessage(String), PassVerifier.do_verify()

(c) Enver Haase 2001, released under the FSF's "GPL version 2" license.