Claudenw commented on code in PR #230:
URL: https://github.com/apache/commons-cli/pull/230#discussion_r1490712110


##########
src/main/java/org/apache/commons/cli/Options.java:
##########
@@ -231,8 +243,9 @@ public OptionGroup getOptionGroup(final Option opt) {
      * Gets the OptionGroups that are members of this Options instance.
      *
      * @return a Collection of OptionGroup instances.
+     * @since 1.7.0
      */
-    Collection<OptionGroup> getOptionGroups() {
+    public Collection<OptionGroup> getOptionGroups() {

Review Comment:
   Reverting the change.  I put it in in my codebase when the 
Options#addOptions(Options) method did not exist so I could implement that.  
The code is what was originally in the code base prior to 1.7.0
   
   I'll add some notes to the code base to answer your questions, but 
basically. the OptionGroups is a map of Option to OptionGroup.  So the 
OptionGroup (value) will occur multiple times in the Map#getValues() list.  
Creating a Set simply filters them out.  Returning it as a collection seems 
appropriate as Options are returned as a collection and it keeps a symmetry. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@commons.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to