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

Jason Mackin updated PDFBOX-3012:
---------------------------------
    Description: 
In the PDAcroForm class, in the flatten() method,  there is a for loop that 
tries casting field to a PDTerminalField.  But, the field is sometimes a 
PDNonTerminalField and the casting error is thrown.

To fix this I just add one if statement right before the for loop that checks 
to see if field is an instance of PDTerminalField and place the for loop inside 
the if statement:

    if(field instanceof PDTerminalField){

  was:
In the PDAcroForm class, in the flatten() method,  there is a for loop that 
tries casting field to a PDTerminalField.  the field is sometimes a 
PDNonTerminalField and the casting error is thrown.

To fix this I just add one if statement right before the for loop that checks 
to see if field is an instance of PDTerminalField and place the for loop inside 
the if statement:

    if(field instanceof PDTerminalField){


> PDAcroForm flatten() throws ClassCastException
> ----------------------------------------------
>
>                 Key: PDFBOX-3012
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3012
>             Project: PDFBox
>          Issue Type: Bug
>          Components: AcroForm
>    Affects Versions: 2.0.0
>            Reporter: Jason Mackin
>              Labels: easyfix
>         Attachments: az101-1.15.0.pdf
>
>
> In the PDAcroForm class, in the flatten() method,  there is a for loop that 
> tries casting field to a PDTerminalField.  But, the field is sometimes a 
> PDNonTerminalField and the casting error is thrown.
> To fix this I just add one if statement right before the for loop that checks 
> to see if field is an instance of PDTerminalField and place the for loop 
> inside the if statement:
>     if(field instanceof PDTerminalField){



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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to