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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.4.0
    • 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.

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

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: