JDK-5109912 : (spec thread) Thread.enumerate() and Thread.activeCount() don't match ThreadGroup methods
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-10-01
  • Updated: 2007-08-18
  • Resolved: 2011-05-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7 Other
7 b19Fixed OpenJDK6Fixed
Related Reports
Relates :  
Description
Name: js151677			Date: 10/01/2004


A DESCRIPTION OF THE PROBLEM :
Thread.enumerate() does not discuss what happens if the array that is passed in is smaller than the number of threads being returned. Other details are missing too.

The documentation for Thread.enumerate() should be identical to ThreadGroup.enumerate() which is more complete.


URL OF FAULTY DOCUMENTATION :
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Thread.html#enumerate(java.lang.Thread[])
(Incident Review ID: 316083) 
======================================================================
###@###.### 10/22/04 19:31 GMT
Problems with Thread.activeCount doc are so similar to those of Thread.enumerate that this method's doc is being included in this bug fix.

Comments
EVALUATION The method descriptions of enumerate and activeCount in java.lang.Thread now closely resemble the descriptions of enumerate and activeCount in java.lang.ThreadGroup. As well as these changes ThreadGroup.activeGroupCount and the enumerate methods that take a ThreadGroup[] as an argument have been update. All changes are minor specification clarifications and only document existing behavior. The main changes to all of the above methods are as follows: - Minor spec clarifications to the 3 count methods, Thread.activeCount, ThreadGroup.activeCount and ThreadGroup.activeGroupCount, to indicate their recursive behavior. - Add a warning to all of these methods to indicate their potential inaccuracies and intended usage. - Clarify existing recursive behavior of enumerate methods.
08-08-2007

EVALUATION Yes, this needs to be fixed.
17-04-2007