Return-Path: X-Original-To: apmail-pdfbox-commits-archive@www.apache.org Delivered-To: apmail-pdfbox-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 120E2115FA for ; Thu, 19 Jun 2014 19:35:31 +0000 (UTC) Received: (qmail 69852 invoked by uid 500); 19 Jun 2014 19:35:30 -0000 Delivered-To: apmail-pdfbox-commits-archive@pdfbox.apache.org Received: (qmail 69827 invoked by uid 500); 19 Jun 2014 19:35:30 -0000 Mailing-List: contact commits-help@pdfbox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@pdfbox.apache.org Delivered-To: mailing list commits@pdfbox.apache.org Received: (qmail 69818 invoked by uid 99); 19 Jun 2014 19:35:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jun 2014 19:35:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jun 2014 19:35:29 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 1347123889FA; Thu, 19 Jun 2014 19:35:09 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@pdfbox.apache.org From: jahewson@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140619193509.1347123889FA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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(); } /**