Fix issue s1319 Declarations should use Java collection interfaces on biojava-core #1095
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.
This PR is an experiment to fix the rule Sonar s1319 "Declarations should use Java collection interfaces such as 'List' rather than specific implementation classes such as 'LinkedList'". Note that the scope of this PR is intentionally limited to the biojava-core module and some of its dependencies.
It's a bit complicated on the Biojava project because the Sonar rule raises a few false positives and the project makes extensive use of interface implementations and sometimes methods that are implementation-specific. But after a few manual adjustments to standardise the modifications in the dependent modules, the tests pass with the exception of the TestCrystallographicMetadata.test1zna:92 test in the biojava-integrationtest module. I'm not convinced that the error stems from these modifications, but I'll let you be the judge.
Below is a link to the sonar page describing the problem https://rules.sonarsource.com/java/tag/bad-practice/RSPEC-1319/.
Indepth has fixed 102 issues that would have taken about 2 days to correct manually.