RFR: 8320234: Merge doclint.Env.AccessKind with tool.AccessKind

Jonathan Gibbons jjg at openjdk.org
Mon Nov 20 16:46:03 UTC 2023


On Mon, 20 Nov 2023 14:03:21 GMT, Pavel Rappo <prappo at openjdk.org> wrote:

> For better or worse, every enum exposes its constants' declaration order. That order may unexpectedly become relied upon elsewhere, and the author of the enum cannot do anything about it. T

Since any `enum` implements `Comparable`, it is not reasonable to say that the order may be relied on "unexpectedly".  It is an intentionally defined feature of the language design.   And the author _can_ do something about it: the author can choose not to reorder constants when the order is significant.

A more interesting design, back in the day, might have been to make `Comparable` an opt-in super type, but that's 20-20 hindsight and not the case.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16714#discussion_r1399474536


More information about the javadoc-dev mailing list