Class PurityUtils
java.lang.Object
org.checkerframework.dataflow.util.PurityUtils
A utility class for working with the
SideEffectFree, Deterministic, and Pure annotations.- See Also:
-
SideEffectFreeDeterministicPure
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic EnumSet<org.checkerframework.dataflow.qual.Pure.Kind>getPurityKinds(org.checkerframework.javacutil.AnnotationProvider provider, MethodTree methodTree) Returns the purity annotations on the methodmethodTree.static EnumSet<org.checkerframework.dataflow.qual.Pure.Kind>getPurityKinds(org.checkerframework.javacutil.AnnotationProvider provider, ExecutableElement methodElement) Returns the purity annotations on the methodmethodElement.static booleanhasPurityAnnotation(org.checkerframework.javacutil.AnnotationProvider provider, MethodTree methodTree) Does the methodmethodTreehave any purity annotation?static booleanhasPurityAnnotation(org.checkerframework.javacutil.AnnotationProvider provider, ExecutableElement methodElement) Does the methodmethodElementhave any purity annotation?static booleanisDeterministic(org.checkerframework.javacutil.AnnotationProvider provider, MethodTree methodTree) Is the methodmethodTreedeterministic?static booleanisDeterministic(org.checkerframework.javacutil.AnnotationProvider provider, ExecutableElement methodElement) Is the methodmethodElementdeterministic?static booleanisSideEffectFree(org.checkerframework.javacutil.AnnotationProvider provider, MethodTree methodTree) Deprecated.static booleanisSideEffectFree(org.checkerframework.javacutil.AnnotationProvider provider, ExecutableElement methodElement) Is the methodmethodElementside-effect-free?
-
Constructor Details
-
PurityUtils
public PurityUtils()
-
-
Method Details
-
hasPurityAnnotation
public static boolean hasPurityAnnotation(org.checkerframework.javacutil.AnnotationProvider provider, MethodTree methodTree) Does the methodmethodTreehave 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(org.checkerframework.javacutil.AnnotationProvider provider, ExecutableElement methodElement) Does the methodmethodElementhave 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(org.checkerframework.javacutil.AnnotationProvider provider, MethodTree methodTree) Is the methodmethodTreedeterministic?- Parameters:
provider- how to get annotationsmethodTree- a method to test- Returns:
- whether the method is deterministic
-
isDeterministic
public static boolean isDeterministic(org.checkerframework.javacutil.AnnotationProvider provider, ExecutableElement methodElement) Is the methodmethodElementdeterministic?- Parameters:
provider- how to get annotationsmethodElement- a method to test- Returns:
- whether the method is deterministic
-
isSideEffectFree
@Deprecated public static boolean isSideEffectFree(org.checkerframework.javacutil.AnnotationProvider provider, MethodTree methodTree) Deprecated.useAnnotationProvider.isSideEffectFree(javax.lang.model.element.ExecutableElement)Is the methodmethodTreeside-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(org.checkerframework.javacutil.AnnotationProvider provider, ExecutableElement methodElement) Is the methodmethodElementside-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 EnumSet<org.checkerframework.dataflow.qual.Pure.Kind> getPurityKinds(org.checkerframework.javacutil.AnnotationProvider provider, 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 EnumSet<org.checkerframework.dataflow.qual.Pure.Kind> getPurityKinds(org.checkerframework.javacutil.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)