JDK-8039271 : CMM profile files (cmm/*) should not be in ${java.home}/lib
  • Type: Sub-task
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-04-04
  • Updated: 2016-01-06
  • Resolved: 2014-08-22
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.
JDK 9
9 b30Fixed
Description
This bug asks that ${java.home}/lib/cmm be examined to understand why these profile files are in ${java.home}/lib.

The motive for this bug is the modular JDK where we need the flexibility to put anything that is module-private into a module-private location. In this case it would appear that cmm/* are not a supported interface and so should move to a location that is private to the "desktop" module. Moving these files to be resources rather than directly accessing ${java.home}/lib/cmm is a possible approach to consider.
Comments
I don't see anything in the cited javadoc that suggests that ${java.home}/lib/cmm is a supported interface but doing a CCC for the change shouldn't be an issue (esp. if there is any concern that there are applications that are somehow relying on this). The main thing from this exercise is that we have a clear list at the end of the user-editable configuration files and that there is a plan to migrate/move any residual files.
01-07-2014

That is not quite how I read it. There should have been no need to document how standard profiles are located unless the intent is that the same location is available for customisers and/or those who want to load a private copy of a standard profile. So the existence of the documentation implies that lib/cmm is a supported interface. If we wish to change that we would need to go through the CCC process
01-07-2014

If I read it correctly, you can add ICC profiles and specify the directory containing them in java.iccprofile.path property or in the classpath. ${java.home}/lib/cmm is only for the standard profiles. If the user chooses to drop the new ICC profiles under lib/cmm directory, they shouldn't expect the profiles to be found automatically. On the other hand, it means that if we moved those .py files as resources, the statement/spec "finally, in a directory used to store profiles always available, such as the profile for sRGB." will need to be revised. Since lib/cmm is not a supported interface, anyone loading a private copy of the standard profiles will be impacted and should call the standard API to obtain the standard profile.
01-07-2014

Note that getResourceAsStream() implies that the files are never opened as files directly from disk. If native code were opening the files this would not work. The ICC profile processing is mostly performed by native code. Although currently we always pass it in-memory data so it looks as though it ight be possible from that perspective. However file opening is part of the this public Java API :- http://docs.oracle.com/javase/8/docs/api/java/awt/color/ICC_Profile.html#getInstance-java.lang.String- ---- Constructs an ICC_Profile corresponding to the data in a file. fileName may be an absolute or a relative file specification. Relative file names are looked for in several places: first, relative to any directories specified by the java.iccprofile.path property; second, relative to any directories specified by the java.class.path property; finally, in a directory used to store profiles always available, such as the profile for sRGB. Built-in profiles use .pf as the file name extension for profiles, e.g. sRGB.pf. This method throws an IOException if the specified file cannot be opened or if an I/O error occurs while reading the file. It throws an IllegalArgumentException if the file does not contain valid ICC Profile data. ---- This does not explicitly mention lib/cmm but that is exactly what is meant by "finally, in a directory used to store profiles always available, such as the profile for sRGB." So we implicitly document lib/cmm as where you can add ICC profiles and also imply that you can directly yourself load a private copy of any of the JRE supplied profiles.
30-06-2014

From the JDK README Redistributable JDKTM Files The limited set of files and directories from the JDK listed below may be included in vendor redistributions of the JavaTM Runtime Environment (JRETM). They cannot be redistributed separately, and must accompany a JRE distribution. All paths are relative to the top-level directory of the JDK. The corresponding man pages should be included for any included executables (with paths listed below beginning with bin/, for the SolarisTM Operating System and Linux). jre/lib/cmm/PYCC.pf Color profile. This file is required only if one wishes to convert between the PYCC color space and another color space. ---- So implicit in this is that the jre/lib/cmm directory is an exported interface ...
04-04-2014