pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1567227 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java
Date Tue, 11 Feb 2014 17:33:04 GMT
Author: tilman
Date: Tue Feb 11 17:33:04 2014
New Revision: 1567227

URL: http://svn.apache.org/r1567227
Log:
PDFBOX-1901: fix confusing null check as proposed by Jens Kapitza; removed unneeded null assignments

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java?rev=1567227&r1=1567226&r2=1567227&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPage.java Tue Feb 11 17:33:04
2014
@@ -230,7 +230,7 @@ public class PDPage implements COSObject
     {
         PDResources retval = getResources();
         PDPageNode parentNode = getParent();
-        if (retval == null && parent != null)
+        if (retval == null && parentNode != null)
         {
             retval = parentNode.findResources();
         }
@@ -422,7 +422,7 @@ public class PDPage implements COSObject
      */
     public PDRectangle getBleedBox()
     {
-        PDRectangle retval = null;
+        PDRectangle retval;
         COSArray array = (COSArray) page.getDictionaryObject(COSName.BLEED_BOX);
         if (array != null)
         {
@@ -460,7 +460,7 @@ public class PDPage implements COSObject
      */
     public PDRectangle getTrimBox()
     {
-        PDRectangle retval = null;
+        PDRectangle retval;
         COSArray array = (COSArray) page.getDictionaryObject(COSName.TRIM_BOX);
         if (array != null)
         {
@@ -498,7 +498,7 @@ public class PDPage implements COSObject
      */
     public PDRectangle getArtBox()
     {
-        PDRectangle retval = null;
+        PDRectangle retval;
         COSArray array = (COSArray) page.getDictionaryObject(COSName.ART_BOX);
         if (array != null)
         {
@@ -710,7 +710,7 @@ public class PDPage implements COSObject
      */
     public List<PDAnnotation> getAnnotations() throws IOException
     {
-        COSArrayList<PDAnnotation> retval = null;
+        COSArrayList<PDAnnotation> retval;
         COSArray annots = (COSArray) page.getDictionaryObject(COSName.ANNOTS);
         if (annots == null)
         {



Mime
View raw message