You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2014/07/19 06:14:38 UTC
[jira] [Resolved] (PDFBOX-2225) ClassCastException in
PDFMergerUtility.appendDocument
[ https://issues.apache.org/jira/browse/PDFBOX-2225?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tilman Hausherr resolved PDFBOX-2225.
-------------------------------------
Resolution: Fixed
Fix Version/s: 2.0.0
1.8.7
Thanks, done in rev 1611844 for the trunk and in rev 1611845 for the 1.8 branch. If you're not building from source, you can usually get snapshot versions from https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/ within a few hours.
> ClassCastException in PDFMergerUtility.appendDocument
> -----------------------------------------------------
>
> Key: PDFBOX-2225
> URL: https://issues.apache.org/jira/browse/PDFBOX-2225
> Project: PDFBox
> Issue Type: Bug
> Components: Utilities
> Affects Versions: 1.8.6, 1.8.7, 2.0.0
> Environment: Windows 7 64-bit, JDK8, pdfbox 1.8.1 or 1.8.6
> Reporter: Brandon Lyon
> Priority: Minor
> Fix For: 1.8.7, 2.0.0
>
>
> Edit: Problem confirmed to exist in 1.8.1 and 1.8.6
> The following exception will occur if any type of Exception other than IOException is thrown within a particular try-catch in PDFMergerUtility.appendDocument:
> java.lang.ClassCastException: java.lang.IndexOutOfBoundsException cannot be cast to java.io.IOException
> For the version I am using (1.8.1), the problem occurs on line 294
> The problem is that the author mistakenly assumed that the only exception which could be caught was IOException. I recommend that the cast be removed, and that either the additional checked exceptions be thrown by appendDocument or wrapped with an unchecked exception
> Also, anyone seeing this may want to investigate why an IndexOutOfBoundsException is occurring here, though this is obviously a separate issue
--
This message was sent by Atlassian JIRA
(v6.2#6252)