Skip to content
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

CmdLineParser: mark createOptionHandler() as non-deprecated #112

Merged
merged 1 commit into from
Jan 30, 2016
Merged

CmdLineParser: mark createOptionHandler() as non-deprecated #112

merged 1 commit into from
Jan 30, 2016

Conversation

davido
Copy link
Contributor

@davido davido commented May 11, 2015

Since b1aa90f the createOptionHandler() was
deprecated and the user was routed to OptionHandlerRegistry method
instead. As a side effect the overridding of the now deprecated method
createOptionHandler() doesn't have any effect, because this method is
not get called any more from the addOption() and addArgument() methods.

The documented OptionHandlerRegistry.registerHandler() machinery cannot
be used, when a DI framework is used and the instances must be created by
the injector.

Mark createOptionHandler as non deprecated again and use it from addOption()
and addArgument() methods.

This commit partial reverts b1aa90f

Since b1aa90f the createOptionHandler() was
deprecated and the user was routed to OptionHandlerRegistry method
instead. As a side effect the overridding of the now deprecated method
createOptionHandler() doesn't have any effect, because this method is
not get called any more from the addOption() and addArgument() methods.

The documented OptionHandlerRegistry.registerHandler() machinery cannot
be used, when a DI framework is used and the instances must be created by
the injector.

Mark createOptionHandler as non deprecated again and use it from addOption()
and addArgument() methods.

This commit partial reverts b1aa90f
@buildhive
Copy link

Kohsuke Kawaguchi » args4j #174 FAILURE
Looks like there's a problem with this pull request
(what's this?)

@javaerb
Copy link
Contributor

javaerb commented Oct 9, 2015

Perhaps there is a better solution to this, for example making the registry a singleton via OptionHandlerRegistry.getOnlyInstance(), which would allow it to work with DI by binding the instance to the contract.

@kohsuke
Copy link
Owner

kohsuke commented Jan 30, 2016

Being able to override createOptionHandler is an useful hook, and it was certainly one that we've supported. So I'm going to merge this change.

kohsuke added a commit that referenced this pull request Jan 30, 2016
CmdLineParser: mark createOptionHandler() as non-deprecated
@kohsuke kohsuke merged commit 17bf92c into kohsuke:master Jan 30, 2016
sebasjm pushed a commit to sebasjm/args4j that referenced this pull request Mar 11, 2018
CmdLineParser: mark createOptionHandler() as non-deprecated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants