if (trace) { log.trace("InterruptedException, " + this + ".getMessage() returning " + m); }
if (trace) { log.trace(this + ".getMessage() returning " + m); }
   private MessageProxy getMessage(long timeout) throws JMSException   {      if (timeout == -1)      {         // receiveNoWait so don't wait      }      else      {                  try         {                     if (timeout == 0)            {               // wait for ever potentially               while (!closed && buffer.isEmpty())               {                  if (trace) { log.trace(this + " waiting on main lock, no timeout"); }                  mainLock.wait();                  if (trace) { log.trace(this + " done waiting on main lock"); }               }            }            else            {               // wait with timeout               long toWait = timeout;                            while (!closed && buffer.isEmpty() && toWait > 0)               {                  if (trace) { log.trace(this + " waiting on main lock, timeout " + toWait + " ms"); }                  toWait = waitOnLock(mainLock, toWait);                  if (trace) { log.trace(this + " done waiting on lock, buffer is " + (buffer.isEmpty() ? "" : "NOT ") + "empty"); }               }            }         }         catch (InterruptedException e)         {            if (trace) { log.trace("InterruptedException, " + this + ".getMessage() returning null"); }            return null;         }       }      MessageProxy m = null;                   if (!closed && !buffer.isEmpty())      {         m = (MessageProxy)buffer.removeFirst();      }      if (trace) { log.trace("InterruptedException, " + this + ".getMessage() returning " + m); }      return m;   }