You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by se...@apache.org on 2009/02/18 00:50:09 UTC

svn commit: r745301 - /commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilTest.java

Author: sebb
Date: Tue Feb 17 23:50:08 2009
New Revision: 745301

URL: http://svn.apache.org/viewvc?rev=745301&view=rev
Log:
Use more efficient entrySet() iteration

Modified:
    commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilTest.java

Modified: commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilTest.java
URL: http://svn.apache.org/viewvc/commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilTest.java?rev=745301&r1=745300&r2=745301&view=diff
==============================================================================
--- commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilTest.java (original)
+++ commons/proper/exec/trunk/src/test/java/org/apache/commons/exec/environment/EnvironmentUtilTest.java Tue Feb 17 23:50:08 2009
@@ -80,11 +80,12 @@
 
         // ensure that we have the same value for upper and lowercase keys
         Map procEnvironment = EnvironmentUtils.getProcEnvironment();
-        for (Iterator it = procEnvironment.keySet().iterator(); it.hasNext();) {
-            String variable = (String) it.next();
-            String value = (String) procEnvironment.get(variable);
-            assertEquals(value, procEnvironment.get(variable.toLowerCase(Locale.ENGLISH)));
-            assertEquals(value, procEnvironment.get(variable.toUpperCase(Locale.ENGLISH)));
+        for (Iterator it = procEnvironment.entrySet().iterator(); it.hasNext();) {
+            Map.Entry entry = (Map.Entry) it.next();
+            String key = (String) entry.getKey();
+            String value = (String) entry.getValue();
+            assertEquals(value, procEnvironment.get(key.toLowerCase(Locale.ENGLISH)));
+            assertEquals(value, procEnvironment.get(key.toUpperCase(Locale.ENGLISH)));
         }
 
         // add an environment variable and check access