-
Bug
-
Resolution: Unresolved
-
P4
-
9
-
generic
-
generic
Justification obtained from the swing-dev alias in the review-request for 8145547 :
javadoc for ordinal:
"Most programmers will have no use for this method. It is designed for use by sophisticated enum-based data structures, such as EnumSet and EnumMap."
Quote from the internet:
"This is not recommended to use ordinal() (Effective Java, Item 31) as it relies on the order of the enum values in client's code determine the ordinal, and any change could lead to bad values being mapped.
Instead, it would be better to have users implement a method that would return a unique ID for an enum value. For instance, with an Identifiable interface that has a unique method id(), that the user would have to implement for every enum value."
javadoc for ordinal:
"Most programmers will have no use for this method. It is designed for use by sophisticated enum-based data structures, such as EnumSet and EnumMap."
Quote from the internet:
"This is not recommended to use ordinal() (Effective Java, Item 31) as it relies on the order of the enum values in client's code determine the ordinal, and any change could lead to bad values being mapped.
Instead, it would be better to have users implement a method that would return a unique ID for an enum value. For instance, with an Identifiable interface that has a unique method id(), that the user would have to implement for every enum value."