cbeust / jcommander

Command line parsing framework for Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] FuzzyMap.IKey is package private

shaburov opened this issue · comments

jcommander-1.78

image

I spent some time integrating jcommander and unit testing it. When I went to build the application package, I also came across this error. Since it is a simple fix, can I submit a PR and have this included in the 1.84 release?

It would be nice if someone could post a complete and comprehensible problem description. FuzzyMap is not intended to be part of the public API. We should replace it in the API by etc. Object.

While IKey may not be intended to be part of the public API, it is currently made public in the method on class JCommander:

public Map<IKey, ParameterDescription> getDescriptions() { return descriptions; }
I found it useful to be able interrogate the parameter descriptions using this method.

While the best solution might be to change the interface on JCommander so as not to expose IKey, the quick option is to make IKey public

public class FuzzyMap { public interface IKey { String getName(); } . .

Since this method is broken anyway, so no one could be using it, perhaps there is no harm in changing the interface to not expose IKey.

Since this method is broken anyway, so no one could be using it, perhaps there is no harm in changing the interface to not expose IKey.

We should go with that one.