Package org.glassfish.rmic.tools.java
Class MemberDefinition
- java.lang.Object
-
- org.glassfish.rmic.tools.java.MemberDefinition
-
- All Implemented Interfaces:
Constants
,RuntimeConstants
- Direct Known Subclasses:
AsmMemberDefinition
,BinaryMember
,LocalMember
,SourceMember
public class MemberDefinition extends java.lang.Object implements Constants
This class defines a member of a Java class: a variable, a method, or an inner class. WARNING: The contents of this source file are not part of any supported API. Code that depends on them does so at its own risk: they are subject to change or removal without notice.
-
-
Field Summary
Fields Modifier and Type Field Description protected MemberDefinition
accessPeer
protected ClassDefinition
clazz
protected java.lang.String
documentation
protected ClassDeclaration[]
exp
protected IdentifierToken[]
expIds
protected ClassDefinition
innerClass
protected int
modifiers
protected Identifier
name
protected MemberDefinition
nextMatch
protected MemberDefinition
nextMember
(package private) static int
PACKAGE_ACCESS
(package private) static int
PRIVATE_ACCESS
(package private) static int
PROTECTED_ACCESS
private static java.util.Map<java.lang.String,MemberDefinition>
proxyCache
A cache of previously created proxy members.(package private) static int
PUBLIC_ACCESS
Constants used by getAccessLevel() to represent the access modifiers as numbers.protected boolean
superAccessMethod
protected Type
type
protected Node
value
protected long
where
-
Fields inherited from interface org.glassfish.rmic.tools.java.Constants
ABSTRACT, ACCM_CLASS, ACCM_FIELD, ACCM_INNERCLASS, ACCM_MEMBER, ACCM_METHOD, ADD, AND, ARRAY, ARRAYACCESS, ASGADD, ASGBITAND, ASGBITOR, ASGBITXOR, ASGDIV, ASGLSHIFT, ASGMUL, ASGREM, ASGRSHIFT, ASGSUB, ASGURSHIFT, ASSIGN, ATT_ALL, ATT_ALLCLASSES, ATT_CODE, BITAND, BITNOT, BITOR, BITXOR, BOOLEAN, BOOLEANVAL, BREAK, BYTE, BYTEVAL, CASE, CAST, CATCH, CHAR, CHARVAL, CLASS, COLON, COMMA, COMMENT, COND, CONST, CONTINUE, CONVERT, CS_BINARY, CS_CHECKED, CS_COMPILED, CS_NOTFOUND, CS_PARSED, CS_SOURCE, CS_UNDECIDED, CS_UNDEFINED, CT_BLOCK, CT_BRANCH_FALSE, CT_BRANCH_TRUE, CT_CASE, CT_FIKT_METHOD, CT_FIKT_RET, CT_FIRST_KIND, CT_LAST_KIND, CT_METHOD, CT_SWITH_WO_DEF, DEC, DECLARATION, DEFAULT, DIV, DO, DOUBLE, DOUBLEVAL, ELSE, EQ, ERROR, EXPR, EXPRESSION, EXTENDS, F_COVDATA, F_COVERAGE, F_DEBUG_LINES, F_DEBUG_SOURCE, F_DEBUG_VARS, F_DEPENDENCIES, F_DEPRECATION, F_DUMP, F_ERRORSREPORTED, F_OPT, F_OPT_INTERCLASS, F_PRINT_DEPENDENCIES, F_STRICTDEFAULT, F_VERBOSE, F_VERSION12, F_WARNINGS, FALSE, FIELD, FINAL, FINALLY, FLOAT, FLOATVAL, FOR, GE, GOTO, GT, idAppend, idClass, idClassInit, idClone, idCode, idConstantValue, idCoverageTable, idDeprecated, idDocumentation, IDENT, idExceptions, idFinallyReturnValue, idGetClass, idInit, idInnerClasses, idJavaIoSerializable, idJavaLang, idJavaLangClass, idJavaLangCloneable, idJavaLangError, idJavaLangException, idJavaLangObject, idJavaLangRuntimeException, idJavaLangString, idJavaLangStringBuffer, idJavaLangThrowable, idLength, idLineNumberTable, idLocalVariableTable, idNew, idNull, idSourceFile, idStar, idSuper, idSynthetic, idThis, idToString, idTYPE, idValueOf, IF, IMPLEMENTS, IMPORT, INC, INLINEMETHOD, INLINENEWINSTANCE, INLINERETURN, INSTANCEOF, INT, INTERFACE, INTVAL, LBRACE, LE, LENGTH, LONG, LONGVAL, LPAREN, LSHIFT, LSQBRACKET, LT, M_ABSTRACT, M_ANONYMOUS, M_DEPRECATED, M_FINAL, M_INLINEABLE, M_INTERFACE, M_LOCAL, M_NATIVE, M_PRIVATE, M_PROTECTED, M_PUBLIC, M_STATIC, M_STRICTFP, M_SYNCHRONIZED, M_SYNTHETIC, M_TRANSIENT, M_VOLATILE, MAXFILESIZE, MAXLINENUMBER, METHOD, MM_CLASS, MM_FIELD, MM_MEMBER, MM_METHOD, MUL, NATIVE, NE, NEG, NEW, NEWARRAY, NEWFROMNAME, NEWINSTANCE, NOT, NULL, opNames, opPrecedence, OR, PACKAGE, paraDeprecated, POS, POSTDEC, POSTINC, PREDEC, prefixAccess, prefixArray, prefixClass, prefixLoc, prefixThis, prefixVal, PREINC, PRIVATE, PROTECTED, PUBLIC, QUESTIONMARK, RBRACE, REM, RETURN, RPAREN, RSHIFT, RSQBRACKET, SEMICOLON, SHORT, SHORTVAL, SIG_INNERCLASS, SIGC_INNERCLASS, STAT, STATIC, STRICTFP, STRINGVAL, SUB, SUPER, SWITCH, SYNCHRONIZED, TC_ARRAY, TC_BOOLEAN, TC_BYTE, TC_CHAR, TC_CLASS, TC_DOUBLE, TC_ERROR, TC_FLOAT, TC_INT, TC_LONG, TC_METHOD, TC_NULL, TC_SHORT, TC_VOID, THIS, THROW, THROWS, TM_ARRAY, TM_BOOLEAN, TM_BYTE, TM_CHAR, TM_CLASS, TM_DOUBLE, TM_ERROR, TM_FLOAT, TM_INT, TM_INT32, TM_INTEGER, TM_LONG, TM_METHOD, TM_NULL, TM_NUM32, TM_NUM64, TM_NUMBER, TM_REAL, TM_REFERENCE, TM_SHORT, TM_VOID, tracing, TRANSIENT, TRUE, TRY, TYPE, URSHIFT, VARDECLARATION, VOID, VOLATILE, WHEREOFFSETBITS, WHILE
-
Fields inherited from interface org.glassfish.rmic.tools.java.RuntimeConstants
ACC_ABSTRACT, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_TRANSIENT, ACC_VOLATILE, CONSTANT_CLASS, CONSTANT_DOUBLE, CONSTANT_FIELD, CONSTANT_FLOAT, CONSTANT_INTEGER, CONSTANT_INTERFACEMETHOD, CONSTANT_INVOKEDYNAMIC, CONSTANT_LONG, CONSTANT_METHOD, CONSTANT_METHODHANDLE, CONSTANT_METHODTYPE, CONSTANT_NAMEANDTYPE, CONSTANT_STRING, CONSTANT_UNICODE, CONSTANT_UTF8, JAVA_DEFAULT_MINOR_VERSION, JAVA_DEFAULT_VERSION, JAVA_MAGIC, JAVA_MAX_SUPPORTED_MINOR_VERSION, JAVA_MAX_SUPPORTED_VERSION, JAVA_MIN_SUPPORTED_VERSION, opc_aaload, opc_aastore, opc_aconst_null, opc_aload, opc_aload_0, opc_aload_1, opc_aload_2, opc_aload_3, opc_anewarray, opc_areturn, opc_arraylength, opc_astore, opc_astore_0, opc_astore_1, opc_astore_2, opc_astore_3, opc_athrow, opc_baload, opc_bastore, opc_bipush, opc_breakpoint, opc_caload, opc_castore, opc_checkcast, opc_d2f, opc_d2i, opc_d2l, opc_dadd, opc_daload, opc_dastore, opc_dcmpg, opc_dcmpl, opc_dconst_0, opc_dconst_1, opc_ddiv, opc_dead, opc_dload, opc_dload_0, opc_dload_1, opc_dload_2, opc_dload_3, opc_dmul, opc_dneg, opc_drem, opc_dreturn, opc_dstore, opc_dstore_0, opc_dstore_1, opc_dstore_2, opc_dstore_3, opc_dsub, opc_dup, opc_dup_x1, opc_dup_x2, opc_dup2, opc_dup2_x1, opc_dup2_x2, opc_f2d, opc_f2i, opc_f2l, opc_fadd, opc_faload, opc_fastore, opc_fcmpg, opc_fcmpl, opc_fconst_0, opc_fconst_1, opc_fconst_2, opc_fdiv, opc_fload, opc_fload_0, opc_fload_1, opc_fload_2, opc_fload_3, opc_fmul, opc_fneg, opc_frem, opc_freturn, opc_fstore, opc_fstore_0, opc_fstore_1, opc_fstore_2, opc_fstore_3, opc_fsub, opc_getfield, opc_getstatic, opc_goto, opc_goto_w, opc_i2b, opc_i2c, opc_i2d, opc_i2f, opc_i2l, opc_i2s, opc_iadd, opc_iaload, opc_iand, opc_iastore, opc_iconst_0, opc_iconst_1, opc_iconst_2, opc_iconst_3, opc_iconst_4, opc_iconst_5, opc_iconst_m1, opc_idiv, opc_if_acmpeq, opc_if_acmpne, opc_if_icmpeq, opc_if_icmpge, opc_if_icmpgt, opc_if_icmple, opc_if_icmplt, opc_if_icmpne, opc_ifeq, opc_ifge, opc_ifgt, opc_ifle, opc_iflt, opc_ifne, opc_ifnonnull, opc_ifnull, opc_iinc, opc_iload, opc_iload_0, opc_iload_1, opc_iload_2, opc_iload_3, opc_imul, opc_ineg, opc_instanceof, opc_invokedynamic, opc_invokeinterface, opc_invokespecial, opc_invokestatic, opc_invokevirtual, opc_ior, opc_irem, opc_ireturn, opc_ishl, opc_ishr, opc_istore, opc_istore_0, opc_istore_1, opc_istore_2, opc_istore_3, opc_isub, opc_iushr, opc_ixor, opc_jsr, opc_jsr_w, opc_l2d, opc_l2f, opc_l2i, opc_label, opc_ladd, opc_laload, opc_land, opc_lastore, opc_lcmp, opc_lconst_0, opc_lconst_1, opc_ldc, opc_ldc_w, opc_ldc2_w, opc_ldiv, opc_lload, opc_lload_0, opc_lload_1, opc_lload_2, opc_lload_3, opc_lmul, opc_lneg, opc_lookupswitch, opc_lor, opc_lrem, opc_lreturn, opc_lshl, opc_lshr, opc_lstore, opc_lstore_0, opc_lstore_1, opc_lstore_2, opc_lstore_3, opc_lsub, opc_lushr, opc_lxor, opc_monitorenter, opc_monitorexit, opc_multianewarray, opc_new, opc_newarray, opc_nop, opc_pop, opc_pop2, opc_putfield, opc_putstatic, opc_ret, opc_return, opc_saload, opc_sastore, opc_sipush, opc_swap, opc_tableswitch, opc_try, opc_wide, opcLengths, opcNames, SIG_ARRAY, SIG_BOOLEAN, SIG_BYTE, SIG_CHAR, SIG_CLASS, SIG_DOUBLE, SIG_ENDCLASS, SIG_ENDMETHOD, SIG_FLOAT, SIG_INT, SIG_LONG, SIG_METHOD, SIG_PACKAGE, SIG_SHORT, SIG_VOID, SIGC_ARRAY, SIGC_BOOLEAN, SIGC_BYTE, SIGC_CHAR, SIGC_CLASS, SIGC_DOUBLE, SIGC_ENDCLASS, SIGC_ENDMETHOD, SIGC_FLOAT, SIGC_INT, SIGC_LONG, SIGC_METHOD, SIGC_PACKAGE, SIGC_SHORT, SIGC_VOID, T_BOOLEAN, T_BYTE, T_CHAR, T_CLASS, T_DOUBLE, T_FLOAT, T_INT, T_LONG, T_SHORT
-
-
Constructor Summary
Constructors Constructor Description MemberDefinition(long where, ClassDefinition clazz, int modifiers, Type type, Identifier name, IdentifierToken[] expIds, Node value)
ConstructorMemberDefinition(ClassDefinition innerClass)
Constructor for an inner class.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addModifiers(int mod)
boolean
canReach(Environment env, MemberDefinition f)
Check if a field can reach another field (only considers forward references, not the access modifiers).void
check(Environment env)
Request a check of the field definition.Vset
check(Environment env, Context ctx, Vset vset)
Really check the field definition.boolean
checkMeet(Environment env, MemberDefinition method, ClassDeclaration clazz)
Check to see if two method definitions are compatible, that is do they have a `meet'.boolean
checkOverride(Environment env, MemberDefinition method)
Check to see if `this' can override/hide `method'.private boolean
checkOverride(Environment env, MemberDefinition method, ClassDeclaration clazz)
Checks whether `this' can override `method'.void
cleanup(Environment env)
void
code(Environment env, Assembler asm)
Generate codevoid
codeInit(Environment env, Context ctx, Assembler asm)
boolean
couldOverride(Environment env, MemberDefinition method)
This method is meant to be used to determine if one of two inherited methods could override the other.private boolean
exceptionsFit(Environment env, MemberDefinition method)
Check to see if the exceptions of `this' fit within the exceptions of `method'.private int
getAccessLevel()
Return the access modifier of this member as a number.MemberDefinition
getAccessMethodTarget()
Is this a synthetic method which provides access to a visible private member?MemberDefinition
getAccessUpdateMember()
If this method is a getter for a private field, return the setter.java.util.Vector<MemberDefinition>
getArguments()
Get arguments (a vector of LocalMember)ClassDeclaration
getClassDeclaration()
Get the class declarationClassDefinition
getClassDefinition()
Get the class definitionClassDeclaration
getDefiningClassDeclaration()
Get the class declaration in which the field is actually definedjava.lang.String
getDocumentation()
Get the field's documentationIdentifierToken[]
getExceptionIds()
ClassDeclaration[]
getExceptions(Environment env)
Get the exceptions that are thrown by this method.java.lang.Object
getInitialValue()
ClassDefinition
getInnerClass()
Get an inner class.java.lang.String
getMemberValueString(Environment env)
int
getModifiers()
Get the field's modifiersIdentifier
getName()
Get the field's nameMemberDefinition
getNextMatch()
MemberDefinition
getNextMember()
Get the next field or the next matchClassDefinition
getTopClass()
Get the field's top-level enclosing classType
getType()
Get the field's typeNode
getValue()
Node
getValue(Environment env)
Get the field's final value (may return null)long
getWhere()
Get the position in the inputboolean
isAbstract()
boolean
isAccessMethod()
boolean
isBlankFinal()
Tell if this is a final variable without an initializer.boolean
isConstant()
Check if constant: Will it inline away to a constant?boolean
isConstructor()
boolean
isDeprecated()
boolean
isFinal()
boolean
isInitializer()
boolean
isInlineable(Environment env, boolean fromFinal)
boolean
isInnerClass()
boolean
isLocal()
boolean
isMethod()
boolean
isNative()
boolean
isNeverNull()
boolean
isPackagePrivate()
boolean
isPrivate()
boolean
isProtected()
boolean
isPublic()
Checksboolean
isStatic()
boolean
isStrict()
boolean
isSuperAccessMethod()
Is this an access method for a field selection or method call of the form '...super.foo' or '...super.foo()'?boolean
isSynchronized()
boolean
isSynthetic()
boolean
isTransient()
boolean
isUplevelValue()
Is this a synthetic field which holds a copy of, or reference to, a local variable or enclosing instance?boolean
isVariable()
boolean
isVolatile()
static MemberDefinition
makeProxyMember(MemberDefinition field, ClassDefinition classDef, Environment env)
Create a member which is externally the same as `field' but is defined in class `classDef'.void
print(java.io.PrintStream out)
Print for debuggingboolean
reportDeprecated(Environment env)
Tells whether to report a deprecation error for this field.private void
reportError(Environment env, java.lang.String errorString, ClassDeclaration clazz, MemberDefinition method)
Munge our error message to report whether the override conflict came from an inherited method or a declared method.void
resolveTypeStructure(Environment env)
A stub.boolean
sameReturnType(MemberDefinition method)
Convenience method to see if two methods return the same typevoid
setAccessMethodTarget(MemberDefinition target)
void
setAccessUpdateMember(MemberDefinition updater)
void
setIsSuperAccessMethod(boolean b)
Mark this member as an access method for a field selection or method call via the 'super' keyword.void
setValue(Node value)
void
subModifiers(int mod)
java.lang.String
toString()
toString
-
-
-
Field Detail
-
where
protected long where
-
modifiers
protected int modifiers
-
type
protected Type type
-
documentation
protected java.lang.String documentation
-
expIds
protected IdentifierToken[] expIds
-
exp
protected ClassDeclaration[] exp
-
value
protected Node value
-
clazz
protected ClassDefinition clazz
-
name
protected Identifier name
-
innerClass
protected ClassDefinition innerClass
-
nextMember
protected MemberDefinition nextMember
-
nextMatch
protected MemberDefinition nextMatch
-
accessPeer
protected MemberDefinition accessPeer
-
superAccessMethod
protected boolean superAccessMethod
-
proxyCache
private static java.util.Map<java.lang.String,MemberDefinition> proxyCache
A cache of previously created proxy members. Used to ensure uniqueness of proxy objects. See the makeProxyMember method defined below.
-
PUBLIC_ACCESS
static final int PUBLIC_ACCESS
Constants used by getAccessLevel() to represent the access modifiers as numbers.- See Also:
- Constant Field Values
-
PROTECTED_ACCESS
static final int PROTECTED_ACCESS
- See Also:
- Constant Field Values
-
PACKAGE_ACCESS
static final int PACKAGE_ACCESS
- See Also:
- Constant Field Values
-
PRIVATE_ACCESS
static final int PRIVATE_ACCESS
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
MemberDefinition
public MemberDefinition(long where, ClassDefinition clazz, int modifiers, Type type, Identifier name, IdentifierToken[] expIds, Node value)
Constructor
-
MemberDefinition
public MemberDefinition(ClassDefinition innerClass)
Constructor for an inner class. Inner classes are represented as fields right along with variables and methods for simplicity of data structure, and to reflect properly the textual declaration order.This constructor calls the generic constructor for this class, extracting all necessary values from the innerClass.
-
-
Method Detail
-
makeProxyMember
public static MemberDefinition makeProxyMember(MemberDefinition field, ClassDefinition classDef, Environment env)
Create a member which is externally the same as `field' but is defined in class `classDef'. This is used by code in org.glassfish.rmic.tools.tree.(MethodExpression,FieldExpression) as part of the fix for bug 4135692. Proxy members should not be added, ala addMember(), to classes. They are merely "stand-ins" to produce modified MethodRef constant pool entries during code generation. We keep a cache of previously created proxy members not to save time or space, but to ensure uniqueness of the proxy member for any (field,classDef) pair. If these are not made unique then we can end up generating duplicate MethodRef constant pool entries during code generation.
-
getMemberValueString
public java.lang.String getMemberValueString(Environment env) throws ClassNotFound
- Throws:
ClassNotFound
-
getWhere
public final long getWhere()
Get the position in the input
-
getClassDeclaration
public final ClassDeclaration getClassDeclaration()
Get the class declaration
-
resolveTypeStructure
public void resolveTypeStructure(Environment env)
A stub. Subclasses can do more checking.
-
getDefiningClassDeclaration
public ClassDeclaration getDefiningClassDeclaration()
Get the class declaration in which the field is actually defined
-
getClassDefinition
public final ClassDefinition getClassDefinition()
Get the class definition
-
getTopClass
public final ClassDefinition getTopClass()
Get the field's top-level enclosing class
-
getModifiers
public final int getModifiers()
Get the field's modifiers
-
subModifiers
public final void subModifiers(int mod)
-
addModifiers
public final void addModifiers(int mod)
-
getType
public final Type getType()
Get the field's type
-
getName
public final Identifier getName()
Get the field's name
-
getArguments
public java.util.Vector<MemberDefinition> getArguments()
Get arguments (a vector of LocalMember)
-
getExceptions
public ClassDeclaration[] getExceptions(Environment env)
Get the exceptions that are thrown by this method.
-
getExceptionIds
public final IdentifierToken[] getExceptionIds()
-
getInnerClass
public ClassDefinition getInnerClass()
Get an inner class.
-
isUplevelValue
public boolean isUplevelValue()
Is this a synthetic field which holds a copy of, or reference to, a local variable or enclosing instance?
-
isAccessMethod
public boolean isAccessMethod()
-
getAccessMethodTarget
public MemberDefinition getAccessMethodTarget()
Is this a synthetic method which provides access to a visible private member?
-
setAccessMethodTarget
public void setAccessMethodTarget(MemberDefinition target)
-
getAccessUpdateMember
public MemberDefinition getAccessUpdateMember()
If this method is a getter for a private field, return the setter.
-
setAccessUpdateMember
public void setAccessUpdateMember(MemberDefinition updater)
-
isSuperAccessMethod
public final boolean isSuperAccessMethod()
Is this an access method for a field selection or method call of the form '...super.foo' or '...super.foo()'?
-
setIsSuperAccessMethod
public final void setIsSuperAccessMethod(boolean b)
Mark this member as an access method for a field selection or method call via the 'super' keyword.
-
isBlankFinal
public final boolean isBlankFinal()
Tell if this is a final variable without an initializer. Such variables are subject to definite single assignment.
-
isNeverNull
public boolean isNeverNull()
-
getValue
public Node getValue(Environment env) throws ClassNotFound
Get the field's final value (may return null)- Throws:
ClassNotFound
-
getValue
public final Node getValue()
-
setValue
public final void setValue(Node value)
-
getInitialValue
public java.lang.Object getInitialValue()
-
getNextMember
public final MemberDefinition getNextMember()
Get the next field or the next match
-
getNextMatch
public final MemberDefinition getNextMatch()
-
getDocumentation
public java.lang.String getDocumentation()
Get the field's documentation
-
check
public void check(Environment env) throws ClassNotFound
Request a check of the field definition.- Throws:
ClassNotFound
-
check
public Vset check(Environment env, Context ctx, Vset vset) throws ClassNotFound
Really check the field definition.- Throws:
ClassNotFound
-
code
public void code(Environment env, Assembler asm) throws ClassNotFound
Generate code- Throws:
ClassNotFound
-
codeInit
public void codeInit(Environment env, Context ctx, Assembler asm) throws ClassNotFound
- Throws:
ClassNotFound
-
reportDeprecated
public boolean reportDeprecated(Environment env)
Tells whether to report a deprecation error for this field.
-
canReach
public final boolean canReach(Environment env, MemberDefinition f)
Check if a field can reach another field (only considers forward references, not the access modifiers).
-
getAccessLevel
private int getAccessLevel()
Return the access modifier of this member as a number. The idea is that this number may be used to check properties like "the access modifier of x is more restrictive than the access modifier of y" with a simple inequality test: "x.getAccessLevel() > y.getAccessLevel. This is an internal utility method.
-
reportError
private void reportError(Environment env, java.lang.String errorString, ClassDeclaration clazz, MemberDefinition method)
Munge our error message to report whether the override conflict came from an inherited method or a declared method.
-
sameReturnType
public boolean sameReturnType(MemberDefinition method)
Convenience method to see if two methods return the same type
-
checkOverride
public boolean checkOverride(Environment env, MemberDefinition method)
Check to see if `this' can override/hide `method'. Caller is responsible for verifying that `method' has the same signature as `this'. Caller is also responsible for verifying that `method' is visible to the class where this override is occurring. This method is called for the case when class B extends A and both A and B define some method.A - void foo() throws e1 | | B - void foo() throws e2
-
checkOverride
private boolean checkOverride(Environment env, MemberDefinition method, ClassDeclaration clazz)
Checks whether `this' can override `method'. It `clazz' is null, it reports the errors in the class where `this' is declared. If `clazz' is not null, it reports the error in `clazz'.
-
checkMeet
public boolean checkMeet(Environment env, MemberDefinition method, ClassDeclaration clazz)
Check to see if two method definitions are compatible, that is do they have a `meet'. The meet of two methods is essentially and `intersection' of two methods. This method is called when some class C inherits declarations for some method foo from two parents (superclass, interfaces) but it does not, itself, have a declaration of foo. Caller is responsible for making sure that both methods are indeed visible in clazz.A - void foo() throws e1 \ \ B void foo() throws e2 \ / \ / C
-
couldOverride
public boolean couldOverride(Environment env, MemberDefinition method)
This method is meant to be used to determine if one of two inherited methods could override the other. Unlike checkOverride(), failure is not an error. This method is only meant to be called after checkMeet() has succeeded on the two methods. If you call couldOverride() without doing a checkMeet() first, then you are on your own.
-
exceptionsFit
private boolean exceptionsFit(Environment env, MemberDefinition method)
Check to see if the exceptions of `this' fit within the exceptions of `method'.
-
isPublic
public final boolean isPublic()
Checks
-
isPrivate
public final boolean isPrivate()
-
isProtected
public final boolean isProtected()
-
isPackagePrivate
public final boolean isPackagePrivate()
-
isFinal
public final boolean isFinal()
-
isStatic
public final boolean isStatic()
-
isSynchronized
public final boolean isSynchronized()
-
isAbstract
public final boolean isAbstract()
-
isNative
public final boolean isNative()
-
isVolatile
public final boolean isVolatile()
-
isTransient
public final boolean isTransient()
-
isMethod
public final boolean isMethod()
-
isVariable
public final boolean isVariable()
-
isSynthetic
public final boolean isSynthetic()
-
isDeprecated
public final boolean isDeprecated()
-
isStrict
public final boolean isStrict()
-
isInnerClass
public final boolean isInnerClass()
-
isInitializer
public final boolean isInitializer()
-
isConstructor
public final boolean isConstructor()
-
isLocal
public boolean isLocal()
-
isInlineable
public boolean isInlineable(Environment env, boolean fromFinal) throws ClassNotFound
- Throws:
ClassNotFound
-
isConstant
public boolean isConstant()
Check if constant: Will it inline away to a constant?
-
toString
public java.lang.String toString()
toString- Overrides:
toString
in classjava.lang.Object
-
print
public void print(java.io.PrintStream out)
Print for debugging
-
cleanup
public void cleanup(Environment env)
-
-