Fix PMD issue.
@@ -106,13 +106,13 @@ class EvictionTimer {
* @param restarting The state of the evictor.
*/
static synchronized void cancel(
- final BaseGenericObjectPool<?>.Evictor evictor, final long timeout, final TimeUnit unit, final boolean restarting) {
+ final BaseGenericObjectPool<?>.Evictor evictor, final long timeout, final TimeUnit unit,
+ final boolean restarting) {
if (evictor != null) {
evictor.cancel();
remove(evictor);
}
- if (!restarting && executor != null) {
- if (taskMap.isEmpty()) {
+ if (!restarting && executor != null && taskMap.isEmpty()) {
executor.shutdown();
try {
executor.awaitTermination(timeout, unit);
@@ -124,7 +124,6 @@ class EvictionTimer {
executor = null;
}
}
- }
/**
* Removes evictor from the task set and executor.
