Class DetailedTestDiagnostic
java.lang.Object
org.checkerframework.framework.test.diagnostics.TestDiagnostic
org.checkerframework.framework.test.diagnostics.DetailedTestDiagnostic
Represents a detailed error/warning message reported by the Checker Framework when the
-Adetailedmsgtext
flag is used. By contrast, TestDiagnostic
represents a simple expected
error/warning message in a Java test file or an error/warning reported by the Java compiler
without the -Adetailedmsgtext
flag.-
Field Summary
FieldsModifier and TypeFieldDescriptionAdditional tokens that are part of the diagnostic message.protected final long
The end position of the diagnostic in the source file.protected final long
The start position of the diagnostic in the source file.Fields inherited from class org.checkerframework.framework.test.diagnostics.TestDiagnostic
file, filename, isFixable, kind, lineNumber, message, messageKey, messageKeyParens
-
Constructor Summary
ConstructorsConstructorDescriptionDetailedTestDiagnostic
(Path file, long lineNo, DiagnosticKind kind, String messageKey, List<String> additionalTokens, long startPosition, long endPosition, String readableMessage, boolean isFixable) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Equality is compared without isFixable and messageKeyParens.The additional tokens that are part of the diagnostic message.long
The end position of the diagnostic in the source file.long
The start position of the diagnostic in the source file.int
hashCode()
toString()
Returns a representation of this diagnostic as if it appeared as a detailed message.Methods inherited from class org.checkerframework.framework.test.diagnostics.TestDiagnostic
getFile, getFilename, getKind, getLineNumber, getMessage, getMessageKey, isFixable, keepFullMessage, repr
-
Field Details
-
additionalTokens
Additional tokens that are part of the diagnostic message. -
startPosition
protected final long startPositionThe start position of the diagnostic in the source file. -
endPosition
protected final long endPositionThe end position of the diagnostic in the source file.
-
-
Constructor Details
-
DetailedTestDiagnostic
public DetailedTestDiagnostic(Path file, long lineNo, DiagnosticKind kind, String messageKey, List<String> additionalTokens, long startPosition, long endPosition, String readableMessage, boolean isFixable) Create a new instance.- Parameters:
file
- the file in which the diagnostic occurredlineNo
- the line number in the file at which the diagnostic occurredkind
- the kind of diagnostic (error or warning)messageKey
- a message key that usually appears between parentheses in diagnostic messagesadditionalTokens
- additional tokens that are part of the diagnostic messagestartPosition
- the start position of the diagnostic in the source fileendPosition
- the end position of the diagnostic in the source filereadableMessage
- a human-readable message describing the diagnosticisFixable
- whether the diagnostic is fixable
-
-
Method Details
-
getAdditionalTokens
The additional tokens that are part of the diagnostic message.- Returns:
- the additional tokens
-
getStartPosition
public long getStartPosition()The start position of the diagnostic in the source file.- Returns:
- the start position
-
getEndPosition
public long getEndPosition()The end position of the diagnostic in the source file.- Returns:
- the end position
-
equals
Equality is compared without isFixable and messageKeyParens.- Overrides:
equals
in classTestDiagnostic
- Returns:
- true if this and otherObj are equal according to additionalTokens, startPosition, endPosition, and equality of the superclass.
-
hashCode
public int hashCode()- Overrides:
hashCode
in classTestDiagnostic
-
toString
Returns a representation of this diagnostic as if it appeared as a detailed message.- Overrides:
toString
in classTestDiagnostic
- Returns:
- a representation of this diagnostic as if it appeared as a detailed message
- See Also:
-