[
https://issues.apache.org/jira/browse/PDFBOX-2184?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14516792#comment-14516792
]
Tilman Hausherr edited comment on PDFBOX-2184 at 4/28/15 6:19 PM:
------------------------------------------------------------------
{code}
/** This is the single instance of this class. */
public static final PDDeviceRGB INSTANCE = new PDDeviceRGB();
private final ColorSpace colorSpaceRGB =
ColorSpace.getInstance(ColorSpace.CS_sRGB);
private final PDColor initialColor = new PDColor(new float[] { 0, 0, 0 },
this);
private PDDeviceRGB()
{
// there is a JVM bug which results in a CMMException which appears to
be a race
// condition caused by lazy initialization of the color transform, so
we perform
// an initial color conversion while we're still in a static context,
see PDFBOX-2184
colorSpaceRGB.toRGB(new float[]{0, 0, 0});
}
{code}
I wonder why colorSpaceRGB isn't static?
was (Author: tilman):
{code}
/** This is the single instance of this class. */
public static final PDDeviceRGB INSTANCE = new PDDeviceRGB();
private final ColorSpace colorSpaceRGB =
ColorSpace.getInstance(ColorSpace.CS_sRGB);
private final PDColor initialColor = new PDColor(new float[] { 0, 0, 0 },
this);
private PDDeviceRGB()
{
// there is a JVM bug which results in a CMMException which appears to
be a race
// condition caused by lazy initialization of the color transform, so
we perform
// an initial color conversion while we're still in a static context,
see PDFBOX-2184
colorSpaceRGB.toRGB(new float[]{0, 0, 0});
}
{code}
I wonder whether colorSpaceRGB is initialized after the initialization of
INSTANCE (which needs colorSpaceRGB). And I wonder why colorSpaceRGB isn't
static?
> Jenkins: CMMException: Invalid profile data
> -------------------------------------------
>
> Key: PDFBOX-2184
> URL: https://issues.apache.org/jira/browse/PDFBOX-2184
> Project: PDFBox
> Issue Type: Bug
> Affects Versions: 2.0.0
> Reporter: John Hewson
> Assignee: John Hewson
> Fix For: 2.0.0
>
>
> Jenkins builds are intermittently failing with the error:
> {code}
> java.awt.color.CMMException: Invalid profile data
> at sun.awt.color.CMM.checkStatus(CMM.java:131)
> at sun.awt.color.ICC_Transform.<init>(ICC_Transform.java:88)
> at java.awt.color.ICC_ColorSpace.toRGB(ICC_ColorSpace.java:144)
> at
> org.apache.pdfbox.pdmodel.graphics.color.PDDeviceRGB.toRGB(PDDeviceRGB.java:79)
> at
> org.apache.pdfbox.pdmodel.graphics.color.PDColorSpace.toPaint(PDColorSpace.java:255)
> at
> org.apache.pdfbox.rendering.PageDrawer.getNonStrokingPaint(PageDrawer.java:666)
> at org.apache.pdfbox.rendering.PageDrawer.fillPath(PageDrawer.java:739)
> at
> org.apache.pdfbox.util.operator.pagedrawer.FillNonZeroRule.process(FillNonZeroRule.java:37)
> at
> org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:488)
> at
> org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:254)
> at
> org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:221)
> at
> org.apache.pdfbox.util.operator.pagedrawer.Invoke.process(Invoke.java:130)
> at
> org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:488)
> at
> org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:254)
> at
> org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:221)
> at
> org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:197)
> at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:183)
> at
> org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:228)
> at
> org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:160)
> at
> org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:83)
> at
> org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:70)
> at org.apache.pdfbox.util.TestRendering.render(TestRendering.java:78)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]