Class StringLiteralEqualityCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public class StringLiteralEqualityCheck
    extends AbstractCheck

    Checks that string literals are not used with == or !=.

    Rationale: Novice Java programmers often use code like if (x == "something") when they mean if ("something".equals(x)).

    Author:
    Lars Kühne