This is the mail archive of the java-patches@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch: fix for File.createTempFile


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);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]