Class TestDiagnostic

java.lang.Object
org.checkerframework.framework.test.diagnostics.TestDiagnostic

public class TestDiagnostic extends Object
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 Details Link icon

    • TestDiagnostic Link icon

      public TestDiagnostic(String filename, long lineNumber, DiagnosticKind kind, String message, boolean isFixable, boolean omitParentheses)
      Basic constructor that sets the immutable fields of this diagnostic.
  • Method Details Link icon

    • getFilename Link icon

      public String getFilename()
    • getLineNumber Link icon

      public long getLineNumber()
    • getKind Link icon

      public DiagnosticKind getKind()
    • getMessage Link icon

      public String getMessage()
    • isFixable Link icon

      public boolean isFixable()
    • shouldOmitParentheses Link icon

      public boolean shouldOmitParentheses()
      Returns whether or not the printed representation should omit parentheses around the message.
      Returns:
      whether or not the printed representation should omit parentheses around the message
    • equals Link icon

      public boolean equals(@Nullable Object otherObj)
      Equality is compared without isFixable/omitParentheses.
      Overrides:
      equals in class Object
      Returns:
      true if this and otherObj are equal according to filename, lineNumber, kind, and message
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString Link icon

      public String toString()
      Returns a representation of this diagnostic as if it appeared in a diagnostics file.
      Overrides:
      toString in class Object
      Returns:
      a representation of this diagnostic as if it appeared in a diagnostics file
    • repr Link icon

      public String repr()
      Returns the internal representation of this, formatted.
      Returns:
      the internal representation of this, formatted