[crac] RFR: JDKResource priorities [v3]
Alexey Bakhtin
abakhtin at openjdk.java.net
Thu Jan 6 18:07:26 UTC 2022
On Thu, 6 Jan 2022 14:53:17 GMT, Dan Heidinga <heidinga at openjdk.org> wrote:
>> Alexey Bakhtin has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Changed priority order in the enum
>
> src/java.base/share/classes/jdk/internal/crac/JDKContext.java line 38:
>
>> 36: @Override
>> 37: public int compare(Map.Entry<JDKResource, Void> o1, Map.Entry<JDKResource, Void> o2) {
>> 38: return o1.getKey().getPriority().ordinal() - o2.getKey().getPriority().ordinal();
>
> Enums are already comparable so we can use the built in compareTo method here but this isn't critical and shouldn't block merging
>
> Suggestion:
>
> return o1.getKey().getPriority().compareTo(o2.getKey().getPriority());
Hi @DanHeidinga !
Thank you for review. Yes, compareTo looks better. Updated.
-------------
PR: https://git.openjdk.java.net/crac/pull/8
More information about the crac-dev
mailing list