pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jahew...@apache.org
Subject svn commit: r1604018 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java
Date Thu, 19 Jun 2014 19:35:08 GMT
Author: jahewson
Date: Thu Jun 19 19:35:07 2014
New Revision: 1604018

URL: http://svn.apache.org/r1604018
Log:
PDFBOX-2149: Allow NPE which hopefully never happens

Modified:
    pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java?rev=1604018&r1=1604017&r2=1604018&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java Thu Jun 19
19:35:07 2014
@@ -141,7 +141,7 @@ public abstract class PDFont implements 
     /**
      * This will clear AFM resources that are stored statically. This is usually not a problem
      * unless you want to reclaim resources for a long running process.
-     * 
+     *
      * SPECIAL NOTE: The font calculations are currently in COSObject, which is where they
will
      * reside until PDFont is mature enough to take them over. PDFont is the appropriate
place for
      * them and not in COSObject but we need font calculations for text extraction. THIS
METHOD WILL
@@ -196,6 +196,7 @@ public abstract class PDFont implements 
                 {
                     fontDescriptor = new PDFontDescriptorAFM(afm);
                 }
+                // it shouldn't be possible to reach this point...
             }
         }
         return fontDescriptor;
@@ -691,12 +692,7 @@ public abstract class PDFont implements 
      */
     public boolean isSymbolicFont()
     {
-        // not all fonts have a font descriptor
-        if (getFontDescriptor() != null)
-        {
-            return getFontDescriptor().isSymbolic();
-        }
-        return false;
+        return getFontDescriptor().isSymbolic();
     }
 
     /**



Mime
View raw message