Bug 50698 - [PATCH] Synchronize access to java.awt.color.ICC_Profile
Summary: [PATCH] Synchronize access to java.awt.color.ICC_Profile
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: general (show other bugs)
Version: trunk
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: fop-dev
Depends on:
Reported: 2011-02-01 06:44 UTC by Andreas L. Delmelle
Modified: 2012-04-01 06:18 UTC (History)
0 users

proposed patch addressing potential issue in FOP (6.20 KB, application/octet-stream)
2011-02-01 06:44 UTC, Andreas L. Delmelle

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas L. Delmelle 2011-02-01 06:44:30 UTC
Created attachment 26588 [details]
proposed patch addressing potential issue in FOP

In response to a recent post on fop-users@ (see: http://marc.info/?l=fop-user&m=129646673801270&w=2), the attached patch:

- adds two methods to fop.util.ColorProfileUtil that perform calls to ICC_Profile.getInstance() in a synchronized fashion (only the InputStream and int variants are used)
- replaces all direct calls to ICC_Profile.getInstance() in FOP's code with calls to one of those new methods

Note: The issue mentioned in the original post is *not* addressed by this patch, as that instance of the issue arises somewhere in XMLGraphics.

Probably a good step to take towards solving this in XG, is to migrate the ColorProfileUtil class there, and have FOP reference that one.
Comment 1 Jeremias Maerki 2011-02-01 07:19:08 UTC
As you suggested, I'd move ColorProfileUtil over to XGC and apply the changes for that class there. Batik suffers from the same problem apparently (SVGColorProfileElementBridge). Thanks for looking into it. You actually beat me to it. I wanted to do something similar.
Comment 2 Andreas L. Delmelle 2011-02-01 15:06:29 UTC
Alternate approach taken as proposed. Changes to FOP committed in r1066182 (http://svn.apache.org/viewvc?rev=1066182&view=rev)
Comment 3 Glenn Adams 2012-04-01 06:18:53 UTC
batch transition to closed; if someone wishes to restore one of these to resolved in order to perform a verification step, then feel free to do so