pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1654347 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontFactory.java
Date Fri, 23 Jan 2015 19:44:35 GMT
Author: tilman
Date: Fri Jan 23 19:44:35 2015
New Revision: 1654347

URL: http://svn.apache.org/r1654347
Log:
PDFBOX-2576: merge if statements; no need to check for null before an instanceof 

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

Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontFactory.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontFactory.java?rev=1654347&r1=1654346&r2=1654347&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontFactory.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontFactory.java Fri
Jan 23 19:44:35 2015
@@ -55,24 +55,18 @@ public class PDFontFactory
         if (COSName.TYPE1.equals(subType))
         {
             COSBase fd = dictionary.getDictionaryObject(COSName.FONT_DESC);
-            if (fd != null && fd instanceof COSDictionary)
+            if (fd instanceof COSDictionary && ((COSDictionary) fd).containsKey(COSName.FONT_FILE3))
             {
-                if (((COSDictionary)fd).containsKey(COSName.FONT_FILE3))
-                {
-                    return new PDType1CFont(dictionary);
-                }
+                return new PDType1CFont(dictionary);
             }
             return new PDType1Font(dictionary);
         }
         else if (COSName.MM_TYPE1.equals(subType))
         {
             COSBase fd = dictionary.getDictionaryObject(COSName.FONT_DESC);
-            if (fd != null && fd instanceof COSDictionary)
+            if (fd instanceof COSDictionary && ((COSDictionary) fd).containsKey(COSName.FONT_FILE3))
             {
-                if (((COSDictionary)fd).containsKey(COSName.FONT_FILE3))
-                {
-                    return new PDType1CFont(dictionary);
-                }
+                return new PDType1CFont(dictionary);
             }
             return new PDMMType1Font(dictionary);
         }



Mime
View raw message