JDK-6630475 : Remove dependency between ColorModel/ColorSpace and cmm.dll
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6u10
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2007-11-15
  • Updated: 2010-04-04
  • Resolved: 2007-12-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
6u10 b09Fixed 7Resolved
While researching bundle dependencies for jkernel i found out that cmm.dll may be loaded 
due to access to its auxilary public static fields.

Here is related stack trace:

       at sun.awt.color.CMM.<clinit>(CMM.java:109)
       at java.awt.image.ColorModel.isLinearRGBspace(ColorModel.java:1685)
       at java.awt.image.DirectColorModel.<init>(DirectColorModel.java:221)
       at java.awt.image.BufferedImage.<init>(BufferedImage.java:328)
       at sun.java2d.loops.GraphicsPrimitive.convertFrom(GraphicsPrimitive.java:537)
       at sun.java2d.d3d.D3DGeneralBlit.Blit(D3DBlitLoops.java:712)
       at sun.java2d.pipe.DrawImage.blitSurfaceData(DrawImage.java:927)
       at sun.java2d.pipe.DrawImage.renderImageCopy(DrawImage.java:550)
       at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:73)
       at sun.java2d.pipe.DrawImage.copyImage(DrawImage.java:998)
       at sun.java2d.pipe.ValidatePipe.copyImage(ValidatePipe.java:178)
       at sun.java2d.SunGraphics2D.copyImage(SunGraphics2D.java:2918)
       at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3056)
       at sun.java2d.SunGraphics2D.drawImage(SunGraphics2D.java:3010)
       at javax.swing.plaf.metal.MetalBumps.paintIcon(MetalBumps.java:123) 

ColorModel.isLinearRGBspace() has following code:

   static boolean isLinearRGBspace(ColorSpace cs) {
       // Note: CMM.LINEAR_RGBspace will be null if the linear
       // RGB space has not been created yet.
       return (cs == CMM.LINEAR_RGBspace);

If none of CMM methods are used then cmm.dll should not be loaded.

SUGGESTED FIX http://sa.sfbay.sun.com/projects/java2d_data/6u10/6630475.1

EVALUATION CMM class has 2 fields that are used as placeholders to share information between ColorModel and colorSpace classess. They are used in very few places of the code. Access to these fields requires static initialization to be performed that loads dll. Porposed solution is to created nested public static class and move these variables there or move them to separate class.