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

calling com.sun.tools.jdi.ReferenceTypeImpl.methods() always adds another wrappe

    XMLWordPrintable

Details

    • b46
    • generic, sparc, itanium
    • generic, linux, solaris_10

    Description



      The problem is that whenever methods() in com.sun.tools.jdi.ReferenceTypeImpl
      is called, it adds another UnmodifiableList around the list of methods it
      already has. If the method is called many times, as is often is by the JDI
      implementation, the underlying list will have thousands of wrappers around
      it.

      This will eventually cause a StackOverflowError when the code gets an
      iterator for the list, as each UnmodifiableList wrapper causes two methods on
      the stack. It also uses memory for no reason, as each wrapper accomplishes
      nothing.

      The fix should be simple - only wrap the underlying method list the first
      time, and if it's already been cached, it doesn't need to be re-wrapped.

      ###@###.### 2004-03-31
      This causes regression test
         com/sun/jdi/GetSetLocalTest.java
      to fail on linux-ia64 and other platforms.
      See bug 4947842 which is closed as a dup of this bug.

      Attachments

        Issue Links

          Activity

            People

              sspitsyn Serguei Spitsyn
              mmma Marvin Ma (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: