Skip to content

Conversation

@Claudenw
Copy link
Contributor

@Claudenw Claudenw commented Nov 1, 2025

AbstractHelpFormatter:

  • Swapped printHelp using Iterable with printHelp using Options. Effectively switching to using Options class to print the help.

  • Removed public String toSyntaxOptions(final Iterable options) as it was added in this version and should have only been used internally.

HelpFormatterTest:

  • removed toSyntaxOptions using Iterable test.

  • added a printHelpTest with Iterable as previously we depended on printHelpTest with Option to test the code branch.

  • added verifyOptionGroupingOutput as a test to show that reported issue is corrected.

Thanks for your contribution to Apache Commons! Your help is appreciated!

Before you push a pull request, review this list:

  • Read the contribution guidelines for this project.
  • Read the ASF Generative Tooling Guidance if you use Artificial Intelligence (AI).
  • I used AI to create any part of, or all of, this pull request.
  • Run a successful build using the default Maven goal with mvn; that's mvn on the command line by itself.
  • Write unit tests that match behavioral changes, where the tests fail if the changes to the runtime are not applied. This may not always be possible, but it is a best practice.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Each commit in the pull request should have a meaningful subject line and body. Note that a maintainer may squash commits during the merge process.

AbstractHelpFormatter:

 * Swapped printHelp using Iterable<Option> with printHelp using Options.  Effectively switching to using Options class to print the help.

 * Removed public String toSyntaxOptions(final Iterable<Option> options) as it was added in this version and should have only been used internally.

HelpFormatterTest:

 * removed toSyntaxOptions using Iterable<Option> test.

 * added a printHelpTest with Iterable<Option> as previously we depended on printHelpTest with Option to test the code branch.

 * added verifyOptionGroupingOutput as a test to show that reported issue is corrected.
@Claudenw Claudenw requested a review from garydgregory November 1, 2025 16:56
@Claudenw Claudenw marked this pull request as draft November 1, 2025 16:57
@Claudenw
Copy link
Contributor Author

Claudenw commented Nov 1, 2025

@garydgregory I removed a method that was added in 1.10.0 This caused the build to fail. I can put it back if that is what we need to do. But we should mark it as as do not use.

In addition, there is no jira ticket for this as none was created to go with the reported issue. I can create one if you wish. I did not as I was not sure how you wanted to handle this and because I am pressed for time and I wanted to at least get the fix in front of your eyes ASAP.

@garydgregory
Copy link
Member

garydgregory commented Nov 1, 2025

Hi @Claudenw

Thank you for the PR :)

You CANNOT break binary compatibility within a major release line.

I've added back toSyntaxOptions() in this PR. Let's see about the other breakage...

Add test for toSyntaxOptions with iterable of options
@Claudenw
Copy link
Contributor Author

Claudenw commented Nov 3, 2025

@garydgregory just for my clarification, when does the inclusion of a new method become part of the binary compatibility?

If a method was added in 1.10.0-SNAPSHOT can it not be removed before 1.10.0 is released? The method in question was added in 1.10.0-SNAPSHOT and I thought this was 1.10.0 that we are working on. Hence my confusion.

Please clarify for my edification.

@garydgregory
Copy link
Member

Hi @Claudenw

We are both right 😉

If a method was added in 1.10.0-SNAPSHOT can it not be removed before 1.10.0 is released? The method in question was added in 1.10.0-SNAPSHOT and I thought this was 1.10.0 that we are working on.

Yes, but version 1.10.0 was released in September this year. We are now on 1.11.0-SNAPSHOT.

@Claudenw
Copy link
Contributor Author

Claudenw commented Nov 3, 2025

2 comments.

DOH!

and I think this should be versioned as 1.10.1 unless there are other changes.

@garydgregory
Copy link
Member

garydgregory commented Nov 3, 2025

Hello @Claudenw
The next version will be 1.11.0, see changes.xml.

@Claudenw Claudenw marked this pull request as ready for review November 3, 2025 22:10
@garydgregory garydgregory merged commit d4cead7 into apache:master Nov 5, 2025
9 checks passed
@garydgregory
Copy link
Member

Thank you @Claudenw , merged!

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.

2 participants