pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1646647 - /pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/fdf/PrintFields.java
Date Fri, 19 Dec 2014 08:08:42 GMT
Author: tilman
Date: Fri Dec 19 08:08:42 2014
New Revision: 1646647

URL: http://svn.apache.org/r1646647
Log:
PDFBOX-2576: misc code cleanup

Modified:
    pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/fdf/PrintFields.java

Modified: pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/fdf/PrintFields.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/fdf/PrintFields.java?rev=1646647&r1=1646646&r2=1646647&view=diff
==============================================================================
--- pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/fdf/PrintFields.java (original)
+++ pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/fdf/PrintFields.java Fri
Dec 19 08:08:42 2014
@@ -54,7 +54,7 @@ public class PrintFields
         List<PDFieldTreeNode> fields = acroForm.getFields();
         Iterator<PDFieldTreeNode> fieldsIter = fields.iterator();
 
-        System.out.println(new Integer(fields.size()).toString() + " top-level fields were
found on the form");
+        System.out.println(fields.size() + " top-level fields were found on the form");
 
         while (fieldsIter.hasNext())
         {
@@ -70,7 +70,7 @@ public class PrintFields
         if (kids != null)
         {
             Iterator<COSObjectable> kidsIter = kids.iterator();
-            if (field != null && !sParent.equals(field.getPartialName()))
+            if (!sParent.equals(field.getPartialName()))
             {
                 if (partialName != null)
                 {
@@ -90,7 +90,7 @@ public class PrintFields
         }
         else
         {
-            String fieldValue = null;
+            String fieldValue;
             if (field instanceof PDSignatureField)
             {
                 // PDSignatureField doesn't have a value
@@ -115,10 +115,10 @@ public class PrintFields
             StringBuilder outputString = new StringBuilder(sLevel + sParent);
             if (partialName != null)
             {
-                outputString.append( "." + partialName);
+                outputString.append(".").append(partialName);
             }
-            outputString.append(" = " + fieldValue);
-            outputString.append(",  type=" + field.getClass().getName());
+            outputString.append(" = ").append(fieldValue);
+            outputString.append(",  type=").append(field.getClass().getName());
             System.out.println(outputString);
         }
     }



Mime
View raw message