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

2024-07-30 Thread Kevin Walls
On Wed, 3 Jul 2024 13:58:51 GMT, Kevin Walls 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: > m

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

2024-07-29 Thread Johan Sjölen
On Wed, 3 Jul 2024 13:58:51 GMT, Kevin Walls 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: > m

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

2024-07-29 Thread Johan Sjölen
On Wed, 3 Jul 2024 13:58:51 GMT, Kevin Walls 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: > m

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

2024-07-29 Thread Kevin Walls
On Sun, 28 Jul 2024 09:48:21 GMT, Johan Sjölen 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 g

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

2024-07-28 Thread David Holmes
On Wed, 3 Jul 2024 13:58:51 GMT, Kevin Walls 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: > m

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

2024-07-28 Thread David Holmes
On Sun, 28 Jul 2024 09:48:21 GMT, Johan Sjölen 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 g

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

2024-07-28 Thread Johan Sjölen
On Wed, 3 Jul 2024 13:58:51 GMT, Kevin Walls 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: > m

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

2024-07-14 Thread David Holmes
On Fri, 12 Jul 2024 09:41:04 GMT, Kevin Walls wrote: > The jump is from the fact that nobody currently creates an empty CmdLine, to > a ruling that nobody ever can in the future. No my point is either it is impossible to create an empty cmdline or else we should have a test that introduces one

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

2024-07-12 Thread Daniel D . Daugherty
On Wed, 3 Jul 2024 13:58:51 GMT, Kevin Walls 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: > m

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

2024-07-12 Thread Kevin Walls
On Wed, 3 Jul 2024 13:58:51 GMT, Kevin Walls 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: > m

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

2024-07-11 Thread David Holmes
On Fri, 12 Jul 2024 03:04:06 GMT, Serguei Spitsyn wrote: > Do I understand this right that the suggestion is to add an explicit runtime > check for non-emptiness and report an error if an empty line has been > discovered? If so, then the `is_empty()`check can be removed from the > `CmdLine::is

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

2024-07-11 Thread Serguei Spitsyn
On Thu, 4 Jul 2024 23:08:37 GMT, David Holmes wrote: > My concern is that the logic was wrong and so you fixed it, but this then > screams out for a test that would have detected the error, but you can't > write a test because the line can never be empty, so that becomes an > invariant rather

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

2024-07-04 Thread David Holmes
On Wed, 3 Jul 2024 13:58:51 GMT, Kevin Walls 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: > m

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

2024-07-04 Thread Kevin Walls
On Thu, 4 Jul 2024 09:24:52 GMT, David Holmes wrote: > But if it can't be empty can we not just assert that and get rid of the > is_empty check from is_executable? Yes, we might be able to do that. I was going for just the obvious logic correction, because it's distracting to read through thi

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

2024-07-04 Thread David Holmes
On Wed, 3 Jul 2024 13:58:51 GMT, Kevin Walls 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: > m

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

2024-07-04 Thread Kevin Walls
On Thu, 4 Jul 2024 05:20:38 GMT, David Holmes 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 it

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

2024-07-03 Thread David Holmes
On Wed, 3 Jul 2024 13:58:51 GMT, Kevin Walls 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: > m

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

2024-07-03 Thread Kevin Walls
On Wed, 3 Jul 2024 13:58:51 GMT, Kevin Walls 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: > m