JDK-8368784 : Wrong description in javadoc java.util.nextClearBit: Returns
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2025-09-26
  • Updated: 2025-09-26
  • Resolved: 2025-09-26
Related Reports
Duplicate :  
Relates :  
Description
A DESCRIPTION OF THE PROBLEM :
In  java.util.nextClearBit

public int nextClearBit(int fromIndex)
Returns: the index of the next clear bit

Should be:

Returns: the index of the next clearbit, or -1 if there is no such bit






Comments
According to the Java 2 Platform Std. Ed. v1.4 spec: "BitSet class implements a vector of bits that grows as needed." and "By default, all bits in the set initially have the value false." The line "If no such bit exists then -1 is returned" was removed as part of JDK-4350827.
26-09-2025