Skip to content

Added missing override for "set".#3

Merged
haumacher merged 2 commits intomsgbuf:mainfrom
dbusche:main
Apr 9, 2025
Merged

Added missing override for "set".#3
haumacher merged 2 commits intomsgbuf:mainfrom
dbusche:main

Conversation

@dbusche
Copy link
Collaborator

@dbusche dbusche commented Apr 9, 2025

Ensure that listeners are informed when a value in the list is replaced via "set(int,Object)".

Ensure that listeners are informed when a value in the list is replaced
via "set(int,Object)".
public T set(int index, T element) {
beforeAdd(index, element);
T oldValue = super.set(index, element);
afterRemove(index, oldValue);
Copy link
Member

Choose a reason for hiding this comment

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

This simulates a replace with the events add and remove. If remove is fired after add, should this not have index index + 1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, that sounds reasonable

@dbusche dbusche requested a review from haumacher April 9, 2025 14:54
@haumacher haumacher merged commit 59f1ef3 into msgbuf:main Apr 9, 2025
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