You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2017/08/02 16:34:48 UTC

svn commit: r1803857 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceN.java

Author: tilman
Date: Wed Aug  2 16:34:48 2017
New Revision: 1803857

URL: http://svn.apache.org/viewvc?rev=1803857&view=rev
Log:
PDFBOX-2852: remove unneeded nullcheck

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceN.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceN.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceN.java?rev=1803857&r1=1803856&r2=1803857&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceN.java (original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDDeviceN.java Wed Aug  2 16:34:48 2017
@@ -141,34 +141,32 @@ public class PDDeviceN extends PDSpecial
 
         // spot colorants
         spotColorSpaces = new PDSeparation[numColorants];
-        if (attributes.getColorants() != null)
-        {
-            // spot color spaces
-            Map<String, PDSeparation> spotColorants = attributes.getColorants();
 
-            // map each colorant to the corresponding spot color space
-            for (int c = 0; c < numColorants; c++)
+        // spot color spaces
+        Map<String, PDSeparation> spotColorants = attributes.getColorants();
+
+        // map each colorant to the corresponding spot color space
+        for (int c = 0; c < numColorants; c++)
+        {
+            String name = colorantNames.get(c);
+            PDSeparation spot = spotColorants.get(name);
+            if (spot != null)
             {
-                String name = colorantNames.get(c);
-                PDSeparation spot = spotColorants.get(name);
-                if (spot != null)
-                {
-                    // spot colorant
-                    spotColorSpaces[c] = spot;
+                // spot colorant
+                spotColorSpaces[c] = spot;
 
-                    // spot colors may replace process colors with same name
-                    // providing that the subtype is not NChannel.
-                    if (!isNChannel())
-                    {
-                        colorantToComponent[c] = -1;
-                    }
-                }
-                else
+                // spot colors may replace process colors with same name
+                // providing that the subtype is not NChannel.
+                if (!isNChannel())
                 {
-                    // process colorant
-                    spotColorSpaces[c] = null;
+                    colorantToComponent[c] = -1;
                 }
             }
+            else
+            {
+                // process colorant
+                spotColorSpaces[c] = null;
+            }
         }
     }