#REFACTORING by exept
class: Smalltalk class
changed:
#installAutoloadedClassesFrom:
#recursiveInstallAutoloadedClassesFrom:rememberIn:maxLevels:noAutoload:packageTop:showSplashInLevels:
#recursiveReadAllAbbreviationsFrom:maxLevels:
--- a/Smalltalk.st Sun Jan 05 17:13:44 2020 +0100
+++ b/Smalltalk.st Sun Jan 05 17:26:09 2020 +0100
@@ -5948,16 +5948,16 @@
f isNil ifTrue:[f := self getPackageFileName:anAbbrevFilePath].
f notNil ifTrue:[
- f := f asFilename.
- f isDirectory ifTrue:[
- f := f construct:'abbrev.stc'
- ].
- [
- s := f readStream.
- self installAutoloadedClassesFromStream:s.
- s close.
- ] on:FileStream openErrorSignal
- do:[:ex| "do nothing"].
+ f := f asFilename.
+ f isDirectory ifTrue:[
+ f := f construct:'abbrev.stc'
+ ].
+ [
+ s := f readStream.
+ self installAutoloadedClassesFromStream:s.
+ s close.
+ ] on:OpenError
+ do:[:ex| "do nothing"].
]
"
@@ -6259,15 +6259,14 @@
[
self installAutoloadedClassesFromAbbrevFile:(dir / 'abbrev.stc').
haveAbbrevDotSTC := true.
- ] on:FileStream openErrorSignal
- do:[:ex|
+ ] on:OpenError do:[:ex|
"ignore this file"
].
].
[
directoryContents := dir directoryContents.
- ] on:FileStream openErrorSignal do:[:ex|
+ ] on:OpenError do:[:ex|
"non-accessible directory: we are done"
^ self
].
@@ -6312,7 +6311,7 @@
[
self installAutoloadedClassFromSourceFile:f.
f directory baseName = 'libbasic' ifTrue:[self halt].
- ] on:FileStream openErrorSignal do:[:ex|
+ ] on:OpenError do:[:ex|
"ignore this file, but write a warning"
Transcript showCR:('Autoload: cannot install %1. (%2)' bindWith:f pathName with:ex description).
].
@@ -8286,40 +8285,40 @@
maxLevels == 0 ifTrue:[
"/ 'Smalltalk [warning]: max directory nesting reached.' infoPrintCR.
- ^ self
+ ^ self
].
dir := aDirectory asFilename.
dir exists ifFalse:[^ self].
[
- abbrevStream := (dir / 'abbrev.stc') asFilename readStream.
- self readAbbreviationsFromStream:abbrevStream.
- abbrevStream close.
- ] on:FileStream openErrorSignal do:[:ex| "ignore this file"].
+ abbrevStream := (dir / 'abbrev.stc') asFilename readStream.
+ self readAbbreviationsFromStream:abbrevStream.
+ abbrevStream close.
+ ] on:OpenError do:[:ex| "ignore this file"].
[
- directoryContents := dir directoryContents.
- ] on:FileStream openErrorSignal do:[:ex|
- "non-accessible directory: we are done"
- ^ self
+ directoryContents := dir directoryContents.
+ ] on:OpenError do:[:ex|
+ "non-accessible directory: we are done"
+ ^ self
].
directoryContents do:[:aFilename |
- |f|
-
- (#(
- 'doc'
- 'CVS'
- 'bitmaps'
- 'resources'
- 'source'
- ) includes:aFilename) ifFalse:[
- f := dir / aFilename.
- f isDirectory ifTrue:[
- self recursiveReadAllAbbreviationsFrom:f maxLevels:maxLevels-1
- ]
- ].
+ |f|
+
+ (#(
+ 'doc'
+ 'CVS'
+ 'bitmaps'
+ 'resources'
+ 'source'
+ ) includes:aFilename) ifFalse:[
+ f := dir / aFilename.
+ f isDirectory ifTrue:[
+ self recursiveReadAllAbbreviationsFrom:f maxLevels:maxLevels-1
+ ]
+ ].
].
!