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

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

I've taken a look at the exceptions which replaced COSVisitorException and 
determined that NoSuchAlgorithmException does not need to be thrown as it is 
used to indicate that the cryptography provider is missing the required plugin, 
which should happen on a properly configured system. Because this is not in 
practice a user-recoverable exception, using RuntimeException seems to be the 
right approach. There might be a case in PublicKeySecurityHandler where this 
assumption doesn't hold, if that turns out to be the case then we can make a 
specific fix for that class.

Revision 1576489 makes these changes.

> 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