Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.3
    • Component/s: None
    • Labels:
      None

      Description

      Type

      Replacement of tokens.

      Approach

      The rule only suggests the usage of isEmpty, without taking care of mentioning if the expected comparison was "not empty" or "empty". We have to add some logic to differentiate the two cases for the quick fix.

      Before

      if (myCollection.size() == 0) { }
      boolean b = 1 > myCollection.size();
      

      After

      if (myCollection.isEmpty()) { }
      boolean b = myCollection.isEmpty();
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              quentin.jaquier Quentin Jaquier
              Reporter:
              quentin.jaquier Quentin Jaquier
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: