Author: msahyoun
Date: Thu Feb 22 11:05:50 2018
New Revision: 1825046

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

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSDictionary.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSStream.java
    
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDObjectReference.java
    
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java
    
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotation.java
    
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationFreeText.java
    
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationInk.java
    
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolygon.java
    
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolyline.java
    
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
    
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType0.java
    
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1CFont.java
    
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
    
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3Font.java
    
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/encoding/GlyphList.java

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSDictionary.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSDictionary.java?rev=1825046&r1=1825045&r2=1825046&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSDictionary.java 
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSDictionary.java 
Thu Feb 22 11:05:50 2018
@@ -28,6 +28,9 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 import org.apache.pdfbox.io.IOUtils;
 import org.apache.pdfbox.pdmodel.common.COSObjectable;
 import org.apache.pdfbox.util.DateConverter;
@@ -41,6 +44,11 @@ import org.apache.pdfbox.util.SmallMap;
  */
 public class COSDictionary extends COSBase implements COSUpdateInfo
 {
+
+    /**
+     * Log instance.
+     */
+    private static final Log LOG = LogFactory.getLog(COSDictionary.class);
        
     private static final String PATH_SEPARATOR = "/";
     private boolean needToBeUpdated;
@@ -1515,6 +1523,7 @@ public class COSDictionary extends COSBa
         }
         catch (IOException e)
         {
+            LOG.debug("An exception occured trying - returning error message 
instead", e);
             return "COSDictionary{" + e.getMessage() + "}";
         }
     }

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSStream.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSStream.java?rev=1825046&r1=1825045&r2=1825046&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSStream.java 
(original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/cos/COSStream.java Thu 
Feb 22 11:05:50 2018
@@ -374,6 +374,7 @@ public class COSStream extends COSDictio
         }
         catch (IOException e)
         {
+            LOG.debug("An exception occured trying to get the content - 
returning empty string instead", e);
             return "";
         }
         finally

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDObjectReference.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDObjectReference.java?rev=1825046&r1=1825045&r2=1825046&view=diff
==============================================================================
--- 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDObjectReference.java
 (original)
+++ 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/documentinterchange/logicalstructure/PDObjectReference.java
 Thu Feb 22 11:05:50 2018
@@ -18,6 +18,9 @@ package org.apache.pdfbox.pdmodel.docume
 
 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.COSDictionary;
 import org.apache.pdfbox.cos.COSName;
@@ -36,6 +39,10 @@ import org.apache.pdfbox.pdmodel.interac
  */
 public class PDObjectReference implements COSObjectable
 {
+    /**
+     * Log instance.
+     */
+    private static final Log LOG = LogFactory.getLog(PDObjectReference.class);
 
     /**
      * TYPE of this object.
@@ -115,6 +122,7 @@ public class PDObjectReference implement
         }
         catch (IOException exception)
         {
+            LOG.debug("Couldn't get the referenced object - returning null 
instead", exception);
             // this can only happen if the target is an XObject.
         }
         return null;

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java?rev=1825046&r1=1825045&r2=1825046&view=diff
==============================================================================
--- 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java
 (original)
+++ 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/encryption/SecurityHandler.java
 Thu Feb 22 11:05:50 2018
@@ -512,7 +512,7 @@ public abstract class SecurityHandler
         catch (IOException ex)
         {
             LOG.error("Failed to decrypt COSString of length " + 
string.getBytes().length + 
-                    " in object " + objNum + ": " + ex.getMessage());
+                    " in object " + objNum + ": " + ex.getMessage(), ex);
         }
     }
 

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotation.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotation.java?rev=1825046&r1=1825045&r2=1825046&view=diff
==============================================================================
--- 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotation.java
 (original)
+++ 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotation.java
 Thu Feb 22 11:05:50 2018
@@ -231,7 +231,7 @@ public abstract class FDFAnnotation impl
         }
         catch (XPathExpressionException e)
         {
-            LOG.debug("Error while evaluating XPath expression for richtext 
contents");
+            LOG.debug("Error while evaluating XPath expression for richtext 
contents", e);
         }
 
         try
@@ -246,7 +246,7 @@ public abstract class FDFAnnotation impl
         }
         catch (XPathExpressionException e)
         {
-            LOG.debug("Error while evaluating XPath expression for richtext 
contents");
+            LOG.debug("Error while evaluating XPath expression for richtext 
contents", e);
         }
 
         PDBorderStyleDictionary borderStyle = new PDBorderStyleDictionary();
@@ -987,7 +987,7 @@ public abstract class FDFAnnotation impl
         }
         catch (XPathExpressionException e)
         {
-            LOG.debug("Error while evaluating XPath expression for richtext 
contents");
+            LOG.debug("Error while evaluating XPath expression for richtext 
contents", e);
         }
         return retval;
     }

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationFreeText.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationFreeText.java?rev=1825046&r1=1825045&r2=1825046&view=diff
==============================================================================
--- 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationFreeText.java
 (original)
+++ 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationFreeText.java
 Thu Feb 22 11:05:50 2018
@@ -83,7 +83,7 @@ public class FDFAnnotationFreeText exten
         }
         catch (XPathExpressionException ex)
         {
-            LOG.debug("Error while evaluating XPath expression");
+            LOG.debug("Error while evaluating XPath expression", ex);
         }
         initCallout(element);
         String rotation = element.getAttribute("rotation");

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationInk.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationInk.java?rev=1825046&r1=1825045&r2=1825046&view=diff
==============================================================================
--- 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationInk.java
 (original)
+++ 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationInk.java
 Thu Feb 22 11:05:50 2018
@@ -108,7 +108,7 @@ public class FDFAnnotationInk extends FD
         }
         catch (XPathExpressionException e)
         {
-            LOG.debug("Error while evaluating XPath expression for inklist 
gestures");
+            LOG.debug("Error while evaluating XPath expression for inklist 
gestures", e);
         }
     }
 

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolygon.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolygon.java?rev=1825046&r1=1825045&r2=1825046&view=diff
==============================================================================
--- 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolygon.java
 (original)
+++ 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolygon.java
 Thu Feb 22 11:05:50 2018
@@ -104,7 +104,7 @@ public class FDFAnnotationPolygon extend
         }
         catch (XPathExpressionException e)
         {
-            LOG.debug("Error while evaluating XPath expression for polygon 
vertices");
+            LOG.debug("Error while evaluating XPath expression for polygon 
vertices", e);
         }
     }
 

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolyline.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolyline.java?rev=1825046&r1=1825045&r2=1825046&view=diff
==============================================================================
--- 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolyline.java
 (original)
+++ 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/fdf/FDFAnnotationPolyline.java
 Thu Feb 22 11:05:50 2018
@@ -100,7 +100,7 @@ public class FDFAnnotationPolyline exten
         }
         catch (XPathExpressionException e)
         {
-            LOG.debug("Error while evaluating XPath expression for polyline 
vertices");
+            LOG.debug("Error while evaluating XPath expression for polyline 
vertices", e);
         }
     }
 

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java?rev=1825046&r1=1825045&r2=1825046&view=diff
==============================================================================
--- 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
 (original)
+++ 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FileSystemFontProvider.java
 Thu Feb 22 11:05:50 2018
@@ -300,6 +300,7 @@ final class FileSystemFontProvider exten
             }
             catch (SecurityException e)
             {
+                LOG.debug("Couldn't create writer for " + 
file.getAbsolutePath(), e);
                 return;
             }
 

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType0.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType0.java?rev=1825046&r1=1825045&r2=1825046&view=diff
==============================================================================
--- 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType0.java
 (original)
+++ 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType0.java
 Thu Feb 22 11:05:50 2018
@@ -185,6 +185,7 @@ public class PDCIDFontType0 extends PDCI
                 }
                 catch (IOException e)
                 {
+                    LOG.debug("Couldn't get font matrix - returning default 
value", e);
                     return new Matrix(0.001f, 0, 0, 0.001f, 0, 0);
                 }
             }
@@ -235,6 +236,7 @@ public class PDCIDFontType0 extends PDCI
             }
             catch (IOException e)
             {
+                LOG.debug("Couldn't get font bounding box - returning default 
value", e);
                 return new BoundingBox();
             }
         }

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1CFont.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1CFont.java?rev=1825046&r1=1825045&r2=1825046&view=diff
==============================================================================
--- 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1CFont.java
 (original)
+++ 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1CFont.java
 Thu Feb 22 11:05:50 2018
@@ -270,6 +270,7 @@ public class PDType1CFont extends PDSimp
             }
             catch (IOException e)
             {
+                LOG.debug("Couldn't get font matrix - returning default 
value", e);
                 fontMatrix = DEFAULT_FONT_MATRIX;
             }
 

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java?rev=1825046&r1=1825045&r2=1825046&view=diff
==============================================================================
--- 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
 (original)
+++ 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
 Thu Feb 22 11:05:50 2018
@@ -156,6 +156,7 @@ public class PDType1Font extends PDSimpl
             }
             catch (IOException e)
             {
+                LOG.debug("Couldn't get font name - setting to '?'", e);
                 fontName = "?";
             }
             LOG.warn("Using fallback font " + fontName + " for base font " + 
getBaseFont());
@@ -265,7 +266,7 @@ public class PDType1Font extends PDSimpl
                 }
                 catch (DamagedFontException e)
                 {
-                    LOG.warn("Can't read damaged embedded Type1 font " + 
fd.getFontName());
+                    LOG.warn("Can't read damaged embedded Type1 font " + 
fd.getFontName(), e);
                     fontIsDamaged = true;
                 }
                 catch (IOException e)
@@ -669,6 +670,7 @@ public class PDType1Font extends PDSimpl
             }
             catch (IOException e)
             {
+                LOG.debug("Couldn't get font matrix box - returning default 
value", e);
                 fontMatrix = DEFAULT_FONT_MATRIX;
             }
             

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3Font.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3Font.java?rev=1825046&r1=1825045&r2=1825046&view=diff
==============================================================================
--- 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3Font.java
 (original)
+++ 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType3Font.java
 Thu Feb 22 11:05:50 2018
@@ -19,6 +19,10 @@ package org.apache.pdfbox.pdmodel.font;
 import java.awt.geom.GeneralPath;
 import java.io.IOException;
 import java.io.InputStream;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
 import org.apache.fontbox.FontBoxFont;
 import org.apache.fontbox.util.BoundingBox;
 import org.apache.pdfbox.cos.COSArray;
@@ -41,6 +45,11 @@ import org.apache.pdfbox.util.Vector;
  */
 public class PDType3Font extends PDSimpleFont
 {
+    /**
+     * Log instance.
+     */
+    private static final Log LOG = LogFactory.getLog(PDType3Font.class);
+
     private PDResources resources;
     private COSDictionary charProcs;
     private Matrix fontMatrix;
@@ -298,6 +307,7 @@ public class PDType3Font extends PDSimpl
                     catch (IOException ex)
                     {
                         // ignore
+                        LOG.debug("error getting the glyph bounding box - font 
bounding box will be used", ex);
                     }
                 }
             }

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/encoding/GlyphList.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/encoding/GlyphList.java?rev=1825046&r1=1825045&r2=1825046&view=diff
==============================================================================
--- 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/encoding/GlyphList.java
 (original)
+++ 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/encoding/GlyphList.java
 Thu Feb 22 11:05:50 2018
@@ -72,6 +72,7 @@ public final class GlyphList
         catch (SecurityException e)  // can occur on System.getProperty
         {
             // PDFBOX-1946 ignore and continue
+            LOG.debug("Error getting system property 'glyphlist_ext' - 
ignoring", e);
         }
     }
     


Reply via email to