commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trei...@apache.org
Subject cvs commit: jakarta-commons-sandbox/id/src/java/org/apache/commons/id/uuid/state Node.java
Date Mon, 31 May 2004 06:45:34 GMT
treilly     2004/05/30 23:45:34

  Modified:    id/src/java/org/apache/commons/id/uuid/state Node.java
  Log:
  Wrap number at 14th not 16th bit during increment (2bits for clock sequence)
  
  Revision  Changes    Path
  1.4       +5 -2      jakarta-commons-sandbox/id/src/java/org/apache/commons/id/uuid/state/Node.java
  
  Index: Node.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/id/src/java/org/apache/commons/id/uuid/state/Node.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Node.java	28 Apr 2004 03:01:22 -0000	1.3
  +++ Node.java	31 May 2004 06:45:34 -0000	1.4
  @@ -98,7 +98,10 @@
        * <p>Increments the clock sequence in this node.</p>
        */
       private void incrementClockSequence() {
  -        clockSequence++;
  +        //Increment, but if it's greater than its 14-bits, reset it
  +        if (++clockSequence > 0x3FFF) {
  +            clockSequence = 0;
  +        }
       }
   
       /**
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message