1 Reply Latest reply on Mar 12, 2009 9:53 AM by Clebert Suconic

    Why is this so written?

    Yong Hao Gao Master

      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?