Class CreatesMustCallForToJavaExpression
java.lang.Object
org.checkerframework.checker.mustcall.CreatesMustCallForToJavaExpression
Utility methods to convert targets of
@CreatesMustCallFor
annotations to JavaExpression
s.-
Method Summary
Modifier and TypeMethodDescriptionstatic List
<JavaExpression> getCreatesMustCallForExpressionsAtInvocation
(MethodInvocationNode n, GenericAnnotatedTypeFactory<?, ?, ?, ?> atypeFactory, CreatesMustCallForElementSupplier supplier) Returns the elements of the @CreatesMustCallFor annotations on the invoked method, as JavaExpressions.static List
<JavaExpression> getCreatesMustCallForExpressionsAtMethodDeclaration
(MethodTree tree, GenericAnnotatedTypeFactory<?, ?, ?, ?> atypeFactory, CreatesMustCallForElementSupplier supplier) Returns the elements of the @CreatesMustCallFor annotations on the method declaration, as JavaExpressions.
-
Method Details
-
getCreatesMustCallForExpressionsAtInvocation
public static List<JavaExpression> getCreatesMustCallForExpressionsAtInvocation(MethodInvocationNode n, GenericAnnotatedTypeFactory<?, ?, ?, ?> atypeFactory, CreatesMustCallForElementSupplier supplier) Returns the elements of the @CreatesMustCallFor annotations on the invoked method, as JavaExpressions. Returns the empty set if the given method has no @CreatesMustCallFor annotation.If any expression is unparseable, this method reports an error and returns the empty set.
- Parameters:
n
- a method invocationatypeFactory
- the type factory to report errors and parse the expression stringsupplier
- a type factory that can supply the executable elements for CreatesMustCallFor and CreatesMustCallFor.List's value elements. Usually, you should just pass atypeFactory again. The arguments are different so that the given type factory's adherence to both protocols are checked by the type system.- Returns:
- the arguments of the method's @CreatesMustCallFor annotation, or an empty list
-
getCreatesMustCallForExpressionsAtMethodDeclaration
public static List<JavaExpression> getCreatesMustCallForExpressionsAtMethodDeclaration(MethodTree tree, GenericAnnotatedTypeFactory<?, ?, ?, ?> atypeFactory, CreatesMustCallForElementSupplier supplier) Returns the elements of the @CreatesMustCallFor annotations on the method declaration, as JavaExpressions. Returns the empty set if the given method has no @CreatesMustCallFor annotation.If any expression is unparseable, this method reports an error and returns the empty set.
- Parameters:
tree
- a method declarationatypeFactory
- the type factory to report errors and parse the expression stringsupplier
- a type factory that can supply the executable elements for CreatesMustCallFor and CreatesMustCallFor.List's value elements. Usually, you should just pass atypeFactory again. The arguments are different so that the given type factory's adherence to both protocols are checked by the type system.- Returns:
- the arguments of the method's @CreatesMustCallFor annotation, or an empty list
-