Top Description Inners Fields Constructors Methods
org.apache.bcel.verifier.statics

public final Class Pass2Verifier

extends PassVerifier
implements Constants
Class Inheritance
All Implemented Interfaces
org.apache.bcel.Constants
Imports
java.util.HashMap, .HashSet, .Locale, .Map, .Objects, .Set, org.apache.bcel.Const, .Constants, .Repository, org.apache.bcel.classfile.Attribute, .ClassFormatException, .Code, .CodeException, .Constant, .ConstantClass, .ConstantDouble, .ConstantFieldref, .ConstantFloat, .ConstantInteger, .ConstantInterfaceMethodref, .ConstantLong, .ConstantMethodref, .ConstantNameAndType, .ConstantPool, .ConstantString, .ConstantUtf8, .ConstantValue, .Deprecated, .DescendingVisitor, .EmptyVisitor, .ExceptionTable, .Field, .InnerClass, .InnerClasses, .JavaClass, .LineNumber, .LineNumberTable, .LocalVariable, .LocalVariableTable, .Method, .Node, .SourceFile, .Synthetic, .Unknown, .Utility, org.apache.bcel.generic.ArrayType, .ObjectType, .Type, org.apache.bcel.verifier.PassVerifier, .VerificationResult, .Verifier, .VerifierFactory, org.apache.bcel.verifier.exc.AssertionViolatedException, .ClassConstraintException, .LocalVariableInfoInconsistentException

Deprecated

as a consequence of Constants being deprecated. See corresponding docs for further information.

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
Pass2Verifier.CPESSC_Visitor

A Visitor class that ensures the constant pool satisfies the static constraints.

private class
Pass2Verifier.FAMRAV_Visitor

A Visitor class that ensures the ConstantCP-subclassed entries of the constant pool are valid.

private static class
Pass2Verifier.InnerClassDetector

This class serves for finding out if a given JavaClass' ConstantPool references an Inner Class.

Field Summary

Modifier and TypeField and Description
private LocalVariablesInfo[]
localVariablesInfos

The LocalVariableInfo instances used by Pass3bVerifier.

private final Verifier
verifier

The Verifier that created this.

Constructor Summary

AccessConstructor and Description
public
Pass2Verifier(final Verifier verifier)

Should only be instantiated by a Verifier.

Method Summary

Modifier and TypeMethod and Description
private void
constantPoolEntriesSatisfyStaticConstraints()

Ensures that the constant pool entries satisfy the static constraints as described in The Java Virtual Machine Specification, 2nd Edition.

public VerificationResult
do_verify()

Implements abstract org.apache.bcel.verifier.PassVerifier.do_verify.

Pass 2 is the pass where static properties of the class file are checked without looking into "Code" arrays of methods.
private void
everyClassHasAnAccessibleSuperclass()

Ensures that every class has a super class and that final classes are not subclassed.

private void
fieldAndMethodRefsAreValid()

Ensures that the ConstantCP-subclassed entries of the constant pool are valid.

private void
finalMethodsAreNotOverridden()

Ensures that final methods are not overridden.

public LocalVariablesInfo
getLocalVariablesInfo(final int methodNr)

Returns a LocalVariablesInfo object containing information about the usage of the local variables in the Code attribute of the said method or null if the class file this Pass2Verifier operates on could not be pass-2-verified correctly.

private static String
tostring(final Node n)

This method is here to save typing work and improve code readability.

private static boolean
validClassMethodName(final String name)

This method returns true if and only if the supplied String represents a valid method name that may be referenced by ConstantMethodref objects.

private static boolean
validClassName(final String name)

This method returns true if and only if the supplied String represents a valid Java class name.

private static boolean
validFieldName(final String name)

This method returns true if and only if the supplied String represents a valid Java field name.

private static boolean
validInterfaceMethodName(final String name)

This method returns true if and only if the supplied String represents a valid Java interface method name that may be referenced by ConstantInterfaceMethodref objects.

private static boolean
validJavaIdentifier(final String name)

This method returns true if and only if the supplied String represents a valid Java identifier (so-called simple or unqualified name).

private static boolean
validJavaLangMethodName(final String name)

This method returns true if and only if the supplied String represents a valid Java programming language method name stored as a simple (non-qualified) name.

private static boolean
validMethodName(final String name, final boolean allowStaticInit)

This method returns true if and only if the supplied String represents a valid method name.

Inherited from org.apache.bcel.verifier.PassVerifier:
addMessagegetMessagesgetMessagesListverify