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 IClass
declaringClass
static SSAInstruction[]
NO_STATEMENTS
protected IMethod
resolvedMethod
-
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 boolean
equals(Object obj)
Collection<Annotation>
getAnnotations()
Get the annotations on this member, if anyBytecodeStream
getBytecodeStream()
IClassHierarchy
getClassHierarchy()
TypeReference[]
getDeclaredExceptions()
IClass
getDeclaringClass()
Return the object that represents the declaring class for this member.Descriptor
getDescriptor()
something like: (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;int
getLineNumber(int bcIndex)
END Custom change: precise bytecode positionsString
getLocalVariableName(int bcIndex, int localNumber)
int
getMaxLocals()
int
getMaxStackHeight()
Atom
getName()
int
getNumberOfParameters()
Method getNumberOfParameters.IMethod.SourcePosition
getParameterSourcePosition(int paramNum)
TypeReference
getParameterType(int i)
By convention, for a non-static method, getParameterType(0) is the this pointerString
getPoison()
byte
getPoisonLevel()
MethodReference
getReference()
TypeReference
getReturnType()
Selector
getSelector()
something like: foo(Ljava/langString;)Ljava/lang/Class;String
getSignature()
something like: com.foo.bar.createLargeOrder(IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;IMethod.SourcePosition
getSourcePosition(int bcIndex)
BEGIN Custom change: : precise bytecode positionsSSAInstruction[]
getStatements()
SSAInstruction[]
getStatements(SSAOptions options)
Deprecated.boolean
hasExceptionHandler()
int
hashCode()
boolean
hasLocalVariableTable()
boolean
hasPoison()
boolean
isAbstract()
Is this method abstract?boolean
isBridge()
Is this method a bridge method? See JLS 3rd Edition 15.12.4.5boolean
isClinit()
Is this method a class initializer?boolean
isFactoryMethod()
boolean
isFinal()
Is this method final?boolean
isInit()
Is this method an object initializer?boolean
isNative()
Is this method native?boolean
isPrivate()
Is this method private?boolean
isProtected()
Is this method protected?boolean
isPublic()
Is this method public?boolean
isStatic()
Is this member static?boolean
isSynchronized()
Is this method synchronized?boolean
isSynthetic()
Did someone synthesize this method? (As opposed to reading it from a class file)InducedCFG
makeControlFlowGraph(SSAInstruction[] instructions)
Create anInducedCFG
from an instruction array.IR
makeIR(Context context, SSAOptions options)
Most subclasses should override this.String
toString()
-
-
-
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:IMethod
Is this method a class initializer?- Specified by:
isClinit
in interfaceIMethod
- See Also:
IMethod.isClinit()
-
isInit
public boolean isInit()
Description copied from interface:IMethod
Is this method an object initializer?- Specified by:
isInit
in interfaceIMethod
- See Also:
IMethod.isInit()
-
isStatic
public boolean isStatic()
Description copied from interface:IMember
Is this member static?- Specified by:
isStatic
in interfaceIMember
- See Also:
IMember.isStatic()
-
isNative
public boolean isNative()
Description copied from interface:IMethod
Is this method native?- Specified by:
isNative
in interfaceIMethod
- See Also:
IMethod.isNative()
-
isAbstract
public boolean isAbstract()
Description copied from interface:IMethod
Is this method abstract?- Specified by:
isAbstract
in interfaceIMethod
- See Also:
IMethod.isAbstract()
-
isPrivate
public boolean isPrivate()
Description copied from interface:IMethod
Is this method private?- Specified by:
isPrivate
in interfaceIMethod
- See Also:
IMethod.isPrivate()
-
isProtected
public boolean isProtected()
Description copied from interface:IMethod
Is this method protected?- Specified by:
isProtected
in interfaceIMethod
-
isPublic
public boolean isPublic()
Description copied from interface:IMethod
Is this method public?
-
isFinal
public boolean isFinal()
Description copied from interface:IMethod
Is this method final?- Specified by:
isFinal
in interfaceIMethod
- See Also:
IMethod.isFinal()
-
isBridge
public boolean isBridge()
Description copied from interface:IMethod
Is this method a bridge method? See JLS 3rd Edition 15.12.4.5- Specified by:
isBridge
in interfaceIMethod
- See Also:
IMethod.isBridge()
-
isSynchronized
public boolean isSynchronized()
Description copied from interface:IMethod
Is this method synchronized?- Specified by:
isSynchronized
in interfaceIMethod
- See Also:
IMethod.isAbstract()
-
isSynthetic
public boolean isSynthetic()
Description copied from interface:IMethod
Did someone synthesize this method? (As opposed to reading it from a class file)- Specified by:
isSynthetic
in interfaceIMethod
- See Also:
IMethod.isSynthetic()
-
getReference
public MethodReference getReference()
- Specified by:
getReference
in interfaceIMethod
- Returns:
- canonical MethodReference corresponding to this method
- See Also:
IMethod.getReference()
-
makeControlFlowGraph
public InducedCFG makeControlFlowGraph(SSAInstruction[] instructions)
Create anInducedCFG
from 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:IMember
Return the object that represents the declaring class for this member.- Specified by:
getDeclaringClass
in interfaceIMember
- Returns:
- the object that represents the declaring class for this member.
-
hasExceptionHandler
public boolean hasExceptionHandler()
- Specified by:
hasExceptionHandler
in 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:IMethod
By convention, for a non-static method, getParameterType(0) is the this pointer- Specified by:
getParameterType
in interfaceIMethod
-
getNumberOfParameters
public int getNumberOfParameters()
Description copied from interface:IMethod
Method getNumberOfParameters. This result includes the "this" pointer if applicable- Specified by:
getNumberOfParameters
in interfaceIMethod
- See Also:
IMethod.getNumberOfParameters()
-
getDeclaredExceptions
public TypeReference[] getDeclaredExceptions() throws InvalidClassFileException
- Specified by:
getDeclaredExceptions
in 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:IMethod
something like: (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;- Specified by:
getDescriptor
in interfaceIMethod
-
getSourcePosition
public IMethod.SourcePosition getSourcePosition(int bcIndex) throws InvalidClassFileException
BEGIN Custom change: : precise bytecode positions- Specified by:
getSourcePosition
in interfaceIMethod
- Throws:
InvalidClassFileException
-
getParameterSourcePosition
public IMethod.SourcePosition getParameterSourcePosition(int paramNum) throws InvalidClassFileException
- Specified by:
getParameterSourcePosition
in interfaceIMethod
- Throws:
InvalidClassFileException
-
getLineNumber
public int getLineNumber(int bcIndex)
END Custom change: precise bytecode positions- Specified by:
getLineNumber
in 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:IMethod
something like: com.foo.bar.createLargeOrder(IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;- Specified by:
getSignature
in interfaceIMethod
-
getSelector
public Selector getSelector()
Description copied from interface:IMethod
something like: foo(Ljava/langString;)Ljava/lang/Class;- Specified by:
getSelector
in interfaceIMethod
-
getLocalVariableName
public String getLocalVariableName(int bcIndex, int localNumber)
- Specified by:
getLocalVariableName
in 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:
hasLocalVariableTable
in interfaceIMethod
- Returns:
- true iff the local variable table information for this method is available
-
getStatements
public SSAInstruction[] getStatements()
-
getReturnType
public TypeReference getReturnType()
- Specified by:
getReturnType
in interfaceIMethod
- Returns:
- the name of the return type for this method
-
getClassHierarchy
public IClassHierarchy getClassHierarchy()
- Specified by:
getClassHierarchy
in interfaceIClassHierarchyDweller
-
getAnnotations
public Collection<Annotation> getAnnotations()
Description copied from interface:IMember
Get the annotations on this member, if any- Specified by:
getAnnotations
in interfaceIMember
-
-