Class TestDiagnostic
java.lang.Object
org.checkerframework.framework.test.diagnostics.TestDiagnostic
Represents an expected error/warning message in a Java test file or an error/warning reported by
the Javac compiler. By contrast,
TestDiagnosticLine represents a set of TestDiagnostics,
all of which were read from the same line of a file.- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTestDiagnostic(String filename, long lineNumber, DiagnosticKind kind, String key, @Nullable String message, boolean isFixable) Basic constructor that sets the immutable fields of this diagnostic. -
Method Summary
Modifier and TypeMethodDescriptionbooleanEquality is compared without fieldsmessageandisFixable.getKey()Returns the error message key.getKind()longReturns the full error message, without the key.inthashCode()booleanReturns true if this diagnostic should no longer be reported after whole-program inference.repr()Returns the internal representation of this, formatted.toString()Returns a representation of this diagnostic as if it appeared in a diagnostics file.
-
Constructor Details
-
TestDiagnostic
public TestDiagnostic(String filename, long lineNumber, DiagnosticKind kind, String key, @Nullable String message, boolean isFixable) Basic constructor that sets the immutable fields of this diagnostic.- Parameters:
filename- the file to which the diagnostic applieslineNumber- the line number to which the diagnostic applieskind- kind of diagnostickey- an error key or full error messagemessage- the full error message, without the key; null if the key is the whole messageisFixable- true if this diagnostic should no longer be reported after whole-program inference
-
-
Method Details
-
getFilename
-
getLineNumber
public long getLineNumber() -
getKind
-
getKey
Returns the error message key.- Returns:
- the error message key
-
getMessage
Returns the full error message, without the key.- Returns:
- the full error message, without the key
-
isFixable
public boolean isFixable()Returns true if this diagnostic should no longer be reported after whole-program inference.- Returns:
- true if this diagnostic should no longer be reported after whole-program inference
-
equals
Equality is compared without fieldsmessageandisFixable. -
hashCode
public int hashCode() -
toString
Returns a representation of this diagnostic as if it appeared in a diagnostics file. -
repr
Returns the internal representation of this, formatted.- Returns:
- the internal representation of this, formatted
-