You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Andreas Lehmkühler (JIRA)" <ji...@apache.org> on 2014/10/15 12:40:34 UTC

[jira] [Updated] (PDFBOX-877) processOperator breaks contract - never throws IOException

     [ https://issues.apache.org/jira/browse/PDFBOX-877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andreas Lehmkühler updated PDFBOX-877:
--------------------------------------
    Affects Version/s:     (was: 1.1.0)
                       2.0.0

> processOperator breaks contract - never throws IOException
> ----------------------------------------------------------
>
>                 Key: PDFBOX-877
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-877
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 2.0.0
>            Reporter: Jimmy Juncker
>             Fix For: 2.0.0
>
>
> PDFStreamEngine.processOperator documents to throw IOException. However, all Exceptions are swallowed (in a catch Exception clause) which makes it impossible for us to handle:
>     /**
>      * This is used to handle an operation.
>      *
>      * @param operator The operation to perform.
>      * @param arguments The list of arguments.
>      *
>      * @throws IOException If there is an error processing the operation.
>      */
>     protected void processOperator( PDFOperator operator, List arguments ) throws IOException
>     {
>         try
>         {
>             String operation = operator.getOperation();
>             OperatorProcessor processor = (OperatorProcessor)operators.get( operation );
>             if( processor != null )
>             {
>                 processor.setContext(this);
>                 processor.process( operator, arguments );
>             }
>             else
>             {
>                 if (!unsupportedOperators.contains(operation)) 
>                 {
>                     log.info("unsupported/disabled operation: " + operation);
>                     unsupportedOperators.add(operation);
>                 }
>             }
>         }
>         catch (Exception e)
>         {
>             log.warn(e, e);
>         }
>     }



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)