if (log.isTraceEnabled()) { log.trace(this + ": " + r + " NOT accepted by filter so won't add to list"); }
if (trace) { log.trace(this + ": " + r + " NOT accepted by filter so won't add to list"); }
   public List undelivered(Filter filter)   {      List undelivered = new ArrayList();      synchronized(messageRefs)      {         Iterator iter = messageRefs.getAll().iterator();         while (iter.hasNext())         {            MessageReference r = (MessageReference)iter.next();            // TODO: I need to dereference the message each time I apply the filter. Refactor so the message reference will also contain JMS properties            if (filter == null || filter.accept(r.getMessage()))            {               undelivered.add(r);            }            else            {               if (log.isTraceEnabled()) { log.trace(this + ": " + r + " NOT accepted by filter so won't add to list"); }            }         }      }      if (log.isTraceEnabled()) { log.trace(this + ": undelivered() returns a list of " + undelivered.size() + " undelivered memory messages"); }      return undelivered;   }