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

Maruan Sahyoun commented on PDFBOX-3012:
----------------------------------------

thanks for the report. I've resolved it somewhat differently by adding a 
{{getWidgets()}} method to {{PDNonTerminalField}} and removed the cast in 
{{flatten()}}. Could you retest and let us know if the issue has been resolved 
by the changes made?

> 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
>            Assignee: Maruan Sahyoun
>              Labels: easyfix
>             Fix For: 2.0.0
>
>         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