This PR removes the usage of the deprecated getFiles() method in CheckBom.class and replaces it with the newer getResolvedArtifacts() method. The getFiles() method was deprecated due to its potential for incorrect behavior and its reliance on legacy API, while getResolvedArtifacts() 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 for getFiles() and provides the same functionality but with updated API usage.
Related Issue
Fixed #43142
Type of Change
[X] Refactor feature
[ ] Modify related tests
[ ] Documentation update
Checklist
[X] I have reviewed the code for any potential issues or improvements.
[X] I have run tests locally and they are passing.
[X] I have followed the coding style and conventions of the project.
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 named CheckBomTests, but BomPluginIntegrationTests instead. I don't know whether it covers the method resolveBom() in CheckBom, so TDD workflow doesn't work. If there's some mistake, please leave a comment. Thanks~
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~