Author: sebb
Date: Mon Oct 24 16:36:21 2011
New Revision: 1188211

URL: http://svn.apache.org/viewvc?rev=1188211&view=rev
Log:
Generic for loops

Modified:
    
jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LDAPExtSampler.java

Modified: 
jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LDAPExtSampler.java
URL: 
http://svn.apache.org/viewvc/jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LDAPExtSampler.java?rev=1188211&r1=1188210&r2=1188211&view=diff
==============================================================================
--- 
jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LDAPExtSampler.java
 (original)
+++ 
jakarta/jmeter/trunk/src/protocol/ldap/org/apache/jmeter/protocol/ldap/sampler/LDAPExtSampler.java
 Mon Oct 24 16:36:21 2011
@@ -1060,20 +1060,16 @@ public class LDAPExtSampler extends Abst
 
     // Ensure any remaining contexts are closed
     public void testEnded(String host) {
-        Iterator<Map.Entry<String, DirContext>> it = 
ldapContexts.entrySet().iterator();
-        while (it.hasNext()) {
-            Map.Entry<String, DirContext> entry = it.next();
-            String key = entry.getKey();
+        for (Map.Entry<String, DirContext> entry : ldapContexts.entrySet()) {
             DirContext dc = entry.getValue();
             try {
-                log.warn("Tidying old Context for thread: " + key);
+                log.warn("Tidying old Context for thread: " + entry.getKey());
                 dc.close();
             } catch (NamingException ignored) {
                 // ignored
             }
-            it.remove();// Make sure the entry is not left around for the next 
run
         }
-
+        ldapContexts.clear();
     }
 
     public void testIterationStart(LoopIterationEvent event) {



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to