Skip to content

Conversation

@SteffenHeu
Copy link
Member

msms infos were added through an exposed hash set. refactored and added a method to add the msms infos, made the exposed hash set unmodifiable

@Override
public Set<IonMobilityMsMsInfo> getImsMsMsInfos() {
return precursorInfos;
return Set.copyOf(precursorInfos);
Copy link
Member

@robinschmid robinschmid Oct 22, 2025

Choose a reason for hiding this comment

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

I think a good option istead of the copy is to use an unmodifiable wrapper that avoids the copy. Only issue might be modification exceptions in case multiple threads try to add/read the content.
Collections.unmodifiableSet

So both works for me. I feel like this method does not need to provide multi threading secure implementation of the collection.
And it may be called a lot to get the precursor mz etc.

@robinschmid robinschmid self-requested a review October 22, 2025 13:54
robinschmid
robinschmid previously approved these changes Oct 22, 2025
@robinschmid robinschmid merged commit da57ac2 into mzmine:master Oct 24, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants