This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push: new 7af1a7586a Locking cleanup 7af1a7586a is described below commit 7af1a7586a6edbd459dfdf40a620b953ad8a3449 Author: remm <r...@apache.org> AuthorDate: Thu Sep 7 15:20:18 2023 +0200 Locking cleanup Identified by coverity. --- java/org/apache/catalina/realm/MemoryRealm.java | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/java/org/apache/catalina/realm/MemoryRealm.java b/java/org/apache/catalina/realm/MemoryRealm.java index e918a89eb7..2de6ab75dc 100644 --- a/java/org/apache/catalina/realm/MemoryRealm.java +++ b/java/org/apache/catalina/realm/MemoryRealm.java @@ -187,6 +187,7 @@ public class MemoryRealm extends RealmBase { * necessary. */ protected Digester getDigester() { + // Keep locking for subclass compatibility synchronized (digesterLock) { if (digester == null) { digester = new Digester(); @@ -226,16 +227,16 @@ public class MemoryRealm extends RealmBase { log.debug(sm.getString("memoryRealm.loadPath", pathName)); } - Digester digester = getDigester(); - try { - synchronized (digester) { + synchronized (digesterLock) { + Digester digester = getDigester(); + try { digester.push(this); digester.parse(is); + } catch (Exception e) { + throw new LifecycleException(sm.getString("memoryRealm.readXml"), e); + } finally { + digester.reset(); } - } catch (Exception e) { - throw new LifecycleException(sm.getString("memoryRealm.readXml"), e); - } finally { - digester.reset(); } } catch (IOException ioe) { throw new LifecycleException(sm.getString("memoryRealm.loadExist", pathName), ioe); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org