public abstract class ReferenceType extends Type
| Modifier | Constructor and Description |
|---|---|
protected |
ReferenceType(byte t,
String s) |
| Modifier and Type | Method and Description |
|---|---|
ReferenceType |
firstCommonSuperclass(ReferenceType t)
Deprecated.
use getFirstCommonSuperclass(ReferenceType t) which has slightly changed semantics.
|
ReferenceType |
getFirstCommonSuperclass(ReferenceType t)
This commutative operation returns the first common superclass (narrowest ReferenceType referencing a class, not an
interface).
|
boolean |
isAssignmentCompatibleWith(Type t)
Return true iff this is assignment compatible with another type t as defined in the JVM specification; see the
AASTORE definition there.
|
boolean |
isCastableTo(Type t)
Return true iff this type is castable to another type t as defined in the JVM specification.
|
equals, getArgumentTypes, getClassName, getMethodSignature, getReturnType, getSignature, getSignature, getSize, getType, getType, getType, getTypes, hashCode, normalizeForStackOrLocal, toStringprotected ReferenceType(byte t,
String s)
@Deprecated public ReferenceType firstCommonSuperclass(ReferenceType t) throws ClassNotFoundException
Type.OBJECT is returned. If "this" or t is a ReferenceType referencing an
interface, then Type.OBJECT is returned. If not all of the two classes' superclasses cannot be found, "null" is
returned. See the JVM specification edition 2, "�4.9.2 The Bytecode Verifier".ClassNotFoundException - on failure to find superclasses of this type, or the type passed as a parameterpublic ReferenceType getFirstCommonSuperclass(ReferenceType t) throws ClassNotFoundException
Type.OBJECT is returned; unless their dimensions match. Then an ArrayType of the
same number of dimensions is returned, with its basic type being the first common super class of the basic types of
"this" and t. If "this" or t is a ReferenceType referencing an interface, then Type.OBJECT is returned. If not all of
the two classes' superclasses cannot be found, "null" is returned. See the JVM specification edition 2, "�4.9.2 The
Bytecode Verifier".ClassNotFoundException - on failure to find superclasses of this type, or the type passed as a parameterpublic boolean isAssignmentCompatibleWith(Type t) throws ClassNotFoundException
ClassNotFoundException - if any classes or interfaces required to determine assignment compatibility can't be
foundpublic boolean isCastableTo(Type t) throws ClassNotFoundException
Type.NULL is not defined (see the CHECKCAST definition in the JVM specification). However, because e.g. CHECKCAST
doesn't throw a ClassCastException when casting a null reference to any Object, true is returned in this case.ClassNotFoundException - if any classes or interfaces required to determine assignment compatibility can't be
foundCopyright © 2004–2025 The Apache Software Foundation. All rights reserved.