java.util.BitSet.nextClearBit(int) in jdk1.4 has wrong javadoc comments

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 1.4.0
    • Affects Version/s: 1.4.0
    • Component/s: docs
    • beta
    • sparc
    • solaris_2.6



      Name: auR10023 Date: 06/30/2000



      java.util.BitSet.nextClearBit(int) in jdk1.4 has wrong javadoc comments.

      ...
           Returns the index of the first bit that is set to false that occurs on or after the
           specified starting index. If no such bit exists then -1 is returned. To iterate over
           the false bits in a BitSet, use the following loop: for(int i=bs.nextClearBit(0);
                                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
           i>=0; i=bs.nextClearBit(i+1)) { // operate on index i here }
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      ...

      The sample code in this text contains infinitive loop for any BitSet.

      ======================================================================

            Assignee:
            Jamie Ho (Inactive)
            Reporter:
            Avu Avu (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: