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

Description of Thread.enumerate(Thread[]) is misleading.

    XMLWordPrintable

Details

    • beta2
    • sparc
    • solaris_2.5

    Description



      Name: akC45999 Date: 07/13/99



      The description of java.lang.Thread.enumerate(Thread[]) reads:

         public static int enumerate(Thread[] tarray)

         Copies into the specified array every active thread in this thread's
         thread group and its subgroups.

      The word 'this' in method descriptions usually means the object
      to which the method is applied. Thus, in the text:

        Thread thrd=new Thread();
        thrd.enumerate(...)

      this would mean 'thrd'.

      But the method is static so the object reference is ignored,
      and the code

        thrd.enumerate(...)

      is equivalent to the

        Thread.enumerate(...)

      and the method enumerate() in the code
      is applied to the current thread and not to the thread 'thrd'.

      So the words

        ... every active thread in this thread's thread group

      should be replaced with

         ... every active thread in the current thread's thread group

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

      Attachments

        Issue Links

          Activity

            People

              jjb Josh Bloch
              duke J. Duke
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: