ballerina-lang
ballerina-lang copied to clipboard
[Refactoring] Replace `collect(Collectors.toList())` with `toList()`
Purpose
This is a continuation of PR #42894. Somehow I missed a lot of places where collect(Collectors.toList()) is still used.
I also had to fix some typing issues since the resulting types of the Lists are not 100% the same:
collect(Collectors.toList())can returnList<? super T>toList()returnsList<T>
Which means collect(Collectors.toList()) can convert from List<String> to List<Object> but toList() can't.
I fixed the type signatures so they respect the more explicit type.
Check List
- [x] Read the Contributing Guide
- [ ] Updated Change Log
- [ ] Checked Tooling Support (#<Issue Number>)
- [ ] Added necessary tests
- [ ] Unit Tests
- [ ] Spec Conformance Tests
- [ ] Integration Tests
- [ ] Ballerina By Example Tests
- [ ] Increased Test Coverage
- [ ] Added necessary documentation
- [ ] API documentation
- [ ] Module documentation in Module.md files
- [ ] Ballerina By Examples
Codecov Report
Attention: Patch coverage is 83.22981% with 54 lines in your changes missing coverage. Please review.
Project coverage is 77.50%. Comparing base (
0477a4a) to head (02c4210). Report is 95 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #42904 +/- ##
============================================
- Coverage 77.50% 77.50% -0.01%
+ Complexity 58581 58577 -4
============================================
Files 3438 3438
Lines 219214 219196 -18
Branches 28919 28909 -10
============================================
- Hits 169910 169887 -23
- Misses 39890 39896 +6
+ Partials 9414 9413 -1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I don't understand why the pipeline fails. Could someone please restart it to see if the test was flaky?
This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.
This PR has been open for more than 15 days with no activity. This will be closed in 3 days unless the stale label is removed or commented.
@Shadow-Devil Some stdlib levels seem to be failing. Shall we retrigger and check?
@Dilhasha it would be great if you could retrigger the failing pipelines. Thank you!
I'm really confused why the test org.ballerinalang.langserver.diagnostics.CyclicDependenciesTest is failing:
org.mockito.exceptions.verification.WantedButNotInvoked:
Wanted but not invoked:
extendedLanguageClient.showMessage(<any>);
-> at org.ballerinalang.langserver.diagnostics.CyclicDependenciesTest.testCyclicDependenciesOnOpen(CyclicDependenciesTest.java:69)
Actually, there were zero interactions with this mock.
Maybe someone could help debug this, since I don't know how to resolve this. Otherwise I will debug it in some weeks since I don't have time at the moment.