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.
- duplicates
-
JDK-4947842 Server: com/sun/jdi/GetSetLocalTest.java failed with StackOverflowError
- Closed