JDK-7130391 : RFE:Add framework for vendor-specific validation control of setting command-line switches in Hotspot
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: hs23
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2012-01-16
  • Updated: 2014-03-10
  • Resolved: 2014-03-10
Related Reports
Relates :  
Relates :  
Description
Oracle, and perhaps Java source licensees, would like to add validation control to the setting of command line switches in Hotspot that are vendor-specific.  To this end, a framework for doing so is needed.

The framework should be able to validate any change to the value or origin for any command-line flag, and abort the setting if the validation fails. For example, a flag may be of integer type but only allow a certain value range [a,b], or may only be set from a certain origin such as the command line.

When parsing the command line options, a failed validation will typically result in an error message and exit with "Unrecognized VM option '<flag-name>'". When used dynamically using the attach API or management API the resulting operation will fail with an appropriate message.

Comments
As Robert pointed out, there are no vendor specific command line flags. We don't see the requirement to do this. Closing as WNF
10-03-2014

SUGGESTED FIX The basic idea is to extend the vendor-specific implementation hooks in globals_ext.hpp, of which there are two version, one in src/share/vm/runtime that is a null implementation of the hooks, and another in vendor-specific code. The validation control is handled by new boolean methods Flag::is_valid_<type>(value,origin) that are called at the beginning of each <type>AtPut() call to verify that the new value and origin are valid for this flag. We also need to ensure that the dynamic settings of manageable flags through the attach and managment APIs gracefully can handle the case when trying to set a flag with an incorrect value or origin fails.
16-01-2012