Lonzak created PDFBOX-4947:
------------------------------

             Summary: 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
             Fix For: 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to