[crac] RFR: JDKResource priorities [v3]

Dan Heidinga duke at openjdk.java.net
Thu Jan 6 14:58:48 UTC 2022


On Fri, 24 Dec 2021 16:15:07 GMT, Alexey Bakhtin <abakhtin at openjdk.org> wrote:

>> Added priority enumeration for the JDK resources
>> It will allow better handling the order of checkpoint notifications for dependent resources
>
> Alexey Bakhtin has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Changed priority order in the enum

Marked as reviewed by DanHeidinga at github.com (no known OpenJDK username).

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());

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

PR: https://git.openjdk.java.net/crac/pull/8


More information about the crac-dev mailing list