-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better error message while parsing enums #29
base: master
Are you sure you want to change the base?
Conversation
Can anyone please review this pull request. |
return valueOf.invoke(null, value); | ||
} | ||
catch (InvocationTargetException e) { | ||
String errorMsg = "Invalid " + name + ", Valid values are: " + Joiner.on(", ").join(type.getEnumConstants()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't abbreviate variable names. This can just be message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use String.format()
instead of concatenation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.getEnumConstants()
returns null
if the type is not an enum. This error message should only be generated for enums.
@electrum : I have addressed review comments. |
This need to use .name()
|
No description provided.