#REFACTORING by exept
class: AbstractSourceCodeManager class
changed: #getSourceStreamFor:revision:cache:
--- a/AbstractSourceCodeManager.st Sun Feb 23 16:35:34 2020 +0100
+++ b/AbstractSourceCodeManager.st Sun Feb 23 16:36:01 2020 +0100
@@ -2537,7 +2537,7 @@
which itself is extracted from the classes packageString."
|classFileName binaryRevision revision revisionUsed
- packageDir moduleDir sourceInfo revForMeOrNil|
+ packageDir moduleDir sourceInfo revForMeOrNil packageId|
aRevisionStringOrNil == #newest ifTrue:[
^ self getMostRecentSourceStreamForClassNamed:(aClass theNonMetaclass name).
@@ -2559,12 +2559,14 @@
revision isNil ifTrue:[
('SourceCodeManager [info]: binary revision "%3" of "%1" is not for %4 - cannot extract version'
bindWith:aClass name
- with:revision with:binaryRevision
+ with:revision
+ with:binaryRevision
with:self name) infoPrintCR.
] ifFalse:[
('SourceCodeManager [info]: binary revision "%3" of "%1" is not for %4 - trusting revision %2'
bindWith:aClass name
- with:revision with:binaryRevision
+ with:revision
+ with:binaryRevision
with:self name) infoPrintCR.
].
^ nil
@@ -2572,7 +2574,8 @@
revision ~= binaryRevision ifTrue:[
('SourceCodeManager [info]: "%1" has %4-revision (%2) vs. binary revision (%3) - trusting binaryRevision'
bindWith:aClass name
- with:revision with:binaryRevision
+ with:revision
+ with:binaryRevision
with:self name) infoPrintCR.
"/ self halt.
].
@@ -2586,14 +2589,17 @@
"/ ('SourceCodeManager [warning]: no sourceInfo for class "%1"' bindWith:aClass name) infoPrintCR.
"/ ^ nil
"/ let's hope...
+ packageId := aClass package asPackageId.
+
classFileName := aClass classFilename.
- packageDir := aClass package asPackageId directory.
- moduleDir := aClass package asPackageId module.
+ packageDir := packageId directory.
+ moduleDir := packageId module.
] ifFalse:[
packageDir := self directoryFromSourceInfo:sourceInfo.
packageDir isNil ifTrue:[
- packageDir := aClass package asPackageId directory.
- moduleDir := aClass package asPackageId module.
+ packageId := aClass package asPackageId.
+ packageDir := packageId directory.
+ moduleDir := packageId module.
] ifFalse:[
moduleDir := self moduleFromSourceInfo:sourceInfo. "/ use the modules name as CVS module
].