lint warning for boolean assignment in if/loop condition

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Rejected
    • Priority: P4
    • None
    • Affects Version/s: 7
    • Component/s: tools
    • generic
    • generic

      CR 6978122 provides an example in which the user is surprised that "if (a = null) ___" compiles when a has type Boolean. Mistaking "=" for "==" is a common error, and the use of the former in a condition is almost always a mistake. It would be useful to provide a lint warning for such cases (both where the type is Boolean and the type is boolean).

      Note that Eclipse has such a warning.

            Assignee:
            Unassigned
            Reporter:
            Dan Smith
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: