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

Enhancement: Provide controlled access to the stack.

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.3.0
    • core-libs
    • generic
    • generic



      Name: boT120536 Date: 04/12/2001


      java version "1.3.0_02"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0_02)
      Java HotSpot(TM) Client VM (build 1.3.0_02, mixed mode)


      It should be possible to walk a Threads stack.

      If the Thread Class provided a method getStack() which returned a new public
      Stack class (or an enumeration of StackObjects). It would be possible to walk
      the Stack of a Thread.

      The following would be possible, and extremely useful for logging and error
      reporting, and debugging.

        Stack stack = Thread.getStack() ;
        Enumeration enum = stack.getAttributeNames() ;
        while( enum.hasMoreElements() )
          {
            Object stackObject = enum.nextElement() ;
            stackObject.getClass().getName() ;
            stackObject.getClass().get ...
            ...
          }
      (Review ID: 120541)
      ======================================================================

            jjb Josh Bloch (Inactive)
            bonealsunw Bret O'neal (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: