checkin from browser
authorClaus Gittinger <cg@exept.de>
Mon, 20 Sep 1999 09:55:53 +0200
changeset 1219 0bcf1df24277
parent 1218 8e2fa160357f
child 1220 998ca027d633
checkin from browser
ProjectBrowser.st
--- a/ProjectBrowser.st	Mon Sep 20 08:57:51 1999 +0200
+++ b/ProjectBrowser.st	Mon Sep 20 09:55:53 1999 +0200
@@ -3710,7 +3710,8 @@
 !
 
 loadProjectCode
-    |project filesToLoad methodsFile ns anyPatchClassMissing anyPatches|
+    |project filesToLoad methodsFile ns anyPatchClassMissing anyPatches
+     nMissingSuper prevNMissingSuper|
 
     project := self currentProject.
     ns := project defaultNameSpace.
@@ -3780,15 +3781,26 @@
         filesToLoad size == 0 ifTrue:[
             self information:'Projects code is already loaded.'
         ] ifFalse:[
-            "/ load twice to avoid load-order trouble with superclasses ..
-            2 timesRepeat:[
-                Class packageQuerySignal answer:project package asSymbol
-                do:[
-                    filesToLoad do:[:fileToLoad |
-                        Smalltalk fileIn:(project directory asFilename construct:fileToLoad) pathName
+            "/ load as long as superclasses are missing
+            "/ (since the load order could be incorrect)
+            prevNMissingSuper := nil.
+            nMissingSuper := 1.
+            [nMissingSuper > 0 and:[nMissingSuper ~~ prevNMissingSuper]]
+            whileTrue:[
+                nMissingSuper := 0.
+                Parser::UndefinedSuperclassError handle:[:ex |
+                    nMissingSuper := nMissingSuper + 1.
+                    ex proceed
+                ] do:[
+                    Class packageQuerySignal answer:project package asSymbol
+                    do:[
+                        filesToLoad do:[:fileToLoad |
+                            Smalltalk fileIn:(project directory asFilename construct:fileToLoad) pathName
+                        ]
                     ]
-                ]
-            ]
+                ].
+                prevNMissingSuper := nMissingSuper.
+            ].
         ].
         project isLoaded:true.
         self readAspectsFromProject