ottlinger commented on code in PR #582:
URL: https://github.com/apache/creadur-rat/pull/582#discussion_r2513976589
##########
apache-rat-tools/src/main/java/org/apache/rat/documentation/options/AntOption.java:
##########
@@ -287,9 +282,11 @@ public String getComment(final boolean addParam) {
arg = "The state";
}
if (option.getArgName() != null) {
- Supplier<String> sup =
OptionCollection.getArgumentTypes().get(option.getArgName());
- if (sup == null) {
- throw new IllegalStateException(format("Argument type %s
must be in OptionCollection.ARGUMENT_TYPES", option.getArgName()));
+ String argName = option.getArgName().toUpperCase(Locale.ROOT);
+ try {
+ OptionCollection.ArgumentType.valueOf(argName);
+ } catch (IllegalArgumentException e) {
+ throw new IllegalStateException(format("Argument type %s
must be in OptionCollection.ArgumentType", option.getArgName()));
Review Comment:
Should we reference the ArgumentType class here in a compiler-safe way such
as
OptionCollection.ArgumentType.class.getSimpleName() to make it
refactoring-proof?
--
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]