Fix compilation error in DefaultRepositorySystemReentrancyTest - #2047
Conversation
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
left a comment
There was a problem hiding this comment.
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
|
The single CI failure is the pre-existing flaky 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 |
|
@gnodet Please assign appropriate label to PR according to the type of change. |
Summary
DefaultRepositorySystemReentrancyTestthat constructDefaultRepositorySystemValidatorusingCollections.singletonList(EXPRESSION_REJECTING_VALIDATOR_FACTORY)List<ValidatorFactory>toMap<String, ValidatorFactory>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(...)withCollections.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-compilecompiles successfullymvn -pl maven-resolver-impl test -Dtest=DefaultRepositorySystemReentrancyTest— all 11 tests pass🤖 Generated with Claude Code