Class PurityUtils
java.lang.Object
org.checkerframework.dataflow.util.PurityUtils
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetPurityKinds
(AnnotationProvider provider, MethodTree methodTree) Returns the purity annotations on the methodmethodTree
.getPurityKinds
(AnnotationProvider provider, ExecutableElement methodElement) Returns the purity annotations on the methodmethodElement
.static boolean
hasPurityAnnotation
(AnnotationProvider provider, MethodTree methodTree) Does the methodmethodTree
have any purity annotation?static boolean
hasPurityAnnotation
(AnnotationProvider provider, ExecutableElement methodElement) Does the methodmethodElement
have any purity annotation?static boolean
isDeterministic
(AnnotationProvider provider, MethodTree methodTree) Is the methodmethodTree
deterministic?static boolean
isDeterministic
(AnnotationProvider provider, ExecutableElement methodElement) Is the methodmethodElement
deterministic?static boolean
isSideEffectFree
(AnnotationProvider provider, MethodTree methodTree) Deprecated.static boolean
isSideEffectFree
(AnnotationProvider provider, ExecutableElement methodElement) Is the methodmethodElement
side-effect-free?
-
Constructor Details
-
PurityUtils
public PurityUtils()
-
-
Method Details
-
hasPurityAnnotation
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, 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
Is the methodmethodTree
deterministic?- Parameters:
provider
- how to get annotationsmethodTree
- a method to test- Returns:
- whether the method is deterministic
-
isDeterministic
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, 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, 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
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 EnumSet<Pure.Kind> getPurityKinds(AnnotationProvider provider, 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
-
AnnotationProvider.isSideEffectFree(javax.lang.model.element.ExecutableElement)