Class InnerAssignmentCheck

  • All Implemented Interfaces:
    Configurable, Contextualizable

    public class InnerAssignmentCheck
    extends AbstractCheck

    Checks for assignments in subexpressions, such as in String s = Integer.toString(i = 2);.

    Rationale: With the exception of for iterators, all assignments should occur in their own top-level statement to increase readability. With inner assignments like the above it is difficult to see all places where a variable is set.

    Author:
    lkuehne