JDK-8236754 : nonproduct and develop flags should not be printed by product build
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 15
  • Priority: P4
  • Status: Resolved
  • Resolution: Won't Fix
  • Submitted: 2020-01-08
  • Updated: 2020-08-06
  • Resolved: 2020-08-06
Related Reports
Relates :  
Relates :  
Relates :  
Description
All nonproduct and develop flags are added to the flagTable.

http://hg.openjdk.java.net/jdk/jdk/file/2fbc66ef1a1d/src/hotspot/share/runtime/flags/jvmFlag.cpp#l825

The only purpose seems to be printing a warning message when these flags are used

$ java -XX:+TraceInvocationCounterOverflow -version
Error: VM option 'TraceInvocationCounterOverflow' is notproduct and is available only in debug version of VM.
$ java -XX:+TraceInvocationCounterOverflo -version
Unrecognized VM option 'TraceInvocationCounterOverflo'
Did you mean '(+/-)TraceInvocationCounterOverflow'? Error: Could not create the Java Virtual Machine.

Since these flags cannot be set in product builds, printing a message about them doesn't seem that helpful.

We should remove the entries of these flags from flagTable to save space, and make JVMFlag::find_flag() faster.
Comments
The end user doesn't know which flags are product/notproduct/develop. If they find some blog or forum entry suggesting a flag for a particular issue and use it and it just reports "Unrecognized VM option" they will be left confused and perplexed. Telling them the flag is notp[roduct or develop will at least let them know they didn't read incorrect information etc. This is a usability issue.
15-01-2020

Again this relates to JDK-8024545 which it seems you are effectively undoing.
08-01-2020