GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Support String properties being converted to Enums in a case insensitive by kwin · Pull Request #2220 · apache/maven-resolver

Conversation

@kwin

@kwin kwin commented Oct 21, 2026

Copy link
Copy Markdown
Member

manner.


To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
check one of the following:

  • I hereby declare this contribution to be licensed under the Apache License Version 2.0, January 2004
  • I hereby declare that I have filed an Apache Individual Contributor License Agreement.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kwin
kwin force-pushed the feature/case-insensitive-enum-conversion branch 2 times, most recently from d72d4bc to 597b542 Compare October 21, 2026 13:50
gnodet-bot
gnodet-bot suggested changes Oct 21, 2026
View reviewed changes

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The case-insensitive enum matching is a good usability improvement (users setting http_2 instead of HTTP_2 will no longer get a cryptic exception). However, the documentation directly contradicts the implementation on invalid-value behavior, and the Javadoc still references Enum.valueOf which is no longer used.

Two things must be fixed before merge:

  1. configuration.md.vm says "If no match is found an IllegalArgumentException is thrown" — but the code silently returns defaultValue. Direct contradiction.
  2. The Javadoc on both overloads says "parsed using {@link Enum#valueOf(Class, String)}" — misleading, the implementation now iterates getEnumConstants() with equalsIgnoreCase. Also worth noting in the Javadoc that an unrecognized string falls through to the next key (and ultimately defaultValue).

One additional nit: in configuration.md.vm, Enum.name(...) uses (...) but name() takes no arguments.

On the silent-fallback design: this is consistent with how getBoolean/getInt/getLong/getFloat all behave on parse failure. There is only one internal caller (HttpTransporterUtils.getHttpVersion) which already provides a sensible default. The change is the right call, but external embedders who relied on IAE for validation will silently accept invalid values — worth a note in the release notes.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread maven-resolver-tools/src/main/resources/configuration.md.vm Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread maven-resolver-util/src/main/java/org/eclipse/aether/util/ConfigUtils.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread maven-resolver-util/src/main/java/org/eclipse/aether/util/ConfigUtils.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@kwin
Support String properties being converted to Enums in a case insensitive
0d532f4
manner.
@kwin
kwin force-pushed the feature/case-insensitive-enum-conversion branch from 597b542 to 0d532f4 Compare October 21, 2026 14:00
@kwin @gnodet-bot
Update maven-resolver-util/src/main/java/org/eclipse/aether/util/Conf…
b742f70
…igUtils.java

Co-authored-by: Guillaume Nodet - AI Bot <[email protected]>
gnodet-bot
gnodet-bot reviewed Oct 21, 2026
View reviewed changes

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following up on my earlier review — the implementation change (throwing IllegalArgumentException instead of returning defaultValue on no-match) resolves the contradiction between docs and code: both now agree that IAE is thrown. However, the Javadoc text itself is now internally contradictory, and the session overload still references Enum#valueOf.

Two documentation issues must still be fixed before merge:

  1. The @param keys description says "if no constant matches, the key is skipped" but the @throws and the code both say IllegalArgumentException is thrown. These two sentences in the same Javadoc block contradict each other.
  2. The session-based overload still says "parsed using Enum#valueOf" — the implementation does not call Enum.valueOf, it uses getEnumConstants() with equalsIgnoreCase.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread maven-resolver-util/src/main/java/org/eclipse/aether/util/ConfigUtils.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread maven-resolver-util/src/main/java/org/eclipse/aether/util/ConfigUtils.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread maven-resolver-tools/src/main/resources/configuration.md.vm Resolved

Uh oh!

There was an error while loading. Please reload this page.

kwin and others added 3 commits October 21, 2026 16:14
@kwin @gnodet-bot
Update maven-resolver-util/src/main/java/org/eclipse/aether/util/Conf…
ec6c94f
…igUtils.java

Co-authored-by: Guillaume Nodet - AI Bot <[email protected]>
@kwin @gnodet-bot
Update maven-resolver-tools/src/main/resources/configuration.md.vm
79ee5c6
Co-authored-by: Guillaume Nodet - AI Bot <[email protected]>
@kwin @gnodet-bot
Update maven-resolver-util/src/main/java/org/eclipse/aether/util/Conf…
3b959f1
…igUtils.java

Co-authored-by: Guillaume Nodet - AI Bot <[email protected]>
gnodet-bot
gnodet-bot suggested changes Oct 21, 2026
View reviewed changes

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following up on my earlier review — most previous findings are addressed. However, this push introduced two copy-paste Javadoc defects that must be fixed before merge.

✅ Addressed: configuration.md.vm now correctly states IllegalArgumentException is thrown on no match. Both getEnum overloads now describe case-insensitive comparison instead of referencing Enum#valueOf. The Enum.name() nit is fixed. Tests correctly validate case-insensitive matching, and the invalid-value test uses "third" (a non-matching value).

⚠️ Still needs fixing: Two Javadoc defects introduced in this push.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread maven-resolver-util/src/main/java/org/eclipse/aether/util/ConfigUtils.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread maven-resolver-util/src/main/java/org/eclipse/aether/util/ConfigUtils.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@kwin @gnodet-bot
Apply batched suggestions from code review
f2d09ea
Co-authored-by: Guillaume Nodet - AI Bot <[email protected]>
gnodet-bot
gnodet-bot approved these changes Oct 21, 2026
View reviewed changes

@gnodet-bot gnodet-bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previous findings are all addressed. LGTM.

This review was generated by an AI agent, Hermès on behalf of @gnodet.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
cstamas
cstamas approved these changes Oct 21, 2026
View reviewed changes
@cstamas cstamas added this to the 2.0.25 milestone Oct 21, 2026
@cstamas cstamas added the enhancement New feature or request label Oct 21, 2026
@kwin
kwin merged commit 12f0e6c into master Oct 21, 2026
26 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@kwin
kwin deleted the feature/case-insensitive-enum-conversion branch October 21, 2026 17:35
@github-actions github-actions Bot assigned kwin Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cstamas cstamas cstamas approved these changes
+1 more reviewer
@gnodet-bot gnodet-bot gnodet-bot approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@kwin kwin

Labels

enhancement New feature or request

Projects

None yet

Milestone

2.0.25

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@kwin @cstamas @gnodet-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.