pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1650796 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSDictionaryMap.java
Date Sat, 10 Jan 2015 19:26:41 GMT
Author: tilman
Date: Sat Jan 10 19:26:40 2015
New Revision: 1650796

URL: http://svn.apache.org/r1650796
Log:
PDFBOX-2576: use foreach loop, adjust parameters and javadoc

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSDictionaryMap.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSDictionaryMap.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSDictionaryMap.java?rev=1650796&r1=1650795&r2=1650796&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSDictionaryMap.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSDictionaryMap.java
Sat Jan 10 19:26:40 2015
@@ -20,7 +20,6 @@ import java.io.IOException;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
@@ -40,8 +39,8 @@ import org.apache.pdfbox.cos.COSString;
  */
 public class COSDictionaryMap<K,V> implements Map<K,V>
 {
-    private COSDictionary map;
-    private Map<K,V> actuals;
+    private final COSDictionary map;
+    private final Map<K,V> actuals;
 
     /**
      * Constructor for this map.
@@ -204,19 +203,17 @@ public class COSDictionaryMap<K,V> imple
 
     /**
      * This will take a map&lt;java.lang.String,org.apache.pdfbox.pdmodel.COSObjectable&gt;
-     * and convert it into a COSDictionary&lt;COSName,COSBase&gt;.
+     * and convert it into a COSDictionary.
      *
      * @param someMap A map containing COSObjectables
      *
      * @return A proper COSDictionary
      */
-    public static COSDictionary convert( Map<?,?> someMap )
+    public static COSDictionary convert(Map<String, ?> someMap)
     {
-        Iterator<?> iter = someMap.keySet().iterator();
         COSDictionary dic = new COSDictionary();
-        while( iter.hasNext() )
+        for (String name : someMap.keySet())
         {
-            String name = (String)iter.next();
             COSObjectable object = (COSObjectable)someMap.get( name );
             dic.setItem( COSName.getPDFName( name ), object.getCOSObject() );
         }



Mime
View raw message