-
Notifications
You must be signed in to change notification settings - Fork 62
[spec] Eclipse's JDI implementation does not count disable/enableCollection() #877
Description
Transferring https://bugs.eclipse.org/bugs/show_bug.cgi?id=574500 over.
In https://bugs.openjdk.java.net/browse/JDK-8269232 we've discovered that Eclipse's implementation of the JDI spec does not seem to be conforming to spec. The Javadoc of ObjectReference.disableCollection() says[1]:
"""
Calls to this method are counted. Every call to this method requires a corresponding call to enableCollection() before garbage collection is re-enabled.
"""... while the implementation doesn't seem to be doing such counting. See:
https://github.com/eclipse/eclipse.jdt.debug/blob/9d267305a774f5db042c71412370c915e83208f4/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ObjectReferenceImpl.java#L99..L108
https://github.com/eclipse/eclipse.jdt.debug/blob/9d267305a774f5db042c71412370c915e83208f4/org.eclipse.jdt.debug/jdi/org/eclipse/jdi/internal/ObjectReferenceImpl.java#L114..L123Contrast this to the implementation in OpenJDK:
https://github.com/openjdk/jdk/blob/e515873f887ce4071ab4878a4bafca8eea67afea/src/jdk.jdi/share/classes/com/sun/tools/jdi/ObjectReferenceImpl.java#L435..L444
https://github.com/openjdk/jdk/blob/e515873f887ce4071ab4878a4bafca8eea67afea/src/jdk.jdi/share/classes/com/sun/tools/jdi/ObjectReferenceImpl.java#L447..L461We believe this to be not conforming to the JDI spec and should get fixed.