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

ASF subversion and git services commented on PDFBOX-4947:
---------------------------------------------------------

Commit 1881368 from Tilman Hausherr in branch 'pdfbox/branches/issue45'
[ https://svn.apache.org/r1881368 ]

PDFBOX-4947: create a real List instead of an AbstractList (created by 
Arrays.asList) so that addSubstitute() works, as suggested by Lonzak

> UnsupportedOperationException when using FontMapperImpl.addSubstitute()
> -----------------------------------------------------------------------
>
>                 Key: PDFBOX-4947
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4947
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 2.0.21
>            Reporter: Lonzak
>            Priority: Major
>             Fix For: 3.0.0 PDFBox, 2.0.22
>
>
> I tried to add an additional substitue mapping however it throws an exception:
> {code:java}
> java.lang.UnsupportedOperationException
>  at java.util.AbstractList.add(AbstractList.java:148)
>  at java.util.AbstractList.add(AbstractList.java:108)
>  at 
> org.apache.pdfbox.pdmodel.font.FontMapperImpl.addSubstitute(FontMapperImpl.java:210){code}
> => Thus the addSubstitute() method is useless
> The reason is that for instantiating the mapping only a skeleton list from 
> "Arrays.asList()" is used. This list doesn't support many methods of List 
> interface and throws the exception.
> +*Solution:*+
> Replace the " Arrays.asList()" with the real list like new ArrayList() or the 
> like.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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

Reply via email to