#REFACTORING by cg
authorClaus Gittinger <cg@exept.de>
Wed, 12 Oct 2016 15:40:35 +0200
changeset 16934 096cb5129063
parent 16933 fddff2620ed7
child 16935 ee594aebfa60
#REFACTORING by cg class: Tools::NewSystemBrowser changed: #findNodeIn:forInterval: code duplication
Tools__NewSystemBrowser.st
--- a/Tools__NewSystemBrowser.st	Wed Oct 12 15:39:20 2016 +0200
+++ b/Tools__NewSystemBrowser.st	Wed Oct 12 15:40:35 2016 +0200
@@ -16,61 +16,61 @@
 "{ NameSpace: Tools }"
 
 SystemBrowser subclass:#NewSystemBrowser
-	instanceVariableNames:'environmentHolder environment navigationState bufferNameList
-		selectedBuffer buffers bufferUsageOrder browserCanvas
-		immediateUpdate showClassPackages lastMethodCategory
-		lastMethodMoveClass browserCanvasType
-		syntaxColoringProcessRunning syntaxColoringProcess
-		methodInfoProcess browsletShowHideLabelHolder browserPageCanvas
-		isEmbedded hasNonEmptyEnvironmentSelectedHolder
-		smalllintRulesOrAllHolder smalllintRulesOrDefaultHolder
-		explainProcess'
-	classVariableNames:'LastNewProtocols LastProtocolRenames LastCategoryRenames
-		LastCategoryRenameOld LastCategoryRenameNew LastProjectMoves
-		LastNameSpaceMove LastMethodMoveOrCopyTargetClass
-		LastClassFilterBlockString LastMethodFilterBlockString
-		LastBreakPointConditionString LastIndividualChecks
-		LastAcceptPackage LastVariableRenames LastVisitorClassName
-		LastTemporaryVariableName FindHistory SynchronousUpdate
-		DoubleClickIsOpenBrowser ShowMethodTemplateWhenProtocolIsSelected
-		DefaultShowMethodInheritance DefaultEmphasizeUnloadedClasses
-		DefaultImmediateSyntaxColoring DefaultImmediateExplaining
-		DefaultSyntaxColoring DefaultToolBarVisible
-		DefaultCodeInfoVisible DefaultShortNameInTabs
-		DefaultHideUnloadedClasses DefaultMarkApplications
-		DefaultAutoFormat DefaultShowMethodComplexity
-		DefaultShowMethodTypeIcon DefaultShowSpecialResourceEditors
-		DefaultShowSyntheticMethods SharedMethodCategoryCache
-		LastMethodProcessingBlockString LastLoadedPackages
-		DefaultShortAllClassesInNameSpaceOrganisation LastBaseVersionTag
-		LastTag DefaultShowPseudoProtocols DefaultShowMultitabMode
-		LastRenamedOld LastRenamedNew LastImportedPackage
-		LastLintRulesHolder NewNavigationHistory
-		LastLiteralReplacementType LastLiteralReplacementNewName
-		LastLiteralReplacementOldLiteral LastNewProjectType
-		LastClassProcessingBlockString RecentlyClosedList
-		LastClassSearchBoxShowedFullName CachedTagToRevisionMapping
-		CachedMethodsImplemented LastCypressDirectory
-		LastClassSearchBoxShowedJavaOnly LastRemoteRepository
-		LastClassDocDirectory DefaultShowCoverage LastLintedPackage
-		LastSearchedImplementors LastSearchedSenders
-		LastComparedClassName'
-	poolDictionaries:''
-	category:'Interface-Browsers-New'
+        instanceVariableNames:'environmentHolder environment navigationState bufferNameList
+                selectedBuffer buffers bufferUsageOrder browserCanvas
+                immediateUpdate showClassPackages lastMethodCategory
+                lastMethodMoveClass browserCanvasType
+                syntaxColoringProcessRunning syntaxColoringProcess
+                methodInfoProcess browsletShowHideLabelHolder browserPageCanvas
+                isEmbedded hasNonEmptyEnvironmentSelectedHolder
+                smalllintRulesOrAllHolder smalllintRulesOrDefaultHolder
+                explainProcess'
+        classVariableNames:'LastNewProtocols LastProtocolRenames LastCategoryRenames
+                LastCategoryRenameOld LastCategoryRenameNew LastProjectMoves
+                LastNameSpaceMove LastMethodMoveOrCopyTargetClass
+                LastClassFilterBlockString LastMethodFilterBlockString
+                LastBreakPointConditionString LastIndividualChecks
+                LastAcceptPackage LastVariableRenames LastVisitorClassName
+                LastTemporaryVariableName FindHistory SynchronousUpdate
+                DoubleClickIsOpenBrowser ShowMethodTemplateWhenProtocolIsSelected
+                DefaultShowMethodInheritance DefaultEmphasizeUnloadedClasses
+                DefaultImmediateSyntaxColoring DefaultImmediateExplaining
+                DefaultSyntaxColoring DefaultToolBarVisible
+                DefaultCodeInfoVisible DefaultShortNameInTabs
+                DefaultHideUnloadedClasses DefaultMarkApplications
+                DefaultAutoFormat DefaultShowMethodComplexity
+                DefaultShowMethodTypeIcon DefaultShowSpecialResourceEditors
+                DefaultShowSyntheticMethods SharedMethodCategoryCache
+                LastMethodProcessingBlockString LastLoadedPackages
+                DefaultShortAllClassesInNameSpaceOrganisation LastBaseVersionTag
+                LastTag DefaultShowPseudoProtocols DefaultShowMultitabMode
+                LastRenamedOld LastRenamedNew LastImportedPackage
+                LastLintRulesHolder NewNavigationHistory
+                LastLiteralReplacementType LastLiteralReplacementNewName
+                LastLiteralReplacementOldLiteral LastNewProjectType
+                LastClassProcessingBlockString RecentlyClosedList
+                LastClassSearchBoxShowedFullName CachedTagToRevisionMapping
+                CachedMethodsImplemented LastCypressDirectory
+                LastClassSearchBoxShowedJavaOnly LastRemoteRepository
+                LastClassDocDirectory DefaultShowCoverage LastLintedPackage
+                LastSearchedImplementors LastSearchedSenders
+                LastComparedClassName'
+        poolDictionaries:''
+        category:'Interface-Browsers-New'
 !
 
 ListEntry subclass:#OwnershipGraph
-	instanceVariableNames:'ownershipInfo cachedForm'
-	classVariableNames:''
-	poolDictionaries:''
-	privateIn:NewSystemBrowser
+        instanceVariableNames:'ownershipInfo cachedForm'
+        classVariableNames:''
+        poolDictionaries:''
+        privateIn:NewSystemBrowser
 !
 
 Object subclass:#RevisionOwnershipInfo
-	instanceVariableNames:'revision author date lineOwnership'
-	classVariableNames:''
-	poolDictionaries:''
-	privateIn:NewSystemBrowser::OwnershipGraph
+        instanceVariableNames:'revision author date lineOwnership'
+        classVariableNames:''
+        poolDictionaries:''
+        privateIn:NewSystemBrowser::OwnershipGraph
 !
 
 !NewSystemBrowser class methodsFor:'documentation'!
@@ -38835,27 +38835,28 @@
 
 findNodeIn:tree forInterval:interval
     <resource: #obsolete>
-    |node wouldReturn|
-
-self obsoleteMethodWarning.
-    node := nil.
-    tree nodesDo:[:each |
-        (each intersectsInterval:interval) ifTrue:[
-            (node isNil or:[node == each parent]) ifTrue:[
-                node := each
-            ] ifFalse:[
-                (node parent notNil
-                    and:[node parent isCascade and:[each parent isCascade]]) ifFalse:[^ nil]
-            ]
-        ] ifFalse:[
-            node notNil ifTrue:[
-                "/ already found one - beyond that one; leave
-                wouldReturn notNil ifTrue:[wouldReturn := node].
-            ]
-        ].
-    ].
-"/ (wouldReturn notNil and:[wouldReturn ~~ node]) ifTrue:[self halt].
-    ^ node
+
+    self obsoleteMethodWarning.
+    ^ DoWhatIMeanSupport findNodeIn:tree forInterval:interval
+"/    |node wouldReturn|
+"/    node := nil.
+"/    tree nodesDo:[:each |
+"/        (each intersectsInterval:interval) ifTrue:[
+"/            (node isNil or:[node == each parent]) ifTrue:[
+"/                node := each
+"/            ] ifFalse:[
+"/                (node parent notNil
+"/                    and:[node parent isCascade and:[each parent isCascade]]) ifFalse:[^ nil]
+"/            ]
+"/        ] ifFalse:[
+"/            node notNil ifTrue:[
+"/                "/ already found one - beyond that one; leave
+"/                wouldReturn notNil ifTrue:[wouldReturn := node].
+"/            ]
+"/        ].
+"/    ].
+"/"/ (wouldReturn notNil and:[wouldReturn ~~ node]) ifTrue:[self halt].
+"/    ^ node
 
     "Modified: / 20-11-2006 / 12:31:12 / cg"
 !