julianhyde commented on code in PR #2773:
URL: https://github.com/apache/calcite/pull/2773#discussion_r861906624
##########
core/src/main/java/org/apache/calcite/rel/externalize/RelEnumTypes.java:
##########
@@ -105,6 +107,6 @@ public static String fromEnum(Enum enumValue) {
/** Converts a string to an enum value.
* The converse of {@link #fromEnum(Enum)}. */
static <E extends Enum<E>> E toEnum(String name) {
- return (E) ENUM_BY_NAME.get(name);
+ return (E) Objects.requireNonNull(ENUM_BY_NAME.get(name));
Review Comment:
This seems to be a change in the method contract. Previously the method
would return null, now it throws. At least change the javadoc to make the
contract explicit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]