load owner of an unknown private class in decodeLiteralArray
authorClaus Gittinger <cg@exept.de>
Tue, 20 Aug 2002 16:35:15 +0200
changeset 6724 e5b2bac20f37
parent 6723 51ed366a10b1
child 6725 43cfc975da45
load owner of an unknown private class in decodeLiteralArray
SequenceableCollection.st
--- a/SequenceableCollection.st	Fri Aug 16 13:49:35 2002 +0200
+++ b/SequenceableCollection.st	Tue Aug 20 16:35:15 2002 +0200
@@ -1549,7 +1549,7 @@
      create & return the corresponding object.
      The inverse operation to #literalArrayEncoding."
 
-    |clsName cls|
+    |clsName cls loadOwnerOf|
 
     clsName := self first.
     clsName isSymbol ifFalse:[
@@ -1559,9 +1559,33 @@
     ].
     cls := Smalltalk at:clsName ifAbsent:nil.
     cls isNil ifTrue:[
-        ^ MissingClassInLiteralArrayErrorSignal 
-                raiseRequestWith:clsName 
-                errorString:('unknown class in literalArray-spec: ' , clsName)
+        "/ is it a private class of an autoloaded class ?
+        loadOwnerOf := [:clsName |
+                            |t ownerName owner|
+
+                            t := clsName.
+                            [(t indexOf:$:) ~~ 0] whileTrue:[
+                                t := t copyTo:(t lastIndexOf:$:).
+                                (t endsWith:$:) ifTrue:[t:= t copyWithoutLast:1].
+                                (t endsWith:$:) ifTrue:[t:= t copyWithoutLast:1].
+                                ownerName := t.
+                                owner := Smalltalk at:ownerName asSymbol ifAbsent:nil.
+                                owner isNil ifTrue:[
+                                    loadOwnerOf value:ownerName.
+                                    owner := Smalltalk at:ownerName asSymbol ifAbsent:nil.
+                                ].
+                                owner notNil ifTrue:[
+                                    owner autoload
+                                ].
+                            ].
+                        ].
+        loadOwnerOf value:clsName.
+        cls := Smalltalk at:clsName ifAbsent:nil.
+        cls isNil ifTrue:[
+            ^ MissingClassInLiteralArrayErrorSignal 
+                    raiseRequestWith:clsName 
+                    errorString:('unknown class in literalArray-spec: ' , clsName)
+        ].
     ].
     ^ cls decodeFromLiteralArray:self.
 
@@ -5692,6 +5716,6 @@
 !SequenceableCollection class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.166 2002-06-25 13:59:36 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.167 2002-08-20 14:35:15 cg Exp $'
 ! !
 SequenceableCollection initialize!