pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From msahy...@apache.org
Subject svn commit: r1825552 - in /pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight: process/reflect/ShadingPatternValidationProcess.java process/reflect/SinglePageValidationProcess.java utils/COSUtils.java xobject/XObjImageValidator.java
Date Wed, 28 Feb 2018 11:47:12 GMT
Author: msahyoun
Date: Wed Feb 28 11:47:12 2018
New Revision: 1825552

URL: http://svn.apache.org/viewvc?rev=1825552&view=rev
Log:
PDFBOX-4118: retain exception in log message; use LOG.debug for ignored exceptions

Modified:
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/ShadingPatternValidationProcess.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/SinglePageValidationProcess.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/utils/COSUtils.java
    pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/xobject/XObjImageValidator.java

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/ShadingPatternValidationProcess.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/ShadingPatternValidationProcess.java?rev=1825552&r1=1825551&r2=1825552&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/ShadingPatternValidationProcess.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/ShadingPatternValidationProcess.java
Wed Feb 28 11:47:12 2018
@@ -27,6 +27,9 @@ import static org.apache.pdfbox.prefligh
 import static org.apache.pdfbox.preflight.PreflightConstants.ERROR_GRAPHIC_INVALID_UNKNOWN_COLOR_SPACE;
 import static org.apache.pdfbox.preflight.PreflightConstants.TRANPARENCY_DICTIONARY_KEY_EXTGSTATE;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.pdmodel.PDPage;
 import org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace;
@@ -45,7 +48,8 @@ import org.apache.pdfbox.preflight.utils
 
 public class ShadingPatternValidationProcess extends AbstractProcess
 {
-
+    private static final Log LOGGER = LogFactory.getLog(ShadingPatternValidationProcess.class);
+    
     @Override
     public void validate(PreflightContext context) throws ValidationException
     {
@@ -92,6 +96,7 @@ public class ShadingPatternValidationPro
         }
         catch (IOException e)
         {
+            LOGGER.debug("Unable to get the color space", e);
             context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_UNKNOWN_COLOR_SPACE,
e.getMessage()));
         }
     }

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/SinglePageValidationProcess.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/SinglePageValidationProcess.java?rev=1825552&r1=1825551&r2=1825552&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/SinglePageValidationProcess.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/process/reflect/SinglePageValidationProcess.java
Wed Feb 28 11:47:12 2018
@@ -35,6 +35,9 @@ import static org.apache.pdfbox.prefligh
 import java.io.IOException;
 import java.util.List;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 import org.apache.pdfbox.cos.COSBase;
 import org.apache.pdfbox.cos.COSDictionary;
 import org.apache.pdfbox.cos.COSName;
@@ -62,6 +65,7 @@ import org.apache.pdfbox.preflight.utils
 
 public class SinglePageValidationProcess extends AbstractProcess
 {
+    private static final Log LOGGER = LogFactory.getLog(SinglePageValidationProcess.class);
 
     @Override
     public void validate(PreflightContext context) throws ValidationException
@@ -128,7 +132,7 @@ public class SinglePageValidationProcess
                 catch (IOException e)
                 {
                     // fixme: this code was previously in PDResources
-                    // LOG.error("error while creating a colorspace", exception);
+                    LOGGER.debug("Unable to create colorspace", e);
                 }
             }
         }
@@ -158,6 +162,7 @@ public class SinglePageValidationProcess
             }
             catch (IOException e)
             {
+                LOGGER.debug("Unable to read Thumb image", e);
                 context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID, "Unable
to read Thumb image : "
                         + e.getMessage()));
             }
@@ -185,6 +190,7 @@ public class SinglePageValidationProcess
         }
         catch (IOException e)
         {
+            LOGGER.debug("Unable to read page contet stream", e);
             context.addValidationError(new ValidationError(ERROR_UNKOWN_ERROR, e.getMessage(),
e));
         }
     }

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/utils/COSUtils.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/utils/COSUtils.java?rev=1825552&r1=1825551&r2=1825552&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/utils/COSUtils.java (original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/utils/COSUtils.java Wed
Feb 28 11:47:12 2018
@@ -66,6 +66,7 @@ public final class COSUtils
             }
             catch (IOException e)
             {
+                LOGGER.debug("Couldn't get COSObject from object pool - returning false",
e);
                 return false;
             }
         }
@@ -91,6 +92,7 @@ public final class COSUtils
             }
             catch (IOException e)
             {
+                LOGGER.debug("Couldn't get COSObject from object pool - returning false",
e);
                 return false;
             }
         }
@@ -117,6 +119,7 @@ public final class COSUtils
             }
             catch (IOException e)
             {
+                LOGGER.debug("Couldn't get COSObject from object pool - returning false",
e);
                 return false;
             }
         }
@@ -143,6 +146,7 @@ public final class COSUtils
             }
             catch (IOException e)
             {
+                LOGGER.debug("Couldn't get COSObject from object pool - returning false",
e);
                 return false;
             }
         }
@@ -181,6 +185,7 @@ public final class COSUtils
             }
             catch (IOException e)
             {
+                LOGGER.debug("Couldn't get COSObject from object pool - returning false",
e);
                 return false;
             }
         }
@@ -207,6 +212,7 @@ public final class COSUtils
             }
             catch (IOException e)
             {
+                LOGGER.debug("Couldn't get COSObject from object pool - returning false",
e);
                 return false;
             }
         }
@@ -241,6 +247,7 @@ public final class COSUtils
             }
             catch (IOException e)
             {
+                LOGGER.debug("Couldn't get COSObject from object pool - returning null",
e);
                 return null;
             }
         }
@@ -286,6 +293,7 @@ public final class COSUtils
             }
             catch (IOException e)
             {
+                LOGGER.debug("Couldn't get COSObject from object pool - returning null",
e);
                 return null;
             }
         }
@@ -330,6 +338,7 @@ public final class COSUtils
             }
             catch (IOException e)
             {
+                LOGGER.debug("Couldn't get COSObject from object pool - returning null",
e);
                 return null;
             }
         }
@@ -370,6 +379,7 @@ public final class COSUtils
             }
             catch (IOException e)
             {
+                LOGGER.debug("Couldn't get COSObject from object pool - returning null",
e);
                 return null;
             }
         }
@@ -414,6 +424,7 @@ public final class COSUtils
             }
             catch (IOException e)
             {
+                LOGGER.debug("Couldn't get COSObject from object pool - returning null",
e);
                 return null;
             }
         }
@@ -458,6 +469,7 @@ public final class COSUtils
             }
             catch (IOException e)
             {
+                LOGGER.debug("Couldn't get COSObject from object pool - returning null",
e);
                 return null;
             }
         }
@@ -488,7 +500,7 @@ public final class COSUtils
         }
         catch (IOException e)
         {
-            LOGGER.warn("Error occured during the close of a COSDocument : " + e.getMessage());
+            LOGGER.warn("Error occured during the close of a COSDocument : " + e.getMessage(),
e);
         }
     }
 

Modified: pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/xobject/XObjImageValidator.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/xobject/XObjImageValidator.java?rev=1825552&r1=1825551&r2=1825552&view=diff
==============================================================================
--- pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/xobject/XObjImageValidator.java
(original)
+++ pdfbox/trunk/preflight/src/main/java/org/apache/pdfbox/preflight/xobject/XObjImageValidator.java
Wed Feb 28 11:47:12 2018
@@ -27,6 +27,8 @@ import static org.apache.pdfbox.prefligh
 import static org.apache.pdfbox.preflight.PreflightConstants.ERROR_GRAPHIC_UNEXPECTED_VALUE_FOR_KEY;
 
 import java.io.IOException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 
 import org.apache.pdfbox.cos.COSBase;
 import org.apache.pdfbox.cos.COSBoolean;
@@ -48,6 +50,8 @@ import org.apache.pdfbox.preflight.utils
  */
 public class XObjImageValidator extends AbstractXObjValidator
 {
+    private static final Log LOGGER = LogFactory.getLog(XObjImageValidator.class);
+
     protected PDImageXObject xImage = null;
 
     public XObjImageValidator(PreflightContext context, PDImageXObject xobj)
@@ -145,6 +149,7 @@ public class XObjImageValidator extends
             }
             catch (IOException e)
             {
+                LOGGER.debug("Couldn't create PDColorSpace " + csImg, e);
                 context.addValidationError(new ValidationError(ERROR_GRAPHIC_INVALID_UNKNOWN_COLOR_SPACE));
             }
         }



Mime
View raw message