#new is now the same as genUUID (squeak compatibility)
authorClaus Gittinger <cg@exept.de>
Mon, 21 Jan 2008 13:43:07 +0100
changeset 1923 6380ea5d7385
parent 1922 be14f1a04953
child 1924 4f84cb037a21
#new is now the same as genUUID (squeak compatibility)
UUID.st
--- a/UUID.st	Fri Jan 18 20:40:51 2008 +0100
+++ b/UUID.st	Mon Jan 21 13:43:07 2008 +0100
@@ -90,13 +90,26 @@
 
 !UUID class methodsFor:'instance creation'!
 
+basicNew
+    ^ super basicNew:16
+!
+
+basicNew:size
+    "allow creating with exact size. We need this for XMLStandardDecoder"
+
+    size ~~ 16 ifTrue:[
+        ^ self shouldNotImplement.
+    ].
+    ^ super basicNew:size.
+!
+
 fromBytes:aByteArray
     "set uuid from aByteArray.
      aByteArray must be 16 bytes in network byte order (MSB-first)"
 
     |uuid|
 
-    uuid := self new.
+    uuid := super basicNew:16.
     uuid replaceFrom:1 to:16 with:aByteArray.
     ^ uuid.
 
@@ -161,7 +174,7 @@
 genRandomUUID
     "generate a new random UUID"
 
-    ^ self new genRandomUUID
+    ^ (super basicNew:16) genRandomUUID
 
     "
       self genRandomUUID
@@ -174,15 +187,19 @@
      a mac-address/timestamp uuid is generated,
      otherwise a random uuid will be generated."
 
-    ^ self new genUUID
+    ^ (super basicNew:16) genUUID
 
     "
-      self genUUID
+     self genUUID
     "
 !
 
 new
-    ^ super new:16
+    ^ (super basicNew:16) genUUID
+
+    "
+     self new 
+    "
 !
 
 new:size
@@ -201,7 +218,7 @@
         ^ errorBlock value.
     ] do:[
         s := aStringOrStream readStream.
-        uuid := self new.
+        uuid := super basicNew:16.
 
         s skipSeparators.
         s peek == ${ ifTrue:[s next].
@@ -584,7 +601,7 @@
 !UUID class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic2/UUID.st,v 1.23 2007-10-10 21:17:50 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic2/UUID.st,v 1.24 2008-01-21 12:43:07 cg Exp $'
 ! !
 
 UUID initialize!