Class PurityUtils
- java.lang.Object
-
- org.checkerframework.dataflow.util.PurityUtils
-
public class PurityUtils extends java.lang.Object
- See Also:
SideEffectFree
,Deterministic
,Pure
-
-
Constructor Summary
Constructors Constructor Description PurityUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.util.EnumSet<Pure.Kind>
getPurityKinds(AnnotationProvider provider, com.sun.source.tree.MethodTree methodTree)
Returns the purity annotations on the methodmethodTree
.static java.util.EnumSet<Pure.Kind>
getPurityKinds(AnnotationProvider provider, javax.lang.model.element.ExecutableElement methodElement)
Returns the purity annotations on the methodmethodElement
.static boolean
hasPurityAnnotation(AnnotationProvider provider, com.sun.source.tree.MethodTree methodTree)
Does the methodmethodTree
have any purity annotation?static boolean
hasPurityAnnotation(AnnotationProvider provider, javax.lang.model.element.ExecutableElement methodElement)
Does the methodmethodElement
have any purity annotation?static boolean
isDeterministic(AnnotationProvider provider, com.sun.source.tree.MethodTree methodTree)
Is the methodmethodTree
deterministic?static boolean
isDeterministic(AnnotationProvider provider, javax.lang.model.element.ExecutableElement methodElement)
Is the methodmethodElement
deterministic?static boolean
isSideEffectFree(AnnotationProvider provider, com.sun.source.tree.MethodTree methodTree)
static boolean
isSideEffectFree(AnnotationProvider provider, javax.lang.model.element.ExecutableElement methodElement)
Is the methodmethodElement
side-effect-free?
-
-
-
Method Detail
-
hasPurityAnnotation
public static boolean hasPurityAnnotation(AnnotationProvider provider, com.sun.source.tree.MethodTree methodTree)
Does the methodmethodTree
have any purity annotation?- Parameters:
provider
- how to get annotationsmethodTree
- a method to test- Returns:
- whether the method has any purity annotations
-
hasPurityAnnotation
public static boolean hasPurityAnnotation(AnnotationProvider provider, javax.lang.model.element.ExecutableElement methodElement)
Does the methodmethodElement
have any purity annotation?- Parameters:
provider
- how to get annotationsmethodElement
- a method to test- Returns:
- whether the method has any purity annotations
-
isDeterministic
public static boolean isDeterministic(AnnotationProvider provider, com.sun.source.tree.MethodTree methodTree)
Is the methodmethodTree
deterministic?- Parameters:
provider
- how to get annotationsmethodTree
- a method to test- Returns:
- whether the method is deterministic
-
isDeterministic
public static boolean isDeterministic(AnnotationProvider provider, javax.lang.model.element.ExecutableElement methodElement)
Is the methodmethodElement
deterministic?- Parameters:
provider
- how to get annotationsmethodElement
- a method to test- Returns:
- whether the method is deterministic
-
isSideEffectFree
@Deprecated public static boolean isSideEffectFree(AnnotationProvider provider, com.sun.source.tree.MethodTree methodTree)
Is the methodmethodTree
side-effect-free?This method does not use, and has different semantics than,
AnnotationProvider.isSideEffectFree(javax.lang.model.element.ExecutableElement)
. This method is concerned only with standard purity annotations.- Parameters:
provider
- how to get annotationsmethodTree
- a method to test- Returns:
- whether the method is side-effect-free
-
isSideEffectFree
public static boolean isSideEffectFree(AnnotationProvider provider, javax.lang.model.element.ExecutableElement methodElement)
Is the methodmethodElement
side-effect-free?This method does not use, and has different semantics than,
AnnotationProvider.isSideEffectFree(javax.lang.model.element.ExecutableElement)
. This method is concerned only with standard purity annotations.- Parameters:
provider
- how to get annotationsmethodElement
- a method to test- Returns:
- whether the method is side-effect-free
-
getPurityKinds
public static java.util.EnumSet<Pure.Kind> getPurityKinds(AnnotationProvider provider, com.sun.source.tree.MethodTree methodTree)
Returns the purity annotations on the methodmethodTree
.- Parameters:
provider
- how to get annotationsmethodTree
- a method to test- Returns:
- the types of purity of the method
methodTree
-
getPurityKinds
public static java.util.EnumSet<Pure.Kind> getPurityKinds(AnnotationProvider provider, javax.lang.model.element.ExecutableElement methodElement)
Returns the purity annotations on the methodmethodElement
.- Parameters:
provider
- how to get annotationsmethodElement
- a method to test- Returns:
- the types of purity of the method
methodElement
-
-