Skip to content

Commit

Permalink
Merge pull request #112 from davido/patch-1
Browse files Browse the repository at this point in the history
CmdLineParser: mark createOptionHandler() as non-deprecated
  • Loading branch information
kohsuke committed Jan 30, 2016
2 parents f9a1114 + d0a9de1 commit 17bf92c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions args4j/src/org/kohsuke/args4j/CmdLineParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ public void addArgument(Setter setter, Argument a) {
checkNonNull(setter, "Setter");
checkNonNull(a, "Argument");

OptionHandler h = OptionHandlerRegistry.getRegistry().createOptionHandler(this,
new OptionDef(a,setter.isMultiValued()),setter);
OptionHandler h = createOptionHandler(new OptionDef(a,setter.isMultiValued()),setter);
int index = a.index();
// make sure the argument will fit in the list
while (index >= arguments.size()) {
Expand Down Expand Up @@ -144,8 +143,7 @@ public void addOption(Setter setter, Option o) {
for (String alias : o.aliases()) {
checkOptionNotInMap(alias);
}
options.add(OptionHandlerRegistry.getRegistry().createOptionHandler(
this, new NamedOptionDef(o), setter));
options.add(createOptionHandler(new NamedOptionDef(o), setter));
}

/**
Expand Down Expand Up @@ -173,7 +171,6 @@ private void checkOptionNotInMap(String name) throws IllegalAnnotationError {
/**
* Creates an {@link OptionHandler} that handles the given {@link Option} annotation
* and the {@link Setter} instance.
* @deprecated You should use {@link OptionHandlerRegistry#createOptionHandler(org.kohsuke.args4j.CmdLineParser, org.kohsuke.args4j.OptionDef, org.kohsuke.args4j.spi.Setter) } instead.
*/
protected OptionHandler createOptionHandler(OptionDef o, Setter setter) {
checkNonNull(o, "OptionDef");
Expand Down

0 comments on commit 17bf92c

Please sign in to comment.