This change enhances safety in multi-threaded environments by returning unmodifiable objects from getters.

  • getter returns unmodifiable Collection

Fixes #407

Comment From: codespearhead

@young Can you link this PR to that issue to make sure the issue is automatically closed once this PR is merged?

To do so, just change the last line of this PR's description to this:

Fixes https://github.com/spring-projects/spring-ai/issues/407

Comment From: markpollack

Hi. Thanks, I know it has taken a while to review this. The code has changed a bit, so I'll open a up a new PR to address the immutability concerns and add you an an author in the PR commit message @youngmoneee

Comment From: markpollack

This has been address in #1584