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

Kevin Walls kevinw at openjdk.org
Thu Jul 4 09:02:19 UTC 2024


On Thu, 4 Jul 2024 05:20:38 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Can a line ever be empty?

No it can't.  Runing "jcmd PID" becomes "help", and giving empty quotes as the command like
  jcmd PID "" 
does pass an empty string to parse_and_execute(), but the DCmdIter in there will never find anything to iterate (nor with multiple "" or with "     ").

bash-4.2$ jcmd 18851 "" 
18851:
Command executed successfully

The CmdLine is the thing that would be returned by DCmdIter, and we don't create empty ones (as things stand today).  So this change should be harmless but correct.

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

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


More information about the serviceability-dev mailing list