Class BugInCF

All Implemented Interfaces:
Serializable

public class BugInCF extends RuntimeException
Exception type indicating a bug in the framework.

To indicate a bug in a checker implementation, use TypeSystemError. To indicate that an end user made a mistake, use UserError.

See Also:
  • Constructor Details

    • BugInCF

      public BugInCF(String message)
      Constructs a new BugInCF with the specified detail message and no cause (use this at the root cause).
      Parameters:
      message - the detail message
    • BugInCF

      @FormatMethod public BugInCF(String fmt, @Nullable Object... args)
      Constructs a new BugInCF with a detail message composed from the given arguments, and with no cause (use the current callstack as the root cause).
      Parameters:
      fmt - the format string
      args - the arguments for the format string
    • BugInCF

      public BugInCF(Throwable cause)
      Constructs a new BugInCF with the specified cause.
      Parameters:
      cause - the cause; its detail message will be used and must be non-null
    • BugInCF

      public BugInCF(@Nullable Tree location, Throwable cause)
      Constructs a new BugInCF with the specified cause.
      Parameters:
      location - where to report the bug
      cause - the cause; its detail message will be used and must be non-null
    • BugInCF

      @FormatMethod public BugInCF(Throwable cause, String fmt, @Nullable Object... args)
      Constructs a new BugInCF with the specified cause and with a detail message composed from the given arguments.
      Parameters:
      cause - the cause
      fmt - the format string
      args - the arguments for the format string
    • BugInCF

      public BugInCF(String message, Throwable cause)
      Constructs a new BugInCF with the specified detail message and cause.
      Parameters:
      message - the detail message
      cause - the cause
    • BugInCF

      public BugInCF(@Nullable Tree location, String message, Throwable cause)
      Constructs a new BugInCF with the specified detail message and cause.
      Parameters:
      location - where to report the bug
      message - the detail message
      cause - the cause
  • Method Details

    • getLocation

      public @Nullable Tree getLocation()
      Return the tree at which to report the exception.
      Returns:
      the tree at which to report the exception
    • addLocation

      public static BugInCF addLocation(Tree location, Throwable throwable)
      Adds the location to throwable. If throwable is a BugInCF that does not have a location, then its location is set to location.

      If throwable is not aBugInCF, then a BugInCF is created with location and cause throwable.

      Parameters:
      location - the location at which to report this bug
      throwable - a throwable whose location is set to location if it does not already have a location
      Returns:
      throwable if its a BugInCF otherwise a new BugInCF object