Package com.ibm.wala.classLoader
Class SyntheticMethod
- java.lang.Object
-
- com.ibm.wala.classLoader.SyntheticMethod
-
- All Implemented Interfaces:
IMember,IMethod,ContextItem,IClassHierarchyDweller
- Direct Known Subclasses:
AbstractReflectionInterpreter.SpecializedMethod,AbstractRootMethod,SummarizedMethod
public class SyntheticMethod extends Object implements IMethod
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.ibm.wala.ipa.callgraph.ContextItem
ContextItem.Value<T>
-
Nested classes/interfaces inherited from interface com.ibm.wala.classLoader.IMethod
IMethod.SourcePosition
-
-
Field Summary
Fields Modifier and Type Field Description protected IClassdeclaringClassstatic SSAInstruction[]NO_STATEMENTSprotected IMethodresolvedMethod
-
Constructor Summary
Constructors Constructor Description SyntheticMethod(IMethod method, IClass declaringClass, boolean isStatic, boolean isFactory)SyntheticMethod(MethodReference method, IClass declaringClass, boolean isStatic, boolean isFactory)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(Object obj)Collection<Annotation>getAnnotations()Get the annotations on this member, if anyBytecodeStreamgetBytecodeStream()IClassHierarchygetClassHierarchy()TypeReference[]getDeclaredExceptions()IClassgetDeclaringClass()Return the object that represents the declaring class for this member.DescriptorgetDescriptor()something like: (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;intgetLineNumber(int bcIndex)END Custom change: precise bytecode positionsStringgetLocalVariableName(int bcIndex, int localNumber)intgetMaxLocals()intgetMaxStackHeight()AtomgetName()intgetNumberOfParameters()Method getNumberOfParameters.IMethod.SourcePositiongetParameterSourcePosition(int paramNum)TypeReferencegetParameterType(int i)By convention, for a non-static method, getParameterType(0) is the this pointerStringgetPoison()bytegetPoisonLevel()MethodReferencegetReference()TypeReferencegetReturnType()SelectorgetSelector()something like: foo(Ljava/langString;)Ljava/lang/Class;StringgetSignature()something like: com.foo.bar.createLargeOrder(IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;IMethod.SourcePositiongetSourcePosition(int bcIndex)BEGIN Custom change: : precise bytecode positionsSSAInstruction[]getStatements()SSAInstruction[]getStatements(SSAOptions options)Deprecated.booleanhasExceptionHandler()inthashCode()booleanhasLocalVariableTable()booleanhasPoison()booleanisAbstract()Is this method abstract?booleanisBridge()Is this method a bridge method? See JLS 3rd Edition 15.12.4.5booleanisClinit()Is this method a class initializer?booleanisFactoryMethod()booleanisFinal()Is this method final?booleanisInit()Is this method an object initializer?booleanisNative()Is this method native?booleanisPrivate()Is this method private?booleanisProtected()Is this method protected?booleanisPublic()Is this method public?booleanisStatic()Is this member static?booleanisSynchronized()Is this method synchronized?booleanisSynthetic()Did someone synthesize this method? (As opposed to reading it from a class file)InducedCFGmakeControlFlowGraph(SSAInstruction[] instructions)Create anInducedCFGfrom an instruction array.IRmakeIR(Context context, SSAOptions options)Most subclasses should override this.StringtoString()
-
-
-
Field Detail
-
NO_STATEMENTS
public static final SSAInstruction[] NO_STATEMENTS
-
resolvedMethod
protected final IMethod resolvedMethod
-
declaringClass
protected final IClass declaringClass
-
-
Constructor Detail
-
SyntheticMethod
public SyntheticMethod(MethodReference method, IClass declaringClass, boolean isStatic, boolean isFactory)
-
-
Method Detail
-
isClinit
public boolean isClinit()
Description copied from interface:IMethodIs this method a class initializer?- Specified by:
isClinitin interfaceIMethod- See Also:
IMethod.isClinit()
-
isInit
public boolean isInit()
Description copied from interface:IMethodIs this method an object initializer?- Specified by:
isInitin interfaceIMethod- See Also:
IMethod.isInit()
-
isStatic
public boolean isStatic()
Description copied from interface:IMemberIs this member static?- Specified by:
isStaticin interfaceIMember- See Also:
IMember.isStatic()
-
isNative
public boolean isNative()
Description copied from interface:IMethodIs this method native?- Specified by:
isNativein interfaceIMethod- See Also:
IMethod.isNative()
-
isAbstract
public boolean isAbstract()
Description copied from interface:IMethodIs this method abstract?- Specified by:
isAbstractin interfaceIMethod- See Also:
IMethod.isAbstract()
-
isPrivate
public boolean isPrivate()
Description copied from interface:IMethodIs this method private?- Specified by:
isPrivatein interfaceIMethod- See Also:
IMethod.isPrivate()
-
isProtected
public boolean isProtected()
Description copied from interface:IMethodIs this method protected?- Specified by:
isProtectedin interfaceIMethod
-
isPublic
public boolean isPublic()
Description copied from interface:IMethodIs this method public?
-
isFinal
public boolean isFinal()
Description copied from interface:IMethodIs this method final?- Specified by:
isFinalin interfaceIMethod- See Also:
IMethod.isFinal()
-
isBridge
public boolean isBridge()
Description copied from interface:IMethodIs this method a bridge method? See JLS 3rd Edition 15.12.4.5- Specified by:
isBridgein interfaceIMethod- See Also:
IMethod.isBridge()
-
isSynchronized
public boolean isSynchronized()
Description copied from interface:IMethodIs this method synchronized?- Specified by:
isSynchronizedin interfaceIMethod- See Also:
IMethod.isAbstract()
-
isSynthetic
public boolean isSynthetic()
Description copied from interface:IMethodDid someone synthesize this method? (As opposed to reading it from a class file)- Specified by:
isSyntheticin interfaceIMethod- See Also:
IMethod.isSynthetic()
-
getReference
public MethodReference getReference()
- Specified by:
getReferencein interfaceIMethod- Returns:
- canonical MethodReference corresponding to this method
- See Also:
IMethod.getReference()
-
makeControlFlowGraph
public InducedCFG makeControlFlowGraph(SSAInstruction[] instructions)
Create anInducedCFGfrom an instruction array. NOTE: SIDE EFFECT!!! ... nulls out phi instructions in the instruction array!
-
getBytecodeStream
public BytecodeStream getBytecodeStream() throws UnsupportedOperationException
- Throws:
UnsupportedOperationException
-
getMaxLocals
public int getMaxLocals() throws UnsupportedOperationException- Throws:
UnsupportedOperationException
-
getMaxStackHeight
public int getMaxStackHeight() throws UnsupportedOperationException- Throws:
UnsupportedOperationException
-
getDeclaringClass
public IClass getDeclaringClass()
Description copied from interface:IMemberReturn the object that represents the declaring class for this member.- Specified by:
getDeclaringClassin interfaceIMember- Returns:
- the object that represents the declaring class for this member.
-
hasExceptionHandler
public boolean hasExceptionHandler()
- Specified by:
hasExceptionHandlerin interfaceIMethod- Returns:
- true iff this method has at least one exception handler
-
hasPoison
public boolean hasPoison()
-
getPoison
public String getPoison()
-
getPoisonLevel
public byte getPoisonLevel()
-
getStatements
@Deprecated public SSAInstruction[] getStatements(SSAOptions options)
Deprecated.
-
makeIR
public IR makeIR(Context context, SSAOptions options) throws UnimplementedError
Most subclasses should override this.- Parameters:
context- TODOoptions- options governing IR conversion- Throws:
UnimplementedError
-
getParameterType
public TypeReference getParameterType(int i)
Description copied from interface:IMethodBy convention, for a non-static method, getParameterType(0) is the this pointer- Specified by:
getParameterTypein interfaceIMethod
-
getNumberOfParameters
public int getNumberOfParameters()
Description copied from interface:IMethodMethod getNumberOfParameters. This result includes the "this" pointer if applicable- Specified by:
getNumberOfParametersin interfaceIMethod- See Also:
IMethod.getNumberOfParameters()
-
getDeclaredExceptions
public TypeReference[] getDeclaredExceptions() throws InvalidClassFileException
- Specified by:
getDeclaredExceptionsin interfaceIMethod- Returns:
- an array of the exception types declared by the throws clause for this method, or null if there are none
- Throws:
InvalidClassFileException
-
getName
public Atom getName()
-
getDescriptor
public Descriptor getDescriptor()
Description copied from interface:IMethodsomething like: (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;- Specified by:
getDescriptorin interfaceIMethod
-
getSourcePosition
public IMethod.SourcePosition getSourcePosition(int bcIndex) throws InvalidClassFileException
BEGIN Custom change: : precise bytecode positions- Specified by:
getSourcePositionin interfaceIMethod- Throws:
InvalidClassFileException
-
getParameterSourcePosition
public IMethod.SourcePosition getParameterSourcePosition(int paramNum) throws InvalidClassFileException
- Specified by:
getParameterSourcePositionin interfaceIMethod- Throws:
InvalidClassFileException
-
getLineNumber
public int getLineNumber(int bcIndex)
END Custom change: precise bytecode positions- Specified by:
getLineNumberin interfaceIMethod- Returns:
- the source line number corresponding to a particular bytecode index, or -1 if the information is not available.
-
isFactoryMethod
public boolean isFactoryMethod()
-
getSignature
public String getSignature()
Description copied from interface:IMethodsomething like: com.foo.bar.createLargeOrder(IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;- Specified by:
getSignaturein interfaceIMethod
-
getSelector
public Selector getSelector()
Description copied from interface:IMethodsomething like: foo(Ljava/langString;)Ljava/lang/Class;- Specified by:
getSelectorin interfaceIMethod
-
getLocalVariableName
public String getLocalVariableName(int bcIndex, int localNumber)
- Specified by:
getLocalVariableNamein interfaceIMethod- Returns:
- the (source code) name of the local variable of a given number at the specified program counter, or null if the information is not available.
-
hasLocalVariableTable
public boolean hasLocalVariableTable()
- Specified by:
hasLocalVariableTablein interfaceIMethod- Returns:
- true iff the local variable table information for this method is available
-
getStatements
public SSAInstruction[] getStatements()
-
getReturnType
public TypeReference getReturnType()
- Specified by:
getReturnTypein interfaceIMethod- Returns:
- the name of the return type for this method
-
getClassHierarchy
public IClassHierarchy getClassHierarchy()
- Specified by:
getClassHierarchyin interfaceIClassHierarchyDweller
-
getAnnotations
public Collection<Annotation> getAnnotations()
Description copied from interface:IMemberGet the annotations on this member, if any- Specified by:
getAnnotationsin interfaceIMember
-
-