[
https://issues.apache.org/jira/browse/PDFBOX-1973?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13930021#comment-13930021
]
John Hewson commented on PDFBOX-1973:
-------------------------------------
Here's another example, the method:
{code}
public void save( String fileName ) throws IOException, COSVisitorException
{
save( new FileOutputStream( fileName ) );
}
{code}
throws both IOException and COSVisitorException, however the
COSVisitorException thrown by save() is really just a wrapped IOException,
which means that by removing COSVisitorException and replacing it with the raw
exceptions, we could simply say:
{code}
public void save( String fileName ) throws IOException
{
save( new FileOutputStream( fileName ) );
}
{code}
> COSVisitorException should be removed
> -------------------------------------
>
> 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)