if (log.isTraceEnabled()) { log.trace("No children"); }
if (trace) { log.trace("No children"); }
   protected void maintainRelatives(Invocation invocation)   {                        HierarchicalState state = ((DelegateSupport)invocation.getTargetObject()).getState();                  //We use a clone to avoid a deadlock where requests      //are made to close parent and child concurrently            Set clone = null;           Set children = state.getChildren();            if (children == null)      {         if (log.isTraceEnabled()) { log.trace("No children"); }         return;      }            synchronized (children)      {         clone = new HashSet(children);      }            // Cycle through the children this will do a depth      // first close      for (Iterator i = clone.iterator(); i.hasNext();)      {         HierarchicalState child = (HierarchicalState)i.next();               Closeable del = (Closeable)child.getDelegate();         try         {            del.closing();            del.close();         }         catch (Throwable ignored)         {            // Add a log interceptor to the child if you want the error            ignored.printStackTrace();         }      }            // Remove from the parent      HierarchicalState parent = (HierarchicalState)state.getParent();      if (parent != null)      {                  parent.getChildren().remove(state);      }   }