You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2019/05/10 17:51:00 UTC

[jira] [Commented] (PDFBOX-4543) PDLineDashPattern fails as float[] is converted to List instead of List

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

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

Commit 1859095 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1859095 ]

PDFBOX-4543: correctly convert array to COSArray (Arrays.asList(array) doesn't convert that array to a collection), as suggested by Paul Austin; add toString(); add "previously failing" test

> PDLineDashPattern fails as float[] is converted to List<float[]> instead of List<Float>
> ---------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-4543
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4543
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 2.0.15
>            Reporter: Paul Austin
>            Assignee: Tilman Hausherr
>            Priority: Major
>             Fix For: 2.0.16, 3.0.0 PDFBox
>
>
>  The following code fails in PDLineDashPattern as Arrays.asList doesn't work as expected with primitive arrays.
> {code:java}
> public COSBase getCOSObject()
> {
>   COSArray cos = new COSArray();
>   cos.add(COSArrayList.converterToCOSArray(Arrays.asList(array)));
>   cos.add(COSInteger.get(phase));
>   return cos;
> }{code}
> The array should be converted using:
> {code:java}
> COSArray patternArray = new COSArray();
> patternArray.setFloatArray(array);
> cos.add(patternArray);{code}
>  
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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