-
Notifications
You must be signed in to change notification settings - Fork 234
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
Refactoring. From Singleton to Factory #6
Conversation
Allow saving of null object instead of deleting key. Refactoring. From Singleton to Static Factory Allow saving of null object instead of deleting key. Revert "Allow saving of null object instead of deleting key."
# Conflicts: # paperdb/src/main/java/io/paperdb/DbStoragePlainFile.java
throw new PaperDbException("Paper.init is not called"); | ||
} | ||
if (mBookMap == null) { | ||
mBookMap = new ConcurrentHashMap<>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instantiate mBookMap in declaration. Otherwise here is a potential race condition. Changing mBookMap made by one thread would not reflect in all the other concurrent threads.
Just also realized that we can support old api and mark it deprecated. Nobody likes to update library and break code. Will do it in some other patch. |
No description provided.