Class DependentTypesError
java.lang.Object
org.checkerframework.framework.util.dependenttypes.DependentTypesError
Helper class for creating dependent type annotation error strings.
IMPORTANT: This is not an Exception. It is a regular class that is returned, not
thrown. The errors are not thrown so that they are only reported once rather than every time the
annotation is parsed. See DependentTypesHelper
for more details.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionDependentTypesError
(String expression, String error) Create a DependentTypesError for the given expression and error message.Create a DependentTypesError for the given expression and exception. -
Method Summary
Modifier and TypeMethodDescriptionboolean
format()
Like toString, but uses better formatting sometimes.int
hashCode()
static boolean
isExpressionError
(String expression) Returns whether or not the given expression string is an error.toString()
static DependentTypesError
Create a DependentTypesError by parsing a printed one.
-
Field Details
-
FORMAL_PARAM_NAME_STRING
How to format warnings about use of formal parameter name.- See Also:
-
expression
The expression that is unparsable or otherwise problematic. -
error
An error message about that expression.
-
-
Constructor Details
-
DependentTypesError
Create a DependentTypesError for the given expression and error message.- Parameters:
expression
- the incorrect Java expressionerror
- an error message about the expression
-
DependentTypesError
public DependentTypesError(String expression, JavaExpressionParseUtil.JavaExpressionParseException e) Create a DependentTypesError for the given expression and exception.- Parameters:
expression
- the incorrect Java expressione
- wraps an error message about the expression
-
-
Method Details
-
isExpressionError
Returns whether or not the given expression string is an error. That is, whether it is a string that was generated by this class.- Parameters:
expression
- expression string to test- Returns:
- whether or not the given expressions string is an error
-
unparse
Create a DependentTypesError by parsing a printed one.- Parameters:
formattedError
- the toString() representation of a DependentTypesError
-
equals
-
hashCode
public int hashCode() -
toString
-
format
Like toString, but uses better formatting sometimes. Use this only for the output, because of the design that hides error messages in toString().
-