Skip to content

refactor: modernize stream collectors to unmodifiable lists using .toList()#1625

Open
Baqirrizvidev wants to merge 2 commits into
awspring:mainfrom
Baqirrizvidev:fix/modernize-stream-collectors-to-list
Open

refactor: modernize stream collectors to unmodifiable lists using .toList()#1625
Baqirrizvidev wants to merge 2 commits into
awspring:mainfrom
Baqirrizvidev:fix/modernize-stream-collectors-to-list

Conversation

@Baqirrizvidev
Copy link
Copy Markdown

This pull request modernizes the stream pipeline across the S3 and SQS modules by migrating legacy .collect(Collectors.toList())\ calls to Java 16+ .toList().

Benefits:

  • Improved performance and reduced allocation overhead by avoiding intermediate accumulator collection.
  • Enforced list unmodifiability for safer, immutable data structures returned by internal APIs.
  • Cleaned up unused \java.util.stream.Collectors\ imports.

Files Modernized:

  • \S3StreamingMessageSource.java\
  • \S3PathMatchingResourcePatternResolver.java\
  • \InterceptorExecutionFailedException.java\
  • \ListenerExecutionFailedException.java\
  • \DefaultListenerContainerRegistry.java\

These are safe, lightweight, non-breaking Java code modernizations that align with clean Java practices.

@github-actions github-actions Bot added the component: sqs SQS integration related issue label May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: sqs SQS integration related issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant