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

LazyActionHandlerValidatorRegistryImpl is not really threadsafe #282

Closed
jDramaix opened this issue Jul 5, 2013 · 0 comments · Fixed by #475
Closed

LazyActionHandlerValidatorRegistryImpl is not really threadsafe #282

jDramaix opened this issue Jul 5, 2013 · 0 comments · Fixed by #475
Milestone

Comments

@jDramaix
Copy link
Contributor

jDramaix commented Jul 5, 2013

To avoid to initialize and register handlers two times by two different threads, LazyActionHandlerValidatorRegistryImpl classes should use putIfAbsent() method of ConcurentHashMap instead of put() when we have the following pattern :

handler = handlerMape.get(key);
if (handler == null) {
   handler = createHandler(key);
   handlerMap.put(key, handler);
}

return handler;
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 a pull request may close this issue.

2 participants