pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1602137 - in /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox: encoding/Encoding.java pdfviewer/font/TTFGlyph2D.java
Date Thu, 12 Jun 2014 12:14:07 GMT
Author: tilman
Date: Thu Jun 12 12:14:07 2014
New Revision: 1602137

URL: http://svn.apache.org/r1602137
Log:
PDFBOX-2131: Avoid constructing debug messages if debug log is off, as suggested by Petr Slaby

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/encoding/Encoding.java
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/font/TTFGlyph2D.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/encoding/Encoding.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/encoding/Encoding.java?rev=1602137&r1=1602136&r2=1602137&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/encoding/Encoding.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/encoding/Encoding.java Thu Jun 12
12:14:07 2014
@@ -261,9 +261,12 @@ public abstract class Encoding implement
     {
         if (NAME_TO_CHARACTER.containsKey(name))
         {
-            LOG.debug("No character for name " + name);
             return NAME_TO_CHARACTER.get(name);
         }
+        if (LOG.isDebugEnabled())
+        {
+            LOG.debug("No character for name " + name);
+        }
         return null;
     }
 

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/font/TTFGlyph2D.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/font/TTFGlyph2D.java?rev=1602137&r1=1602136&r2=1602137&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/font/TTFGlyph2D.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/font/TTFGlyph2D.java Thu
Jun 12 12:14:07 2014
@@ -224,7 +224,10 @@ public class TTFGlyph2D implements Glyph
             }
             else
             {
-                LOG.debug(name + ": Glyph not found:" + glyphId);
+                if (LOG.isDebugEnabled())
+                {
+                    LOG.debug(name + ": Glyph not found:" + glyphId);
+                }
             }
         }
         return glyphPath != null ? (GeneralPath) glyphPath.clone() : null;
@@ -511,25 +514,37 @@ public class TTFGlyph2D implements Glyph
     private void closePath(GeneralPath path)
     {
         path.closePath();
-        LOG.debug("closePath");
+        if (LOG.isDebugEnabled())
+        {
+            LOG.debug("closePath");
+        }
     }
 
     private void moveTo(GeneralPath path, Point point)
     {
         path.moveTo(point.x, point.y);
-        LOG.debug("moveTo: " + String.format("%d,%d", point.x, point.y));
+        if (LOG.isDebugEnabled())
+        {
+            LOG.debug("moveTo: " + String.format("%d,%d", point.x, point.y));
+        }
     }
 
     private void lineTo(GeneralPath path, Point point)
     {
         path.lineTo(point.x, point.y);
-        LOG.debug("lineTo: " + String.format("%d,%d", point.x, point.y));
+        if (LOG.isDebugEnabled())
+        {
+            LOG.debug("lineTo: " + String.format("%d,%d", point.x, point.y));
+        }
     }
 
     private void quadTo(GeneralPath path, Point ctrlPoint, Point point)
     {
         path.quadTo(ctrlPoint.x, ctrlPoint.y, point.x, point.y);
-        LOG.debug("quadTo: " + String.format("%d,%d %d,%d", ctrlPoint.x, ctrlPoint.y, point.x,
point.y));
+        if (LOG.isDebugEnabled())
+        {
+            LOG.debug("quadTo: " + String.format("%d,%d %d,%d", ctrlPoint.x, ctrlPoint.y,
point.x, point.y));
+        }
     }
 
     private int midValue(int a, int b)



Mime
View raw message