From 14e384051b02ce7a49788d977b9f3dcd53591e89 Mon Sep 17 00:00:00 2001 From: Ben Alex Date: Tue, 17 May 2005 00:06:15 +0000 Subject: [PATCH] Improve logging. --- .../validation/ValidationManagerImpl.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/domain/src/main/java/org/acegisecurity/domain/validation/ValidationManagerImpl.java b/domain/src/main/java/org/acegisecurity/domain/validation/ValidationManagerImpl.java index f5b7d5d1d4..487a2de4ae 100644 --- a/domain/src/main/java/org/acegisecurity/domain/validation/ValidationManagerImpl.java +++ b/domain/src/main/java/org/acegisecurity/domain/validation/ValidationManagerImpl.java @@ -220,20 +220,24 @@ public class ValidationManagerImpl implements InitializingBean, introspectionManager.obtainImmediateChildren(parentObject, currentChildren); - // Add the children - allObjects.addAll(currentChildren); - // Now iterate the children, adding their children to the object list Iterator childrenIter = currentChildren.iterator(); while (childrenIter.hasNext()) { Object childObject = childrenIter.next(); - if (childObject != null && !allObjects.contains(childObject)) { - if (logger.isDebugEnabled()) { - logger.debug("New child class found; searching for children of: " + childObject); + if (childObject != null) { + if (allObjects.contains(childObject)) { + if (logger.isDebugEnabled()) { + logger.debug("Already processed this object (will not re-add): " + childObject); + } + } else { + if (logger.isDebugEnabled()) { + logger.debug("New child object found; adding child object to list of objects, and searching for its children: " + childObject); + } + allObjects.add(childObject); + obtainAllChildren(childObject, allObjects); } - obtainAllChildren(childObject, allObjects); } } }