Skip to content

Fix compilation error in DefaultRepositorySystemReentrancyTest - #2047

Merged
gnodet merged 1 commit into
masterfrom
fix/reentrancy-test-compilation
Aug 8, 2026
Merged

Fix compilation error in DefaultRepositorySystemReentrancyTest#2047
gnodet merged 1 commit into
masterfrom
fix/reentrancy-test-compilation

Conversation

@gnodet

@gnodet gnodet commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Commit 89f2bc1 ("Extend re-entrancy detection for broken trace chains") added three new test methods in DefaultRepositorySystemReentrancyTest that construct DefaultRepositorySystemValidator using Collections.singletonList(EXPRESSION_REJECTING_VALIDATOR_FACTORY)
  • However, commit f164aa9 ("Allow validator factory to abstain", Enh: Allow validator factory to abstain #2008) changed the constructor from List<ValidatorFactory> to Map<String, ValidatorFactory>
  • This causes a compilation failure on all 18 CI jobs (every OS × JDK × Maven combination): incompatible types: no instance(s) of type variable(s) T exist so that java.util.List<T> conforms to java.util.Map<java.lang.String,org.eclipse.aether.spi.validator.ValidatorFactory>

The fix replaces Collections.singletonList(...) with Collections.singletonMap("expressionRejecting", ...) at all three call sites (lines 361, 398, 457), consistent with the existing correct usage at line 174.

Test plan

  • mvn -pl maven-resolver-impl test-compile compiles successfully
  • mvn -pl maven-resolver-impl test -Dtest=DefaultRepositorySystemReentrancyTest — all 11 tests pass
  • CI should go green

🤖 Generated with Claude Code

Three test methods added in 89f2bc1 use Collections.singletonList()
to construct DefaultRepositorySystemValidator, but the constructor
was changed from List<ValidatorFactory> to Map<String, ValidatorFactory>
in f164aa9 ("Allow validator factory to abstain").

Replace singletonList with singletonMap to match the current API,
consistent with the existing test at line 174.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

LGTM. Straightforward compilation fix — commit 89f2bc1 added test methods using Collections.singletonList() for DefaultRepositorySystemValidator, but commit f164aa9 had already changed the constructor from List<ValidatorFactory> to Map<String, ValidatorFactory>. The fix correctly replaces singletonList with singletonMap at all three call sites, matching the existing usage at line 174.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of gnodet

@gnodet

gnodet commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

The single CI failure is the pre-existing flaky JettyTransporterTest.testGet_HTTP3 on Windows (windows-latest jdk-26-zulu 4.0.0-rc-6):

JettyTransporterTest.testGet_HTTP3 — IllegalState: Failed to find a port free for both TCP and UDP

This is a known infrastructure flake (there's even a recent deflake attempt in 8ea57ef). All other 17 matrix jobs (ubuntu/macos/windows × JDK 21/25/26 × Maven 3.10/4.0) pass cleanly, including the DefaultRepositorySystemReentrancyTest — 11/11 tests pass.

@gnodet
gnodet merged commit ad40809 into master Aug 8, 2026
43 of 44 checks passed
@gnodet
gnodet deleted the fix/reentrancy-test-compilation branch August 8, 2026 12:43
@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown

@gnodet Please assign appropriate label to PR according to the type of change.

@github-actions github-actions Bot added this to the 2.0.22 milestone Aug 8, 2026
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.

3 participants