Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace this usage of 'Stream.collect(Collectors.toList())' with 'Stream.toList()' #2

Closed
divawalazeel opened this issue Feb 14, 2024 · 0 comments
Assignees
Labels
Group 09 Group_9_SCM_Project Technical Debt

Comments

@divawalazeel
Copy link
Collaborator

Describe the technical debt
The sonar suggested to change the Stream.collect(Collectors.toList()) method to Stream.toList().

Screenshot 2024-02-14 014056

Why is this an issue?

There is now a better variant to produce an unmodifiable list directly from a stream: Stream.toList().

This rule raises an issue when "collect" is used to create a list from a stream.

Proposed solution:

Screenshot 2024-02-14 015040

Technical information

  • Device: [e.g. Nexus 7 (2013)]
  • OS: [e.g. LineageOS 15.1]
  • OpenTracks version: [e.g. v3.2.4]
  • OpenTracks commit id (only for nightly builds): [e.g. 4b333bb]
@divawalazeel divawalazeel self-assigned this Feb 14, 2024
Sharanyu pushed a commit that referenced this issue Feb 14, 2024
Update ChartFragment.java
@WaseemJan063 WaseemJan063 added Group 09 Group_9_SCM_Project Technical Debt labels Feb 17, 2024
Sharanyu added a commit to rilling/OpenTracks-Winter-SOEN-6431_2024 that referenced this issue Feb 17, 2024
This PR consists of changes for issues resolved by Group9.


[#1](tarekFerdous#1)
Define a constant instead of duplicating this literal "<open>1</open>" 3
times.

[#2](tarekFerdous#2)
Replace this usage of 'Stream.collect(Collectors.toList())' with
'Stream.toList()' Group 09

[#6](tarekFerdous#6)
Either re-interrupt this method or rethrow the "InterruptedException"
that can be caught here.

[#9](tarekFerdous#9)
Remove unused "TAG" private field.

[#11](tarekFerdous#11)
Use isEmpty() to check whether the collection is empty or not.

[#13](tarekFerdous#13)
Fixing technical debts for io/file/impoter/importService.java and
io/file/importer/importViewModel.java

[#14](tarekFerdous#14)
io/file/importer/KmlTrackImporter and io/file/importer/KmzTrackImporter

[#15](tarekFerdous#15)
Removing the Deprecated lines in the code Group(09)
beingtranquil pushed a commit that referenced this issue Mar 17, 2024
#2 Merging this if statement with the enclosing one
beingtranquil pushed a commit that referenced this issue Mar 17, 2024
Added static to the final field #2
beingtranquil pushed a commit that referenced this issue Mar 17, 2024
Revert "#2 Merging this if statement with the enclosing one"
beingtranquil pushed a commit that referenced this issue Mar 17, 2024
Update DescriptionGenerator.java lgtm
beingtranquil pushed a commit that referenced this issue Apr 8, 2024
beingtranquil pushed a commit that referenced this issue Apr 9, 2024
…nounce-avg-speed-at-end-of-each-run

64 settings voice announcements announce avg speed at end of each run
beingtranquil pushed a commit that referenced this issue Apr 9, 2024
beingtranquil pushed a commit that referenced this issue Apr 25, 2024
1. Updated string.xml to fix error in screenshot #1 (src\main\res\values\strings.xml)
2. Updated build.gradle to fix error in screenshot #2 (src\main\res\layout\fragment_runs_stat.xml)
3. Updated src\main\java\de\dennisguse\opentracks\stats\TrackStatisticsUpdater.java to fix error in screenshot #3
4. Commented out code in src/main/java/de/dennisguse/opentracks/ui/aggregatedStatistics/SeasonStats/RunAndChairStatActivity.java and src/main/java/de/dennisguse/opentracks/ui/aggregatedStatistics/SeasonStats/SeasonStatActivity.java to fix error in screenshot #4
5. Commented out code in  src/main/java/de/dennisguse/opentracks/ui/aggregatedStatistics/AggregatedStatisticsAdapter.java to fix error in screenshot #5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Group 09 Group_9_SCM_Project Technical Debt
Projects
None yet
Development

No branches or pull requests

2 participants