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);
}
}