RFR 8048840: File.createTempFile has uninformative failure message
Alan Bateman
Alan.Bateman at oracle.com
Wed Jul 2 14:44:41 UTC 2014
On 02/07/2014 01:02, Jeremy Manson wrote:
> Here you go (far too lazy to generate a webrev for this. :) )
>
> diff --git a/src/share/classes/java/io/File.java
> b/src/share/classes/java/io/File.java
> --- a/src/share/classes/java/io/File.java
> +++ b/src/share/classes/java/io/File.java
> @@ -1997,8 +1997,10 @@
> File directory)
> throws IOException
> {
> - if (prefix.length() < 3)
> - throw new IllegalArgumentException("Prefix string too
> short");
> + if (prefix.length() < 3) {
> + throw new IllegalArgumentException("Prefix string \"" +
> prefix +
> + "\" too short: length must be at least 3");
> + }
> if (suffix == null)
> suffix = ".tmp";
>
This looks okay and I see Martin is going to sponsor this.
-Alan
More information about the core-libs-dev
mailing list