Skip to content

Commit

Permalink
add comment about the necessity of unconditionally trimming the field…
Browse files Browse the repository at this point in the history
…s array
  • Loading branch information
esaulpaugh committed Sep 3, 2024
1 parent 83741ec commit bc435b3
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ private EnumTypeAdapter(final Class<T> classOfT) {
}
}

// Trim the array to the new length
// Trim the array to the new length. Every enum type can be expected to have at least
// one declared field which is not an enum constant, namely the implicit $VALUES array
fields = Arrays.copyOf(fields, constantCount);

AccessibleObject.setAccessible(fields, true);
Expand Down

0 comments on commit bc435b3

Please sign in to comment.