CmdLineParser: Suppress raw type warnings related to args4j classes

The version of args4j that we're using doesn't use generics, so
there's nothing we can reasonably do do fix these warnings. Just
suppress them.

Change-Id: If1b3c188ac6f47c8c3999547341032ad4803c090
This commit is contained in:
David Pursehouse
2018-11-17 09:49:51 -08:00
parent 70f5756144
commit c28b72b397

View File

@@ -503,10 +503,16 @@ public class CmdLineParser {
private class QueuedOption {
public final Option option;
@SuppressWarnings("rawtypes")
public final Setter setter;
public final String[] requiredOptions;
private QueuedOption(Option option, Setter setter, RequiresOptions requiresOptions) {
private QueuedOption(
Option option,
@SuppressWarnings("rawtypes") Setter setter,
RequiresOptions requiresOptions) {
this.option = option;
this.setter = setter;
this.requiredOptions = requiresOptions != null ? requiresOptions.value() : new String[0];
@@ -624,6 +630,7 @@ public class CmdLineParser {
* <p>Note: this is cut & pasted from the parent class in arg4j, it was private and it
* needed to be exposed.
*/
@SuppressWarnings("rawtypes")
public OptionHandler findOptionByName(String name) {
for (OptionHandler h : optionsList) {
NamedOptionDef option = (NamedOptionDef) h.option;
@@ -639,7 +646,10 @@ public class CmdLineParser {
return null;
}
private void queueOption(Option option, Setter setter, RequiresOptions requiresOptions) {
private void queueOption(
Option option,
@SuppressWarnings("rawtypes") Setter setter,
RequiresOptions requiresOptions) {
if (queuedOptionsByName.put(option.name(), new QueuedOption(option, setter, requiresOptions))
!= null) {
throw new IllegalAnnotationError(