Class LambdaSummaryClass
java.lang.Object
com.ibm.wala.classLoader.SyntheticClass
com.ibm.wala.ipa.summaries.LambdaSummaryClass
- All Implemented Interfaces:
IClass, IClassHierarchyDweller
Synthetic class modeling the anonymous class generated at runtime for a lambda expression. The
anonymous class implements the relevant functional interface. Our synthetic classes contain
instance fields corresponding to the values captured by the lambda. The implementation of the
functional interface method is a "trampoline" that invokes the generated lambda body method with
the captured values stored in the instance fields.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic LambdaSummaryClasscreate(CGNode caller, SSAInvokeDynamicInstruction inst) Create a lambda summary class and add it to the class hierarchy.Compute the instance and static fields declared by this class or any of its superclasses.Compute the instance fields declared by this class or any of its superclasses.Compute the methods declared by this class or any of its superclasses.Compute the static fields declared by this class or any of its superclasses.static AtomgetCaptureFieldName(int i) get the synthetic field name for a value captured by the lambdaCompute the instance fields declared by this class.Collection<? extends IClass> Finds a field.Finds method matching signature.intReturn the integer that encodes the class's modifiers, as defined by the JVM specificationbooleanbooleanisPublic()booleanDoes 'this' refer to a reference type? If not, then it refers to a primitive type.Methods inherited from class SyntheticClass
equals, getAnnotations, getClassHierarchy, getClassLoader, getField, getName, getReference, getSource, getSourceFileName, hashCode, isAbstract, isArrayClass, isInterface, isSynthetic
-
Method Details
-
create
Create a lambda summary class and add it to the class hierarchy.- Parameters:
caller- method containing the relevant invokedynamic instructioninst- the invokedynamic instruction- Returns:
- the summary class
-
isPublic
public boolean isPublic()- Returns:
- true iff this class is public
-
isPrivate
public boolean isPrivate()- Returns:
- true iff this class is private
-
getModifiers
Description copied from interface:IClassReturn the integer that encodes the class's modifiers, as defined by the JVM specification- Returns:
- the integer that encodes the class's modifiers, as defined by the JVM specification
- Throws:
UnsupportedOperationException
-
getSuperclass
- Returns:
- the superclass, or null if java.lang.Object
-
getDirectInterfaces
- Returns:
- singleton set containing the relevant functional interface
-
getAllImplementedInterfaces
- Returns:
- relevant functional interface and all of its super-interfaces
-
getMethod
Description copied from interface:IClassFinds method matching signature. Delegates to superclass if not found.- Parameters:
selector- a method signature- Returns:
- IMethod from this class matching the signature; null if not found in this class or any superclass.
-
getField
-
getClassInitializer
- Returns:
- the method that is this class's initializer, or null if none
-
getDeclaredMethods
- Returns:
- an Iterator of the IMethods declared by this class.
-
getAllInstanceFields
Description copied from interface:IClassCompute the instance fields declared by this class or any of its superclasses. -
getAllStaticFields
Description copied from interface:IClassCompute the static fields declared by this class or any of its superclasses. -
getAllFields
Description copied from interface:IClassCompute the instance and static fields declared by this class or any of its superclasses. -
getAllMethods
Description copied from interface:IClassCompute the methods declared by this class or any of its superclasses. -
getDeclaredInstanceFields
Description copied from interface:IClassCompute the instance fields declared by this class.- Returns:
- Collection of IFields
-
getDeclaredStaticFields
- Returns:
- Collection of IField
-
isReferenceType
public boolean isReferenceType()Description copied from interface:IClassDoes 'this' refer to a reference type? If not, then it refers to a primitive type. -
getCaptureFieldName
get the synthetic field name for a value captured by the lambda- Parameters:
i- index of the captured value- Returns:
- the field name
-