JDK-4175101 : (thread) What is the ThreadGroup of a dead thread?
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS: generic
  • CPU: generic
  • Submitted: 1998-09-21
  • Updated: 2006-11-27
  • Resolved: 2006-11-27
Related Reports
Relates :  
Relates :  
Description
allan.jacobs@Eng 1998-09-21

In JDK 1.0.2 java.lang.Thread.getThreadGroup() was documented as follows:

"If this thread is alive, this method returns a reference to the ThreadGroup
object that represents the thread group to which this thread belongs.  If this
thread has died (has been stopped), this method returns null."

In JDK 1.2, the return value from a thread that has either been stopped
or has exited is null.  The specification in the JDK 1.2 docs is less precise
than it used to be:

"Returns this thread's thread group."

Is the terser wording intentional or an oversight?
Should the original wording be restored?



The JDK 1.2 documentation might still be considered to be complete on this question
if java.lang.ThreadGroup itself defined to exclude dead threads.  But, it is not.  The
definition of ThreadGroup reads:

"A thread group represents a set of threads.  In addition, a thread group can also
include other thread groups.  The thread groups form a tree in which every thread group
except the initial thread group has a parent."

Comments
EVALUATION The missing detail was restored in JDK 1.2 but the exact version/build is unknown.
27-11-2006