Hi, <br><br>I'd like to work on this RFE:<br><a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4735419" target="_blank">http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4735419</a><br><br>It looks like an easy start if I want to contribute to openjdk. Customers are <br>

often using a "workaround" described in bug which contains a race.<br><br>My solution would be something like proposed bellow - but it'd be nice<br>if someone could guide me through the process since I'd like to work on more RFEs.<br>

<br>Cheers,<br><font color="#888888">Michal<br><br>-------------<br>diff --git a/src/share/classes/java/io/File.java b/src/share/classes/java/io/File.java<br>--- a/src/share/classes/java/io/File.java<br>+++ b/src/share/classes/java/io/File.java<br>
@@ -2041,6 +2041,42 @@ public class File<br>         }<br>     }<br> <br>+    public static File createTempDirectory(String prefix, String suffix,<br>+                                      File directory)<br>+        throws IOException<br>
+    {<br>+        if (prefix.length() < 3)<br>+            throw new IllegalArgumentException("Prefix string too short");<br>+        if (suffix == null)<br>+            suffix = ".tmp";<br>+<br>+        File tmpdir = (directory != null) ?<br>
+            directory : TemporaryDirectory.valueAsFile;<br>+        SecurityManager sm = System.getSecurityManager();<br>+        File f;<br>+        do {<br>+            f = TemporaryDirectory.generateFile(prefix, suffix, tmpdir);<br>
+            if (sm != null) {<br>+                try {<br>+                    sm.checkWrite(f.getPath());<br>+                } catch (SecurityException se) {<br>+                    // don't reveal temporary directory location<br>
+                    if (directory == null)<br>+                        throw new SecurityException("Unable to create temporary file");<br>+                    throw se;<br>+                }<br>+            }<br>
+        } while (!fs.createDirectory(f.getPath()));<br>+        return f;<br>+    }<br>+<br>+    public static File createTempDirectory(String prefix, String suffix)<br>+        throws IOException<br>+    {<br>+        return createTempDirectory(prefix, suffix, null);<br>
+    }<br>+<br>+<br>     /* -- Basic infrastructure -- */<br> <br>     /**<br></font>