This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Patch: fix for File.createTempFile
- To: Java Patch List <java-patches at sourceware dot cygnus dot com>
- Subject: Patch: fix for File.createTempFile
- From: Tom Tromey <tromey at cygnus dot com>
- Date: 12 Feb 2000 13:07:45 -0700
- Reply-To: tromey at cygnus dot com
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);