JDK-8027770 : need to consolidate our registry manipulation approach
  • Type: Enhancement
  • Component: install
  • Affected Version: 8-pool
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-11-04
  • Updated: 2014-07-29
  • Resolved: 2014-05-14
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 8 JDK 9
8u20Fixed 9 b15Fixed
Description
When au2.0 was created, we introduced a registry class.  This is located at:

install/src/windows/common/regkey

I believe there are some issues with it, I don't recall exactly what.  Another registry class was recently introduced at:

src/windows/common/Registry.cpp/.h

We also have lots of places where we have direct registry manipulation without any use of either class.

We should consolidate all registry manipulation into one class and consistently use it throughout our repo.  


Comments
Not verified by SQE. Internal fix.
04-06-2014

RegKey class has the following issues: - does not handle TCHARs properly; - does not provide correct resource management (does not free resources); - is low-level (for example we had to update almost every place where the class was used implementing "UAC refactor" feature instead updating only the class); - design is not clear in some cases (statement like key.AssignHandle(key.GetHandle()) (required in some cases) looks very confusing) - has security issues (potential buffer overflow) - operators [] (widely used) do not report any errors (so we have no chance to know that we have some problem) Registry class fixes all this issues; also it implements exception-base error handling which is the way we are introducing in our code and uses tstring for any string manipulations. JDK-8039249 adds usage examples for the class, so I believe it's ready to become the only method to use for registry manipulations
17-04-2014