Replace synchronized section in AnnotationActionValidatorManager.getValidators
with a ReentrantReadWriteLock implementation
---------------------------------------------------------------------------------------------------------------------------
Key: WW-3204
URL: https://issues.apache.org/struts/browse/WW-3204
Project: Struts 2
Issue Type: Sub-task
Affects Versions: 2.1.7
Reporter: Musachy Barroso
Assignee: Musachy Barroso
Fix For: 2.1.8
something like:
lock.readLock().lock();
try {
if (validatorCache.containsKey(validatorKey)) {
if (FileManager.isReloadingConfigs()) {
lock.writeLock().lock();
try {
if (validatorCache.containsKey(validatorKey))
validatorCache.put(validatorKey,
buildValidatorConfigs(clazz, context, true, null));
} finally {
lock.writeLock().unlock();
}
}
} else {
lock.writeLock().lock();
try {
if (!validatorCache.containsKey(validatorKey))
validatorCache.put(validatorKey,
buildValidatorConfigs(clazz, context, false, null));
} finally {
lock.writeLock().unlock();
}
}
} finally {
lock.readLock().unlock();
}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.