RFR: 8335610: DiagnosticFramework: CmdLine::is_executable() correction

Kevin Walls kevinw at openjdk.org
Fri Jul 12 09:43:51 UTC 2024


On Wed, 3 Jul 2024 13:58:51 GMT, Kevin Walls <kevinw at openjdk.org> wrote:

> CmdLine::is_executable() looks wrong, surely an empty line is not executable.
> 
> With this change, in DCmd::parse_and_execute() we will avoid needlessly entering the code block to try and execute the command.
> 
> DCmd tests all good:
> make images test TEST="test/hotspot/jtreg/serviceability/dcmd test/jdk/sun/tools/jcmd"

Thanks -
I was trying to make the simple "obvious" correction.

The jump is from the fact that nobody currently creates an empty CmdLine, to a ruling that nobody ever can in the future.

There aren't many places that create these CmdLine objects, and we don't expect much new code to use it, but there was an example of a new usage recently.

I don't object to making the additional change, haven't got to it yet.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/20006#issuecomment-2225207843


More information about the serviceability-dev mailing list