1 Reply Latest reply on Mar 12, 2009 9:53 AM by clebert.suconic

    Why is this so written?

    gaohoward

      In JBM 14 SimpleConnectionManager.cleanupForSessionID((String jmsSessionID),

       .....
       ConnectionEndpoint conn = null;
      
       for (Map.Entry<String, ConnectionEndpoint> entry: endpoints.entrySet())
       {
       if (entry.getKey().equals(jmsSessionID))
       {
       conn = entry.getValue();
      
       break;
       }
       }
       ........
      


      Why don't use

       .....
       ConnectionEndpoint conn = null;
      
       conn = endpoints.get(jmsSessionID);
       ........
      


      instead of the for loop?