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
Contributor

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

@tomazfernandes tomazfernandes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Baqirrizvidev, seems this PR also contains changes from #1624.

This will generate a conflict after that one is merged with the changes.

I suggest you remove the logic for this one and keep it focused on the collectors changes.

@tomazfernandes tomazfernandes added status: waiting-for-feedback Waiting for feedback from issuer component: s3 S3 integration related issue labels Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component: s3 S3 integration related issue component: sqs SQS integration related issue status: waiting-for-feedback Waiting for feedback from issuer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants