SUGGESTED FIX
The following is suggested fix from Hitachi.
Mofification has been done for 1.4.2_03 source code.
---- Suggested fix from Hitachi --->
diff -r -c -w /export1/home/tbaba/jdk/jdk1.4.2_03/solwin/j2se/src/share/classes/java/awt/color/ColorSpace.java ./rev/j2se/src/share/classes/java/awt/color/ColorSpace.java
*** /export1/home/tbaba/jdk/jdk1.4.2_03/solwin/j2se/src/share/classes/java/awt/color/ColorSpace.java Tue Nov 18 11:30:40 2003
--- ./rev/j2se/src/share/classes/java/awt/color/ColorSpace.java Mon May 23 20:32:22 2005
***************
*** 81,86 ****
--- 81,88 ----
static final long serialVersionUID = -409452704308689724L;
+ private static Object lockObj = new Object(); /**@ S200400 @**/
+ /**@ S200400 @**/
private int type;
private int numComponents;
***************
*** 274,327 ****
switch (colorspace) {
case CS_sRGB:
! if (sRGBspace == null) {
! ICC_Profile theProfile = ICC_Profile.getInstance (CS_sRGB);
! sRGBspace = new ICC_ColorSpace (theProfile);
! }
! theColorSpace = sRGBspace;
break;
case CS_CIEXYZ:
! if (XYZspace == null) {
! ICC_Profile theProfile = ICC_Profile.getInstance (CS_CIEXYZ);
! XYZspace = new ICC_ColorSpace (theProfile);
! }
! theColorSpace = XYZspace;
break;
case CS_PYCC:
! if (PYCCspace == null) {
! ICC_Profile theProfile = ICC_Profile.getInstance (CS_PYCC);
! PYCCspace = new ICC_ColorSpace (theProfile);
! }
! theColorSpace = PYCCspace;
break;
case CS_GRAY:
! if (GRAYspace == null) {
! ICC_Profile theProfile = ICC_Profile.getInstance (CS_GRAY);
! GRAYspace = new ICC_ColorSpace (theProfile);
! CMM.GRAYspace = GRAYspace; // to allow access from
! // java.awt.ColorModel
! }
! theColorSpace = GRAYspace;
break;
case CS_LINEAR_RGB:
! if (LINEAR_RGBspace == null) {
! ICC_Profile theProfile = ICC_Profile.getInstance(CS_LINEAR_RGB);
! LINEAR_RGBspace = new ICC_ColorSpace (theProfile);
! CMM.LINEAR_RGBspace = LINEAR_RGBspace; // to allow access from
! // java.awt.ColorModel
! }
! theColorSpace = LINEAR_RGBspace;
break;
--- 276,341 ----
switch (colorspace) {
case CS_sRGB:
! synchronized(lockObj) { /**@ S200400 @**/
! if (sRGBspace == null) { /**@ S200400 @**/
! ICC_Profile theProfile = ICC_Profile.getInstance (CS_sRGB); /**@ S200400 @**/
! sRGBspace = new ICC_ColorSpace (theProfile); /**@ S200400 @**/
! } /**@ S200400 @**/
! theColorSpace = sRGBspace; /**@ S200400 @**/
! } /**@ S200400 @**/
break;
case CS_CIEXYZ:
! synchronized(lockObj) { /**@ S200400 @**/
! if (XYZspace == null) { /**@ S200400 @**/
! ICC_Profile theProfile /**@ S200400 @**/
! = ICC_Profile.getInstance (CS_CIEXYZ); /**@ S200400 @**/
! XYZspace = new ICC_ColorSpace (theProfile); /**@ S200400 @**/
! } /**@ S200400 @**/
! theColorSpace = XYZspace; /**@ S200400 @**/
! } /**@ S200400 @**/
break;
case CS_PYCC:
! synchronized(lockObj) { /**@ S200400 @**/
! if (PYCCspace == null) { /**@ S200400 @**/
! ICC_Profile theProfile = ICC_Profile.getInstance (CS_PYCC); /**@ S200400 @**/
! PYCCspace = new ICC_ColorSpace (theProfile); /**@ S200400 @**/
! } /**@ S200400 @**/
! theColorSpace = PYCCspace; /**@ S200400 @**/
! } /**@ S200400 @**/
break;
case CS_GRAY:
! synchronized(lockObj) { /**@ S200400 @**/
! if (GRAYspace == null) { /**@ S200400 @**/
! ICC_Profile theProfile = ICC_Profile.getInstance (CS_GRAY); /**@ S200400 @**/
! GRAYspace = new ICC_ColorSpace (theProfile); /**@ S200400 @**/
! CMM.GRAYspace = GRAYspace; // to allow access from /**@ S200400 @**/
! // java.awt.ColorModel /**@ S200400 @**/
! } /**@ S200400 @**/
! theColorSpace = GRAYspace; /**@ S200400 @**/
! } /**@ S200400 @**/
break;
case CS_LINEAR_RGB:
! synchronized(lockObj) { /**@ S200400 @**/
! if (LINEAR_RGBspace == null) { /**@ S200400 @**/
! ICC_Profile theProfile /**@ S200400 @**/
! = ICC_Profile.getInstance(CS_LINEAR_RGB); /**@ S200400 @**/
! LINEAR_RGBspace = new ICC_ColorSpace (theProfile); /**@ S200400 @**/
! CMM.LINEAR_RGBspace = LINEAR_RGBspace; // to allow access from /**@ S200400 @**/
! // java.awt.ColorModel /**@ S200400 @**/
! } /**@ S200400 @**/
! theColorSpace = LINEAR_RGBspace; /**@ S200400 @**/
! } /**@ S200400 @**/
break;
diff -r -c -w /export1/home/tbaba/jdk/jdk1.4.2_03/solwin/j2se/src/share/classes/java/awt/color/ICC_Profile.java ./rev/j2se/src/share/classes/java/awt/color/ICC_Profile.java
*** /export1/home/tbaba/jdk/jdk1.4.2_03/solwin/j2se/src/share/classes/java/awt/color/ICC_Profile.java Tue Nov 18 11:30:40 2003
--- ./rev/j2se/src/share/classes/java/awt/color/ICC_Profile.java Mon May 23 20:32:22 2005
***************
*** 70,75 ****
--- 70,79 ----
public class ICC_Profile implements Serializable {
+ static final long serialVersionUID = -3938515861990936766L; /**@ S200400 @**/
+ /**@ S200400 @**/
+ private static Object lockObj = new Object(); /**@ S200400 @**/
+ /**@ S200400 @**/
transient long ID;
private transient ProfileDeferralInfo deferralInfo;
***************
*** 755,799 ****
try {
switch (cspace) {
case ColorSpace.CS_sRGB:
! if (sRGBprofile == null) {
! sRGBprofile = getDeferredInstance(
! new ProfileDeferralInfo("sRGB.pf", ColorSpace.TYPE_RGB,
! 3, CLASS_DISPLAY));
! }
! thisProfile = sRGBprofile;
break;
case ColorSpace.CS_CIEXYZ:
! if (XYZprofile == null) {
! XYZprofile = getInstance ("CIEXYZ.pf");
! }
! thisProfile = XYZprofile;
break;
case ColorSpace.CS_PYCC:
! if (PYCCprofile == null) {
! PYCCprofile = getInstance ("PYCC.pf");
! }
! thisProfile = PYCCprofile;
break;
case ColorSpace.CS_GRAY:
! if (GRAYprofile == null) {
! GRAYprofile = getInstance ("GRAY.pf");
! }
! thisProfile = GRAYprofile;
break;
case ColorSpace.CS_LINEAR_RGB:
! if (LINEAR_RGBprofile == null) {
! LINEAR_RGBprofile = getInstance ("LINEAR_RGB.pf");
! }
! thisProfile = LINEAR_RGBprofile;
break;
default:
--- 759,814 ----
try {
switch (cspace) {
case ColorSpace.CS_sRGB:
! synchronized(lockObj) { /**@ S200400 @**/
! if (sRGBprofile == null) { /**@ S200400 @**/
! sRGBprofile = getDeferredInstance( /**@ S200400 @**/
! new ProfileDeferralInfo("sRGB.pf", /**@ S200400 @**/
! ColorSpace.TYPE_RGB, /**@ S200400 @**/
! 3, CLASS_DISPLAY)); /**@ S200400 @**/
! } /**@ S200400 @**/
! thisProfile = sRGBprofile; /**@ S200400 @**/
+ } /**@ S200400 @**/
break;
case ColorSpace.CS_CIEXYZ:
! synchronized(lockObj) { /**@ S200400 @**/
! if (XYZprofile == null) { /**@ S200400 @**/
! XYZprofile = getInstance ("CIEXYZ.pf"); /**@ S200400 @**/
! } /**@ S200400 @**/
! thisProfile = XYZprofile; /**@ S200400 @**/
+ } /**@ S200400 @**/
break;
case ColorSpace.CS_PYCC:
! synchronized(lockObj) { /**@ S200400 @**/
! if (PYCCprofile == null) { /**@ S200400 @**/
! PYCCprofile = getInstance ("PYCC.pf"); /**@ S200400 @**/
! } /**@ S200400 @**/
! thisProfile = PYCCprofile; /**@ S200400 @**/
+ } /**@ S200400 @**/
break;
case ColorSpace.CS_GRAY:
! synchronized(lockObj) { /**@ S200400 @**/
! if (GRAYprofile == null) { /**@ S200400 @**/
! GRAYprofile = getInstance ("GRAY.pf"); /**@ S200400 @**/
! } /**@ S200400 @**/
! thisProfile = GRAYprofile; /**@ S200400 @**/
+ } /**@ S200400 @**/
break;
case ColorSpace.CS_LINEAR_RGB:
! synchronized(lockObj) { /**@ S200400 @**/
! if (LINEAR_RGBprofile == null) { /**@ S200400 @**/
! LINEAR_RGBprofile = getInstance ("LINEAR_RGB.pf"); /**@ S200400 @**/
! } /**@ S200400 @**/
! thisProfile = LINEAR_RGBprofile; /**@ S200400 @**/
+ } /**@ S200400 @**/
break;
<------------------------------------
*** (#1 of 1): [ UNSAVED ] ###@###.###
|