Class SyntheticMethod
java.lang.Object
com.ibm.wala.classLoader.SyntheticMethod
- All Implemented Interfaces:
IMember
,IMethod
,ContextItem
,IClassHierarchyDweller
- Direct Known Subclasses:
AbstractReflectionInterpreter.SpecializedMethod
,AbstractRootMethod
,SummarizedMethod
-
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
Modifier and TypeFieldDescriptionfinal IClass
static final SSAInstruction[]
protected final IMethod
-
Constructor Summary
ConstructorDescriptionSyntheticMethod
(IMethod method, IClass declaringClass, boolean isStatic, boolean isFactory) SyntheticMethod
(MethodReference method, IClass declaringClass, boolean isStatic, boolean isFactory) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Get the annotations on this member, if anyReturn the object that represents the declaring class for this member.something like: (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;int
getLineNumber
(int bcIndex) getLocalVariableName
(int bcIndex, int localNumber) int
int
getName()
int
Method getNumberOfParameters.getParameterSourcePosition
(int paramNum) getParameterType
(int i) By convention, for a non-static method, getParameterType(0) is the this pointerbyte
something like: foo(Ljava/langString;)Ljava/lang/Class;something like: com.foo.bar.createLargeOrder(IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;getSourcePosition
(int bcIndex) getStatements
(SSAOptions options) Deprecated.boolean
int
hashCode()
boolean
boolean
boolean
Is this method abstract?boolean
boolean
isBridge()
Is this method a bridge method? See JLS 3rd Edition 15.12.4.5boolean
isClinit()
Is this method a class initializer?boolean
isEnum()
boolean
boolean
isFinal()
Is this method final?boolean
isInit()
Is this method an object initializer?boolean
isModule()
boolean
isNative()
Is this method native?boolean
Is this method private?boolean
Is this method protected?boolean
isPublic()
Is this method public?boolean
isStatic()
Is this member static?boolean
Is this method synchronized?boolean
Is this method synthetic, i.e., compiler-generated (this refers to the synthetic flag in java/dex bytecode)boolean
Is the implementation of this method a model generated by WALA? For compiler-generated synthetic methods, refer toIMethod.isSynthetic()
makeControlFlowGraph
(SSAInstruction[] instructions) Create anInducedCFG
from an instruction array.makeIR
(Context context, SSAOptions options) Most subclasses should override this.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.ibm.wala.classLoader.IMethod
getNumberOfDefaultParameters
-
Field Details
-
NO_STATEMENTS
-
resolvedMethod
-
declaringClass
-
-
Constructor Details
-
SyntheticMethod
public SyntheticMethod(MethodReference method, IClass declaringClass, boolean isStatic, boolean isFactory) -
SyntheticMethod
-
-
Method Details
-
isClinit
-
isInit
-
isStatic
-
isNative
-
isAbstract
public boolean isAbstract()Description copied from interface:IMethod
Is this method abstract?- Specified by:
isAbstract
in interfaceIMethod
-
isPrivate
-
isProtected
public boolean isProtected()Description copied from interface:IMethod
Is this method protected?- Specified by:
isProtected
in interfaceIMethod
-
isPublic
-
isFinal
-
isBridge
-
isSynchronized
public boolean isSynchronized()Description copied from interface:IMethod
Is this method synchronized?- Specified by:
isSynchronized
in interfaceIMethod
- See Also:
-
isAnnotation
public boolean isAnnotation()- Specified by:
isAnnotation
in interfaceIMethod
-
isEnum
-
isModule
-
isWalaSynthetic
public boolean isWalaSynthetic()Description copied from interface:IMethod
Is the implementation of this method a model generated by WALA? For compiler-generated synthetic methods, refer toIMethod.isSynthetic()
- Specified by:
isWalaSynthetic
in interfaceIMethod
-
isSynthetic
public boolean isSynthetic()Description copied from interface:IMethod
Is this method synthetic, i.e., compiler-generated (this refers to the synthetic flag in java/dex bytecode)- Specified by:
isSynthetic
in interfaceIMethod
-
getReference
- Specified by:
getReference
in interfaceIMethod
- Returns:
- canonical MethodReference corresponding to this method
-
makeControlFlowGraph
Create anInducedCFG
from an instruction array.NOTE: SIDE EFFECT!!! ... nulls out phi instructions in the instruction array!
-
getBytecodeStream
- Throws:
UnsupportedOperationException
-
getMaxLocals
- Throws:
UnsupportedOperationException
-
getMaxStackHeight
- Throws:
UnsupportedOperationException
-
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.
-
toString
-
hashCode
-
equals
-
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
-
getPoisonLevel
public byte getPoisonLevel() -
getStatements
Deprecated. -
makeIR
Most subclasses should override this.- Parameters:
context
- TODOoptions
- options governing IR conversion- Throws:
UnimplementedError
-
getParameterType
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
-
getDeclaredExceptions
- 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
-
getDescriptor
Description copied from interface:IMethod
something like: (IILjava.lang.String;SLjava.sql.Date;)Ljava.lang.Integer;- Specified by:
getDescriptor
in interfaceIMethod
-
getSourcePosition
- 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) - 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
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
Description copied from interface:IMethod
something like: foo(Ljava/langString;)Ljava/lang/Class;- Specified by:
getSelector
in interfaceIMethod
-
getLocalVariableName
- 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
-
getReturnType
- Specified by:
getReturnType
in interfaceIMethod
- Returns:
- the name of the return type for this method
-
getClassHierarchy
- Specified by:
getClassHierarchy
in interfaceIClassHierarchyDweller
-
getAnnotations
Description copied from interface:IMember
Get the annotations on this member, if any- Specified by:
getAnnotations
in interfaceIMember
-