2006-06-18 Audrius Meskauskas <[EMAIL PROTECTED]>
PR 28035
* java/rmi/server/UID.java (constructor): First increment
uidCounter, and then use the value.
Index: UID.java
===================================================================
RCS file: /sources/classpath/classpath/java/rmi/server/UID.java,v
retrieving revision 1.11
diff -u -r1.11 UID.java
--- UID.java 23 Mar 2006 16:12:56 -0000 1.11
+++ UID.java 18 Jun 2006 20:52:15 -0000
@@ -94,7 +94,7 @@
* The time stamp, when the UID was created.
*/
private long time;
-
+
/**
* Create the new UID that would have the described features of the
* uniqueness.
@@ -126,8 +126,7 @@
uidCounter = Short.MIN_VALUE;
time = last = System.currentTimeMillis();
}
-
- count = uidCounter++;
+ count = ++uidCounter;
}
}
}
@@ -210,7 +209,7 @@
^ hostIpHash;
}
- /**
+ /**
* Get the string representation of this UID.
*
* @return a string, uniquely identifying this id.
@@ -219,9 +218,8 @@
{
int max = Character.MAX_RADIX;
// Translate into object count, counting from 0.
- long lc = (count + Short.MIN_VALUE) & 0xFFFF;
- return Long.toString(time, max) + ":"
- + Long.toString(unique, max) + ":"
+ long lc = (count - Short.MIN_VALUE) & 0xFFFF;
+ return Long.toString(unique, max) + ":" + Long.toString(time, max) + "."
+ Long.toString(lc, max);
}
}