pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1759669 - in /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox: cos/COSArray.java pdmodel/common/COSArrayList.java
Date Wed, 07 Sep 2016 19:27:02 GMT
Author: tilman
Date: Wed Sep  7 19:27:02 2016
New Revision: 1759669

URL: http://svn.apache.org/viewvc?rev=1759669&view=rev
Log:
PDFBOX-2852: user foreach loop, as suggested by Simon Steiner

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSArray.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSArrayList.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSArray.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSArray.java?rev=1759669&r1=1759668&r2=1759669&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSArray.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSArray.java Wed Sep  7 19:27:02
2016
@@ -550,9 +550,9 @@ public class COSArray extends COSBase im
     public void setFloatArray( float[] value )
     {
         this.clear();
-        for( int i=0; i<value.length; i++ )
+        for (float aValue : value)
         {
-            add( new COSFloat( value[i] ) );
+            add(new COSFloat(aValue));
         }
     }
 

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSArrayList.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSArrayList.java?rev=1759669&r1=1759668&r2=1759669&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSArrayList.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/COSArrayList.java Wed
Sep  7 19:27:02 2016
@@ -429,10 +429,8 @@ public class COSArrayList<E> implements
             else
             {
                 array = new COSArray();
-                Iterator<?> iter = cosObjectableList.iterator();
-                while( iter.hasNext() )
+                for (Object next : cosObjectableList)
                 {
-                    Object next = iter.next();
                     if( next instanceof String )
                     {
                         array.add( new COSString( (String)next ) );
@@ -468,10 +466,8 @@ public class COSArrayList<E> implements
     private List<COSBase> toCOSObjectList( Collection<?> list )
     {
         List<COSBase> cosObjects = new ArrayList<COSBase>();
-        Iterator<?> iter = list.iterator();
-        while( iter.hasNext() )
+        for (Object next : list)
         {
-            Object next = iter.next();
             if( next instanceof String )
             {
                 cosObjects.add( new COSString( (String)next ) );



Mime
View raw message