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

CachingParser is not thread safe #41

Open
gysel opened this issue Jun 21, 2019 · 2 comments
Open

CachingParser is not thread safe #41

gysel opened this issue Jun 21, 2019 · 2 comments
Labels

Comments

@gysel
Copy link

gysel commented Jun 21, 2019

The class CachingParser uses a org.apache.commons.collections4.map.LRUMap internally.

The JavaDoc clearly states:

Note that LRUMap is not synchronized and is not thread-safe. If you wish to use this map from multiple threads concurrently, you must use appropriate synchronization. The simplest approach is to wrap this map using Collections.synchronizedMap(Map). This class may throw NullPointerException's when accessed by concurrent threads.

I think it would be good to add a lock directly in the CachingParser.

@gysel
Copy link
Author

gysel commented Jun 24, 2019

related: #24

@chriscarruthers
Copy link

This would be appreciated. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants