Remove deprecated getFiles() instead of getResolvedArtifacts() #43191
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.
Description
This PR removes the usage of the deprecated
getFiles()
method inCheckBom.class
and replaces it with the newergetResolvedArtifacts()
method. ThegetFiles()
method was deprecated due to its potential for incorrect behavior and its reliance on legacy API, whilegetResolvedArtifacts()
provides a more reliable and modern approach to resolving dependencies.Backward compatibility
This change is fully backward-compatible and does not affect the existing functionality of the BOM resolution process. The
getResolvedArtifacts()
method is a direct replacement forgetFiles()
and provides the same functionality but with updated API usage.Related Issue
Fixed #43142
Type of Change
Checklist
Screenshots
Run Tests
Remove Warning
Before
After
Additional Notes
To display warning correctly, I modified the
build.gradle
file, and use command./gradlew :buildSrc:compileJava --rerun-tasks -Duser.language=en
to show the warning obviously. But, I did't find the test class namedCheckBomTests
, butBomPluginIntegrationTests
instead. I don't know whether it covers the methodresolveBom()
inCheckBom
, soTDD
workflow doesn't work. If there's some mistake, please leave a comment. Thanks~