jcommander icon indicating copy to clipboard operation
jcommander copied to clipboard

[BUG] FuzzyMap.IKey is package private

Open shaburov opened this issue 5 years ago • 4 comments

jcommander-1.78

image

shaburov avatar Oct 18 '20 11:10 shaburov

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?

bluecontainer avatar Nov 09 '23 15:11 bluecontainer

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.

mkarg avatar Nov 10 '23 16:11 mkarg

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.

bluecontainer avatar Nov 14 '23 14:11 bluecontainer

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.

mkarg avatar Nov 16 '23 19:11 mkarg