pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1702111 - /pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/pdfdebugger/streampane/Stream.java
Date Wed, 09 Sep 2015 21:04:13 GMT
Author: tilman
Date: Wed Sep  9 21:04:13 2015
New Revision: 1702111

URL: http://svn.apache.org/r1702111
Log:
PDFBOX-2941: instanceof is never null, thus no null check needed

Modified:
    pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/pdfdebugger/streampane/Stream.java

Modified: pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/pdfdebugger/streampane/Stream.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/pdfdebugger/streampane/Stream.java?rev=1702111&r1=1702110&r2=1702111&view=diff
==============================================================================
--- pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/pdfdebugger/streampane/Stream.java
(original)
+++ pdfbox/trunk/tools/src/main/java/org/apache/pdfbox/tools/pdfdebugger/streampane/Stream.java
Wed Sep  9 21:04:13 2015
@@ -94,23 +94,20 @@ public class Stream
     {
         StringBuilder sb = new StringBuilder();
         COSBase filters = stream.getFilters();
-        if (filters != null)
+        if (filters instanceof COSName)
         {
-            if (filters instanceof COSName)
-            {
-                sb.append(((COSName) filters).getName());
-            }
-            else if (filters instanceof COSArray)
+            sb.append(((COSName) filters).getName());
+        }
+        else if (filters instanceof COSArray)
+        {
+            COSArray filterArray = (COSArray) filters;
+            for (int i = 0; i < filterArray.size(); i++)
             {
-                COSArray filterArray = (COSArray) filters;
-                for (int i = 0; i < filterArray.size(); i++)
+                if (i > 0)
                 {
-                    if (i > 0)
-                    {
-                        sb.append(", ");
-                    }
-                    sb.append(((COSName) filterArray.get(i)).getName());
+                    sb.append(", ");
                 }
+                sb.append(((COSName) filterArray.get(i)).getName());
             }
         }
         return "Filtered (" + sb.toString() + ")" ;



Mime
View raw message