eclipse-jdt / eclipse-jdt/eclipse.jdt.debug

[spec] Eclipse's JDI implementation does not count disable/enableCollection()

Open
#877 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
23
Forks
68
Avg merge
1d 4h
Merged PRs (30d)
13

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..L123
>
>
> Contrast 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..L461
>
> We believe this to be not conforming to the JDI spec and should get fixed.
>
> [1] https://docs.oracle.com/en/java/javase/16/docs/api/jdk.jdi/com/sun/jdi/ObjectReference.html#disableCollection()

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.