RFR: 8052260: Reference.isEnqueued() spec does not match the long-standing behavior returning true iff it's in the ref queue [v2]

Mandy Chung mchung at openjdk.java.net
Tue Dec 8 20:14:37 UTC 2020


On Tue, 8 Dec 2020 19:35:39 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Mandy Chung has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
>> 
>>  - Merge branch 'master' of https://github.com/openjdk/jdk into isEnqueued
>>  - Merge branch 'master' of https://github.com/openjdk/jdk into isEnqueued
>>  - add suppress warnings
>>  - 8052260: Reference.isEnqueued() spec does not match the long-standing behavior returning true iff it's in the ref queue
>
> src/java.base/share/classes/java/lang/ref/Reference.java line 430:
> 
>> 428:      * This method was never implemented to test if a reference object has
>> 429:      * been cleared and enqueued as it was previously specified since 1.2.
>> 430:      * This method could be misused due to the inherent race condition
> 
> A small suggestion is to restructure the first sentence of the deprecated message to say "This method was originally specified to test .. but was never implemented to do this test", otherwise looks okay.

Yes, it reads better and we can also drop "as it was previously specified since 1.2".

     * This method was originally specified to test if a reference object has
     * been cleared and enqueued but was never implemented to do this test.

-------------

PR: https://git.openjdk.java.net/jdk/pull/1684


More information about the core-libs-dev mailing list