Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8298380

Clean up redundant array length checks in JDK code base

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 21
    • None
    • core-libs
    • None
    • b02

      Newer version of IntelliJ IDEA introduces new inspection detecting redundant array length check in snippets like
      <T> void iterate(T[] items) {
        if (items.length == 0) {
          return;
        }
        for (T item : items) {
          //...
        }
      }

      Here
        if (items.length == 0) {
          return;
        }
      is redundant and can be removed.

            stsypanov Sergey Tsypanov
            stsypanov Sergey Tsypanov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: