directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r1083569 - /directory/shared/trunk/util/src/main/java/org/apache/directory/shared/util/OsgiUtils.java
Date Sun, 20 Mar 2011 21:09:29 GMT
Author: felixk
Date: Sun Mar 20 21:09:28 2011
New Revision: 1083569

URL: http://svn.apache.org/viewvc?rev=1083569&view=rev
Log:
Inefficient use of keySet iterator instead of entrySet iterator

Modified:
    directory/shared/trunk/util/src/main/java/org/apache/directory/shared/util/OsgiUtils.java

Modified: directory/shared/trunk/util/src/main/java/org/apache/directory/shared/util/OsgiUtils.java
URL: http://svn.apache.org/viewvc/directory/shared/trunk/util/src/main/java/org/apache/directory/shared/util/OsgiUtils.java?rev=1083569&r1=1083568&r2=1083569&view=diff
==============================================================================
--- directory/shared/trunk/util/src/main/java/org/apache/directory/shared/util/OsgiUtils.java
(original)
+++ directory/shared/trunk/util/src/main/java/org/apache/directory/shared/util/OsgiUtils.java
Sun Mar 20 21:09:28 2011
@@ -23,6 +23,7 @@ import java.io.File;
 import java.io.FileFilter;
 import java.io.IOException;
 import java.util.HashSet;
+import java.util.Map;
 import java.util.Set;
 import java.util.jar.Attributes;
 import java.util.jar.JarFile;
@@ -191,12 +192,11 @@ public class OsgiUtils
                 return null;
             }
             
-            Attributes attrs = manifest.getMainAttributes();
-            for ( Object key : attrs.keySet() )
+            for (Map.Entry<Object, Object> attr : manifest.getMainAttributes().entrySet()
)
             {
-                if ( key.toString().equals( "Export-Package" ) )
+                if ( attr.getKey().toString().equals( "Export-Package" ) )
                 {
-                    return attrs.get( key ).toString();
+                    return attr.getValue().toString();
                 }
             }
             



Mime
View raw message