Class Xplugin

java.lang.Object
com.qulice.errorprone.Xplugin

public final class Xplugin extends Object
The -Xplugin argument that wires ErrorProne into a forked javac, together with the bug patterns it leaves out.

Qulice switches a few patterns off for every project it checks, and the project appends -Xep flags of its own after them, so that a bug pattern which contradicts the project's domain has somewhere to go other than a @SuppressWarnings on every affected class. See #1734.

Since:
1.0
  • Constructor Details

    • Xplugin

      public Xplugin(String flags)
      Constructor.
      Parameters:
      flags - ErrorProne flags of the project, if any, separated by whitespace or commas
  • Method Details

    • argument

      public String argument()
      Build the javac argument.

      The flags of the project come last, so the project has the final say on every pattern, the ones Qulice disables included: ErrorProne reads the flags left to right and the last one naming a pattern wins. A project can therefore both switch a pattern off, with -Xep:UnusedVariable:OFF, and switch one back on, with -Xep:OperatorPrecedence:ERROR.

      Returns:
      The whole -Xplugin:ErrorProne ... argument
    • patterns

      public int patterns()
      How many bug patterns fire with these flags.

      ErrorProne answers this itself: the count starts at the patterns it enables by default and then the very flags the forked javac receives are applied to it, so a pattern Qulice switches off leaves the count and one the project switches back on rejoins it.

      Returns:
      The number of bug patterns that judge every file