Summary
Update the behavior of the isVerbose methods so that they reflect the actions of the setVerbose methods.
Problem
The ClassLoadingMXBean::setVerbose(boolean enabled) method will set class+load* logging on log output stdout to level info if enabled is true, and to level off otherwise. In contrast, the isVerbose method will check if exactly class+load logging is enabled at the info level on any log output. This can result in counter-intuitive behavior when logging class+load=info to a file via the command-line, as it causes isVerbose to return true, even after a call to setVerbose(false) has been made.
A similar problem exists for the MemoryMXBean::isVerbose method.
Solution
To remedy this problem the isVerbose method implementations are modified to report only on what the logging settings for log output stdout have been set to, as would be modified by the setVerbose methods.
Specification
There are no changes to any actual specifications as the specifications involved refer very generically to "the verbose output for the class loading system" and "the verbose output for the memory system", and it is implementation specific as to what that actually means.
With the proposed changes the new behavior is as follows:
-
ClassLoadingMXBean::isVerbosewill returntrueonly ifclass+load*logging (note the wildcard use) has been enabled at theinfolevel (or above) on thestdoutlog output. -
MemoryMXBean::isVerbosewill returntrueonly ifgclogging has been enabled at theinfolevel (or above) on thestdoutlog output.
- csr of
-
JDK-8338139 {ClassLoading,Memory}MXBean::isVerbose methods are inconsistent with their setVerbose methods
-
- Closed
-