Skip to content

Conversation

@eunseo9311
Copy link
Contributor

Title:
Replace Collectors.toList() with Stream.toList()

Description:

Summary

Modernize stream collection operations by replacing Collectors.toList() with Stream.toList() introduced in Java 16.

Changes

  • InitializrMetadataV2JsonMapper.java: 3 occurrences
  • DependenciesCapability.java: 1 occurrence
  • Removed unused Collectors import statements

Motivation

  1. Conciseness: stream.toList() is shorter and more readable
  2. Performance: Avoids creating an intermediate Collector object
  3. Immutability: toList() returns an unmodifiable list, which aligns with existing usage patterns
  4. Modern Java: Aligns with Java 16+ idioms since the project requires Java 17

Use the more concise Stream.toList() method introduced in Java 16
instead of Collectors.toList() for better readability and slight
performance improvement.

Signed-off-by: Eunseo Song <[email protected]>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 23, 2026
@mhalbritter
Copy link
Contributor

Hello! What is the relation to #1747? Could the changes from this PR be included in #1747 or vice versa?

@mhalbritter mhalbritter added the status: waiting-for-feedback We need additional information before we can continue label Jan 26, 2026
@eunseo9311
Copy link
Contributor Author

Hi! PR #1747 now includes all changes from this PR plus additional files with the same refactoring (19 files total). Closing this in favor of #1747.

@eunseo9311 eunseo9311 closed this Jan 27, 2026
@mhalbritter mhalbritter added status: superseded and removed status: waiting-for-feedback We need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged labels Jan 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants