[ 
https://issues.apache.org/jira/browse/PDFBOX-1973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13931487#comment-13931487
 ] 

John Hewson commented on PDFBOX-1973:
-------------------------------------

Given that OutlineNotLocalException is now the only remaining non-deprecated 
checked exception in the org.apache.pdfbox.exceptions it's worth reviewing its 
functionality. OutlineNotLocalException is thrown only once, in 
PDOutlineItem#findDestinationPage to indicate that the outline has an action 
but that it does not have a page destination (e.g. a URI).

However, when an outline does not have an action, null is returned to indicate 
that there is no destination page. This is not so different from the case where 
the outline has an action but its destination is not a page, triggering a 
OutlineNotLocalException. Instead of throwing OutlineNotLocalException we 
should just return null as happens anyway for outlines without actions. This 
means that OutlineNotLocalException can be removed entirely.

Revision 1576610 makes this change.

> Exception Refactoring (Don't wrap Exceptions with COSVisitorException)
> ----------------------------------------------------------------------
>
>                 Key: PDFBOX-1973
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-1973
>             Project: PDFBox
>          Issue Type: Improvement
>            Reporter: John Hewson
>            Assignee: John Hewson
>            Priority: Minor
>
> COSVisitorException is redundant, it is a simple wrapper for 
> SignatureException, CryptographyException and NoSuchAlgorithmException and 
> should be replaced by those exceptions directly.
> For example, we can replace:
> public void write(PDDocument doc) throws COSVisitorException
> With:
> public void write(PDDocument doc) throws IOException, CryptographyException
> and so on...



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to