edu.umd.cs.findbugs.ba.type

Class StandardTypeMerger

public class StandardTypeMerger extends Object implements TypeMerger, Constants, ExtendedTypes

A TypeMerger which applies standard Java semantics when merging Types. Subclasses may override mergeReferenceTypes() in order to implement special typing rules for reference types.

Author: David Hovemeyer

See Also: TypeMerger

Constructor Summary
StandardTypeMerger(RepositoryLookupFailureCallback lookupFailureCallback, ExceptionSetFactory exceptionSetFactory)
Constructor.
Method Summary
protected booleanisIntegerType(byte type)
Determine if the given typecode refers to an Integer type (other than long).
protected booleanisObjectType(byte type)
Determine if the given typecode refers to an Object type.
protected booleanisReferenceType(byte type)
Determine if the given typecode refers to a reference type.
protected TypemergeReferenceTypes(ReferenceType aRef, ReferenceType bRef)
Default implementation of merging reference types.
TypemergeTypes(Type a, Type b)

Constructor Detail

StandardTypeMerger

public StandardTypeMerger(RepositoryLookupFailureCallback lookupFailureCallback, ExceptionSetFactory exceptionSetFactory)
Constructor.

Parameters: lookupFailureCallback object used to report Repository lookup failures exceptionSetFactory factory for creating ExceptionSet objects

Method Detail

isIntegerType

protected boolean isIntegerType(byte type)
Determine if the given typecode refers to an Integer type (other than long). This implementation checks that the type code is T_INT, T_BYTE, T_BOOLEAN, T_CHAR, or T_SHORT. Subclasses should override this if they have defined new integer types with different type codes.

isObjectType

protected boolean isObjectType(byte type)
Determine if the given typecode refers to an Object type. Subclasses should override with any new object types.

isReferenceType

protected boolean isReferenceType(byte type)
Determine if the given typecode refers to a reference type. This implementation just checks that the type code is T_OBJECT, T_ARRAY, T_NULL, or T_EXCEPTION. Subclasses should override this if they have defined new object types with different type codes.

mergeReferenceTypes

protected Type mergeReferenceTypes(ReferenceType aRef, ReferenceType bRef)
Default implementation of merging reference types. This just returns the first common superclass, which is compliant with the JVM Spec. Subclasses may override this method in order to implement extended type rules.

Parameters: aRef a ReferenceType bRef a ReferenceType

Returns: the merged Type

mergeTypes

public Type mergeTypes(Type a, Type b)
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.