Class RemoveAnnotationsForInference

java.lang.Object
org.checkerframework.framework.stub.RemoveAnnotationsForInference

public class RemoveAnnotationsForInference extends Object
Process Java source files to remove annotations that ought to be inferred.

Removes annotations from all files in the given directories. Modifies the files in place.

Does not remove trusted annotations: those that the checker trusts rather than verifies.

Does not remove annotations at locations where inference does no work:

  • within the scope of a relevant @SuppressWarnings
  • within the scope of @IgnoreInWholeProgramInference or an annotation meta-annotated with that, such as @Option
After removing annotations, javac may issue "warning: [cast] redundant cast to ..." if -Alint:cast (or -Alint:all which implies it) is passed to javac. You can suppress the warning by passing -Alint:-cast to javac.
  • Constructor Details

    • RemoveAnnotationsForInference

      public RemoveAnnotationsForInference()
  • Method Details

    • main

      public static void main(String[] args)
      Processes each provided command-line argument; see class documentation for details.
      Parameters:
      args - command-line arguments: directories to process