From a7b5299e777013f3e140638de96f97fb59425ca0 Mon Sep 17 00:00:00 2001 From: Ben Alex Date: Wed, 22 Jun 2005 05:22:05 +0000 Subject: [PATCH] Correct synchronization issue with FilterToBeanProxy initialization (thanks to George Franciscus and Volker Malzahn as per acegisecurity-developer discussion 4 June 2005). --- .../java/org/acegisecurity/util/FilterToBeanProxy.java | 7 ++++++- doc/xdocs/changes.xml | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/acegisecurity/util/FilterToBeanProxy.java b/core/src/main/java/org/acegisecurity/util/FilterToBeanProxy.java index 6c427cdbbb..407516e07b 100644 --- a/core/src/main/java/org/acegisecurity/util/FilterToBeanProxy.java +++ b/core/src/main/java/org/acegisecurity/util/FilterToBeanProxy.java @@ -150,7 +150,12 @@ public class FilterToBeanProxy implements Filter { .getServletContext()); } - private void doInit() throws ServletException { + private synchronized void doInit() throws ServletException { + if (initialized) { + // already initialized, so don't re-initialize + return; + } + initialized = true; String targetBean = filterConfig.getInitParameter("targetBean"); diff --git a/doc/xdocs/changes.xml b/doc/xdocs/changes.xml index cb1e1b0fdd..09e11f5438 100644 --- a/doc/xdocs/changes.xml +++ b/doc/xdocs/changes.xml @@ -36,6 +36,7 @@ AbstractAuthenticationToken.getName() now returns username alone if UserDetails present AuthorityGranter.grant now returns a java.util.Set of role names, instead of a single role name JavaDoc improvements + Correct synchronization issue with FilterToBeanProxy initialization Correct location of AuthenticationSimpleHttpInvokerRequestExecutor in clientContext.xml