[
https://issues.apache.org/jira/browse/PDFBOX-2728?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14389018#comment-14389018
]
Tilman Hausherr commented on PDFBOX-2728:
-----------------------------------------
No I have not profiled that code and I won't, because I'm unable to get
reproductible time results on my computer. I doubt that the JVM would analyse
this across classes to be absolutely sure that it isn't modified at a later
time, so that the allocation can be skipped (and how would it know that the
point is already float?). Point2D doesn't mean double precision, it just mean
that the internal precision isn't known. The old code forced a float type,
which isn't needed for a null check. I also consider it more flexible to return
the base class instead of the derived class and only convert when really
needed. And it makes shorter code and eliminates the NPE thanks to the redesign.
Having said that, if you want Point2D.Float with the more complex code, I'll
just do it.
> java.awt.geom.IllegalPathStateException: missing initial moveto in path
> definition
> ----------------------------------------------------------------------------------
>
> Key: PDFBOX-2728
> URL: https://issues.apache.org/jira/browse/PDFBOX-2728
> Project: PDFBox
> Issue Type: Bug
> Components: Rendering
> Affects Versions: 2.0.0
> Reporter: Massimo Franzoni
> Assignee: Tilman Hausherr
> Fix For: 2.0.0
>
>
> I get this exception :
> {code}
> java.awt.geom.IllegalPathStateException: missing initial moveto in path
> definition
> at java.awt.geom.Path2D$Float.needRoom(Path2D.java:280)
> at java.awt.geom.Path2D.closePath(Path2D.java:1769)
> at org.apache.pdfbox.rendering.PageDrawer.closePath(PageDrawer.java:693)
> at
> org.apache.pdfbox.contentstream.operator.graphics.ClosePath.process(ClosePath.java:35)
> at
> org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:788)
> at
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:454)
> at
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:425)
> at
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:398)
> at
> org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:164)
> at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:164)
> at
> org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:213)
> {code}
> similar to PDFBOX-2189.
> I can't include the PDF file for privacy reason but I think a similar
> solution applied for the other bug could fix this problem too
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]