Patch: fix for File.createTempFile
Tom Tromey
tromey@cygnus.com
Sat Feb 12 12:06:00 GMT 2000
I'm committing the appended patch. It changes File.createTempFile to
use the low bits of the internal counter, not the high bits. The low
bits are the ones that change...
2000-02-12 Tom Tromey <tromey@cygnus.com>
* java/io/File.java (createTempFile): Use low bits from counter,
not high bits.
Tom
Index: java/io/File.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/io/File.java,v
retrieving revision 1.6
diff -u -r1.6 File.java
--- File.java 2000/02/11 18:44:37 1.6
+++ File.java 2000/02/12 19:56:08
@@ -256,7 +256,8 @@
for (int i = 0; i < 100; ++i)
{
// This is ugly.
- String l = prefix + (nextValue () + "ZZZZZZ").substring(0,6) + suffix;
+ String t = "ZZZZZZ" + nextValue ();
+ String l = prefix + t.substring(t.length() - 6) + suffix;
try
{
desc.open (l, FileDescriptor.WRITE | FileDescriptor.EXCL);
More information about the Java-patches
mailing list