Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to code involving synchronized maps #52

Open
wants to merge 15 commits into
base: trunk
Choose a base branch
from
Open

Improvements to code involving synchronized maps #52

wants to merge 15 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Oct 12, 2017

These are some improvements to org.apache.jackrabbit.jcr2spi.ItemImpl and other classes which use synchronized maps.

The listeners member of ItemImpl should be made private because subclasses should not be allowed to mutate this map or iterate over it. Iterating over the map requires proper synchronization or else non-deterministic behavior can occur.

Also, the changes to throw NullPointerException if an ItemLifeCycleListener instance is null is not really a change, because it was implicitly assumed that the listeners would not be null (notifyCreated() invokes itemCreated() on each initial listener without checking for null).

I would classify these changes as efficiency and code improvements, with three exceptions that fix concurrency issues:

@ghost ghost changed the title ItemImpl improvements Improvements to code involving synchronized maps Oct 12, 2017
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.

1 participant