pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1780585 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDICCBased.java
Date Fri, 27 Jan 2017 16:49:31 GMT
Author: tilman
Date: Fri Jan 27 16:49:31 2017
New Revision: 1780585

URL: http://svn.apache.org/viewvc?rev=1780585&view=rev
Log:
PDFBOX-2852: use switch

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDICCBased.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDICCBased.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDICCBased.java?rev=1780585&r1=1780584&r2=1780585&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDICCBased.java
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/graphics/color/PDICCBased.java
Fri Jan 27 16:49:31 2017
@@ -260,21 +260,19 @@ public final class PDICCBased extends PD
             alternateArray = new COSArray();
             int numComponents = getNumberOfComponents();
             COSName csName;
-            if(numComponents == 1)
+            switch (numComponents)
             {
-                csName = COSName.DEVICEGRAY;
-            }
-            else if(numComponents == 3)
-            {
-                csName = COSName.DEVICERGB;
-            }
-            else if(numComponents == 4)
-            {
-                csName = COSName.DEVICECMYK;
-            }
-            else
-            {
-                throw new IOException("Unknown color space number of components:" + numComponents);
+                case 1:
+                    csName = COSName.DEVICEGRAY;
+                    break;
+                case 3:
+                    csName = COSName.DEVICERGB;
+                    break;
+                case 4:
+                    csName = COSName.DEVICECMYK;
+                    break;
+                default:
+                    throw new IOException("Unknown color space number of components:" + numComponents);
             }
             alternateArray.add(csName);
         }



Mime
View raw message