pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1682337 - in /pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples: acroforms/CreateFormField.java pdmodel/PrintURLs.java pdmodel/ReplaceURLs.java signature/CreateSignature.java util/RemoveAllText.java
Date Thu, 28 May 2015 21:19:02 GMT
Author: tilman
Date: Thu May 28 21:19:02 2015
New Revision: 1682337

URL: http://svn.apache.org/r1682337
Log:
PDFBOX-2576: convert for loops; remove unneeded casts

Modified:
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/acroforms/CreateFormField.java
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/PrintURLs.java
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ReplaceURLs.java
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignature.java
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/RemoveAllText.java

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/acroforms/CreateFormField.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/acroforms/CreateFormField.java?rev=1682337&r1=1682336&r2=1682337&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/acroforms/CreateFormField.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/acroforms/CreateFormField.java
Thu May 28 21:19:02 2015
@@ -63,10 +63,10 @@ public class CreateFormField
         // and add it to the page
         PDAnnotationWidget widget = textBox.getWidgets().get(0);
         PDRectangle rect = new PDRectangle();
-        rect.setLowerLeftX((float) 50);
-        rect.setLowerLeftY((float) 750);
-        rect.setUpperRightX((float) 250);
-        rect.setUpperRightY((float) 800);
+        rect.setLowerLeftX(50);
+        rect.setLowerLeftY(750);
+        rect.setUpperRightX(250);
+        rect.setUpperRightY(800);
         widget.setRectangle(rect);
         page.getAnnotations().add(widget);
         

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/PrintURLs.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/PrintURLs.java?rev=1682337&r1=1682336&r2=1682337&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/PrintURLs.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/PrintURLs.java
Thu May 28 21:19:02 2015
@@ -75,7 +75,7 @@ public class PrintURLs
                     //first setup text extraction regions
                     for( int j=0; j<annotations.size(); j++ )
                     {
-                        PDAnnotation annot = (PDAnnotation)annotations.get( j );
+                        PDAnnotation annot = annotations.get(j);
                         if( annot instanceof PDAnnotationLink )
                         {
                             PDAnnotationLink link = (PDAnnotationLink)annot;
@@ -105,7 +105,7 @@ public class PrintURLs
 
                     for( int j=0; j<annotations.size(); j++ )
                     {
-                        PDAnnotation annot = (PDAnnotation)annotations.get( j );
+                        PDAnnotation annot = annotations.get(j);
                         if( annot instanceof PDAnnotationLink )
                         {
                             PDAnnotationLink link = (PDAnnotationLink)annot;

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ReplaceURLs.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ReplaceURLs.java?rev=1682337&r1=1682336&r2=1682337&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ReplaceURLs.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/ReplaceURLs.java
Thu May 28 21:19:02 2015
@@ -72,9 +72,9 @@ public class ReplaceURLs
                     pageNum++;
                     List<PDAnnotation> annotations = page.getAnnotations();
 
-                    for( int j=0; j<annotations.size(); j++ )
+                    for (PDAnnotation annotation : annotations)
                     {
-                        PDAnnotation annot = (PDAnnotation)annotations.get( j );
+                        PDAnnotation annot = annotation;
                         if( annot instanceof PDAnnotationLink )
                         {
                             PDAnnotationLink link = (PDAnnotationLink)annot;

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignature.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignature.java?rev=1682337&r1=1682336&r2=1682337&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignature.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/signature/CreateSignature.java
Thu May 28 21:19:02 2015
@@ -190,7 +190,7 @@ public class CreateSignature implements
         SignerInformationStore signerStore = signedData.getSignerInfos();
         List<SignerInformation> newSigners = new ArrayList<SignerInformation>();
 
-        for (SignerInformation signer : (Collection<SignerInformation>)signerStore.getSigners())
+        for (SignerInformation signer : signerStore.getSigners())
         {
             newSigners.add(signTimeStamp(signer));
         }

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/RemoveAllText.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/RemoveAllText.java?rev=1682337&r1=1682336&r2=1682337&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/RemoveAllText.java
(original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/util/RemoveAllText.java
Thu May 28 21:19:02 2015
@@ -74,9 +74,8 @@ public class RemoveAllText
                     parser.parse();
                     List<Object> tokens = parser.getTokens();
                     List<Object> newTokens = new ArrayList<Object>();
-                    for( int j=0; j<tokens.size(); j++)
+                    for (Object token : tokens)
                     {
-                        Object token = tokens.get( j );
                         if( token instanceof Operator)
                         {
                             Operator op = (Operator)token;
@@ -88,7 +87,6 @@ public class RemoveAllText
                             }
                         }
                         newTokens.add( token );
-
                     }
                     PDStream newContents = new PDStream( document );
                     ContentStreamWriter writer = new ContentStreamWriter( newContents.createOutputStream()
);



Mime
View raw message