Class ReportChecker

All Implemented Interfaces:
Processor, OptionConfiguration

@SupportedOptions({"reportTreeKinds","reportModifiers"}) public class ReportChecker extends BaseTypeChecker
The Report Checker performs semantic searches over a program, for example, to find all methods that override a specific method, all classes that inherit from a specific class, or all uses of do-while loops (and not also while loops!).

The search is specified in two different ways.

The first way is to write a stub specification file using the annotations in org.checkerframework.common.util.report.qual.*. You can see examples in the Checker Framework repository at framework/tests/report/reporttest.astub and framework/jtreg/StubParserEnum/AnnotationFileParserEnum.astub.

The second way is the -AreportTreeKinds and -AreportModifiers options, which search for specific tree kinds or modifiers.

Some similar features are available from IDEs (e.g., show references), but this tool provides much more flexibility and a command-line tool.

Options:

  • -AreportTreeKinds: comma-separated list of Tree.Kinds that should be reported
  • -AreportModifiers: comma-separated list of modifiers that should be reported
See Also:
  • Constructor Details

    • ReportChecker

      public ReportChecker()
      Creates a ReportChecker.
  • Method Details

    • fullMessageOf

      protected String fullMessageOf(String messageKey, String defaultValue)
      Description copied from class: SourceChecker
      Returns the localized long message corresponding to this key. If not found, tries suffixes of this key, stripping off dot-separated prefixes. If still not found, returns defaultValue.
      Overrides:
      fullMessageOf in class SourceChecker
      Parameters:
      messageKey - a message key
      defaultValue - a default value to use if messageKey is not a message key
      Returns:
      the localized long message corresponding to this key or a suffix, or defaultValue