Oops - forgot to run jtreg. Make that:

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
@@ -1998,7 +1998,8 @@
         throws IOException
     {
         if (prefix.length() < 3)
-            throw new IllegalArgumentException("Prefix string too short");
+            throw new IllegalArgumentException("Prefix string too short: "
+
+                                               prefix);
         if (suffix == null)
             suffix = ".tmp";

diff --git a/test/java/io/File/NulFile.java b/test/java/io/File/NulFile.java
--- a/test/java/io/File/NulFile.java
+++ b/test/java/io/File/NulFile.java
@@ -602,7 +602,8 @@
             try {
                 File.createTempFile(prefix, suffix, directory);
             } catch (IllegalArgumentException ex) {
-                if ("Prefix string too short".equals(ex.getMessage()))
+                String s = ex.getMessage();
+                if (s != null && s.startsWith("Prefix string too short"))
                     exceptionThrown = true;
             } catch (IOException ioe) {
                 System.err.println("IOException happens in
testCreateTempFile");



On Mon, Jun 30, 2014 at 6:05 PM, Jeremy Manson <jeremyman...@google.com>
wrote:

> Hi folks,
>
> We had a couple of complaints about this from our users, and it is a
> pretty trivial fix, so I'm throwing this out as a potential patch.  I
> filed JDK-8048840:
>
> 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
> @@ -1998,7 +1998,8 @@
>          throws IOException
>      {
>          if (prefix.length() < 3)
> -            throw new IllegalArgumentException("Prefix string too short");
> +            throw new IllegalArgumentException("Prefix string too short:
> " +
> +                                               prefix);
>          if (suffix == null)
>              suffix = ".tmp";
>
> Jeremy
>

Reply via email to