Class SimplifyBooleanExpressionCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public class SimplifyBooleanExpressionCheck
    extends AbstractCheck

    Checks for over-complicated boolean expressions. Currently, it finds code like if (b == true), b || true, !false, boolean a = q > 12 ? true : false, etc.

    Rationale: Complex boolean logic makes code hard to understand and maintain.

    Parent is com.puppycrawl.tools.checkstyle.TreeWalker

    Violation Message Keys:

    • simplify.expression
    Since:
    3.0