cbeust / jcommander

Command line parsing framework for Java
Apache License 2.0
1.96k stars 334 forks source link

[BUG] FuzzyMap.IKey is package private #505

Open shaburov opened 4 years ago

shaburov commented 4 years ago

jcommander-1.78

image

bluecontainer commented 11 months ago

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?

mkarg commented 11 months ago

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.

bluecontainer commented 11 months ago

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.

mkarg commented 11 months ago

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.