code review request: 7051946: Runtime.exec(String command) / ProcessBuilder command parsing issues

Michael McMahon michael.x.mcmahon at oracle.com
Wed Sep 14 09:41:52 UTC 2011


On 13/09/11 18:26, Alan Bateman wrote:
> Michael McMahon wrote:
>> Can I get the following webrev reviewed please?
>>
>> http://cr.openjdk.java.net/~michaelm/7051946/webrev.1/
> I scanned this briefly (I haven't done a detailed code review) but one 
> initial comment is that Runtime.exec will now throw 
> IllegalArgumenetException for that a case that isn't specified. The 
> current javadoc says it is only thrown "If command is empty" and maybe 
> this needs to be re-examined. I assume such cases would cause 
> IOException to be thrown today.
>
> -Alan.
We could add a sentence to the existing  @throws clause for IAE.

So it would say "If |command| is empty, or on some platforms, may be 
thrown if command contains illegal characters".

I'm reluctant to be more precise than that, since as far as I know, 
there doesn't appear to be
any illegal characters for filenames in Unix.

- Michael.



More information about the core-libs-dev mailing list