pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1646650 - in /pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic: DeviceColorSpaceHelper.java NoPatternColorSpaceHelper.java StandardColorSpaceHelper.java
Date Fri, 19 Dec 2014 08:24:53 GMT
Author: tilman
Date: Fri Dec 19 08:24:53 2014
New Revision: 1646650

URL: http://svn.apache.org/r1646650
Log:
PDFBOX-2576: ICC_Profile.getInstance is never null; add @override where needed

Modified:
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/DeviceColorSpaceHelper.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/NoPatternColorSpaceHelper.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/StandardColorSpaceHelper.java

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/DeviceColorSpaceHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/DeviceColorSpaceHelper.java?rev=1646650&r1=1646649&r2=1646650&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/DeviceColorSpaceHelper.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/DeviceColorSpaceHelper.java
Fri Dec 19 08:24:53 2014
@@ -45,6 +45,7 @@ public class DeviceColorSpaceHelper exte
      * This method updates the given list with a ValidationError (ERROR_GRAPHIC_INVALID_PATTERN_COLOR_SPACE_FORBIDDEN)
      * and returns false.
      */
+    @Override
     protected void processPatternColorSpace(PDColorSpace pdcs)
     {
         context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_COLOR_SPACE_FORBIDDEN,
@@ -55,6 +56,7 @@ public class DeviceColorSpaceHelper exte
      * This method updates the given list with a ValidationError (ERROR_GRAPHIC_INVALID_PATTERN_COLOR_SPACE_FORBIDDEN)
      * and returns false.
      */
+    @Override
     protected void processDeviceNColorSpace(PDColorSpace pdcs)
     {
         context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_COLOR_SPACE_FORBIDDEN,
@@ -66,6 +68,7 @@ public class DeviceColorSpaceHelper exte
      * given list is updated with a ValidationError (ERROR_GRAPHIC_INVALID_PATTERN_COLOR_SPACE_FORBIDDEN)
and returns
      * false.
      */
+    @Override
     protected void processIndexedColorSpace(PDColorSpace pdcs)
     {
         PDIndexed indexed = (PDIndexed) pdcs;

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/NoPatternColorSpaceHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/NoPatternColorSpaceHelper.java?rev=1646650&r1=1646649&r2=1646650&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/NoPatternColorSpaceHelper.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/NoPatternColorSpaceHelper.java
Fri Dec 19 08:24:53 2014
@@ -43,6 +43,7 @@ public class NoPatternColorSpaceHelper e
      * This method updates the given list with a ValidationError (ERROR_GRAPHIC_INVALID_PATTERN_COLOR_SPACE_FORBIDDEN)
      * and returns false.
      */
+    @Override
     protected void processPatternColorSpace(PDColorSpace pdcs)
     {
         context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_PATTERN_COLOR_SPACE_FORBIDDEN,

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/StandardColorSpaceHelper.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/StandardColorSpaceHelper.java?rev=1646650&r1=1646649&r2=1646650&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/StandardColorSpaceHelper.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/graphic/StandardColorSpaceHelper.java
Fri Dec 19 08:24:53 2014
@@ -35,7 +35,6 @@ import static org.apache.pdfbox.prefligh
 
 import java.awt.color.ICC_Profile;
 import java.io.IOException;
-import java.util.List;
 import java.util.Map;
 
 import org.apache.pdfbox.cos.COSArray;
@@ -82,6 +81,7 @@ public class StandardColorSpaceHelper im
      * 
      * @see net.awl.edoc.pdfa.validation.graphics.color.ColorSpaceHelper#validate(java .util.List)
      */
+    @Override
     public final void validate() throws ValidationException
     {
         if (pdcs == null)
@@ -232,13 +232,7 @@ public class StandardColorSpaceHelper im
         PDICCBased iccBased = (PDICCBased) pdcs;
         try
         {
-            ICC_Profile iccp = ICC_Profile.getInstance(iccBased.getPDStream().getByteArray());
-            if (iccp == null)
-            {
-                context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_COLOR_SPACE_ICCBASED,
-                        "Unable to read ICCBase color space "));
-                return;
-            }
+            ICC_Profile.getInstance(iccBased.getPDStream().getByteArray());
             PDColorSpace altpdcs = iccBased.getAlternateColorSpace();
             if (altpdcs != null)
             {



Mime
View raw message