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 D2DFE11657 for ; Mon, 9 Jun 2014 00:23:38 +0000 (UTC) Received: (qmail 33968 invoked by uid 500); 9 Jun 2014 00:23:38 -0000 Delivered-To: apmail-pdfbox-commits-archive@pdfbox.apache.org Received: (qmail 33859 invoked by uid 500); 9 Jun 2014 00:23:38 -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 33700 invoked by uid 99); 9 Jun 2014 00:23:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Jun 2014 00:23:38 +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; Mon, 09 Jun 2014 00:23:39 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 320622388906; Mon, 9 Jun 2014 00:23:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1601284 - /pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/process/TrailerValidationProcess.java Date: Mon, 09 Jun 2014 00:23:15 -0000 To: commits@pdfbox.apache.org From: tilman@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20140609002315.320622388906@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: tilman Date: Mon Jun 9 00:23:14 2014 New Revision: 1601284 URL: http://svn.apache.org/r1601284 Log: PDFBOX-1600: exception is not thrown in no-args constructor Modified: pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/process/TrailerValidationProcess.java Modified: pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/process/TrailerValidationProcess.java URL: http://svn.apache.org/viewvc/pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/process/TrailerValidationProcess.java?rev=1601284&r1=1601283&r2=1601284&view=diff ============================================================================== --- pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/process/TrailerValidationProcess.java (original) +++ pdfbox/branches/1.8/preflight/src/main/java/org/apache/pdfbox/preflight/process/TrailerValidationProcess.java Mon Jun 9 00:23:14 2014 @@ -105,27 +105,14 @@ public class TrailerValidationProcess ex else { COSDictionary last = ctx.getXrefTableResolver().getLastTrailer(); - COSDocument cosDoc = null; - try + COSDocument cosDoc = new COSDocument(); + checkMainTrailer(ctx, first); + if (!compareIds(first, last, cosDoc)) { - cosDoc = new COSDocument(); - checkMainTrailer(ctx, first); - if (!compareIds(first, last, cosDoc)) - { - addValidationError(ctx, new ValidationError(PreflightConstants.ERROR_SYNTAX_TRAILER_ID_CONSISTENCY, - "ID is different in the first and the last trailer")); - } - - } - catch (IOException e) - { - addValidationError(ctx, new ValidationError(PreflightConstants.ERROR_SYNTAX_TRAILER, - "Unable to parse trailers of the linearized PDF")); - } - finally - { - COSUtils.closeDocumentQuietly(cosDoc); + addValidationError(ctx, new ValidationError(PreflightConstants.ERROR_SYNTAX_TRAILER_ID_CONSISTENCY, + "ID is different in the first and the last trailer")); } + COSUtils.closeDocumentQuietly(cosDoc); } }