Tools__NewSystemBrowser.st
changeset 17244 005de1fbde2e
parent 17238 c43dda2f6d6d
child 17246 801796049166
--- a/Tools__NewSystemBrowser.st	Sat Jan 21 04:27:11 2017 +0100
+++ b/Tools__NewSystemBrowser.st	Sat Jan 21 13:11:10 2017 +0100
@@ -46254,22 +46254,40 @@
                 with:(methods first selector ? '?') allBold
                 with:firstClassName allBold.
 
+    "/ ask again, if a version method is to be removed - danger alert            
     numVersionMethods > 0 ifTrue:[
         msg := msg , '\\' ,
                (resources
                 string:'ATTENTION: Removing a classes version method might make the versionManagers life hard.' allBold).
 
         (OptionBox
-                      request:msg withCRs
-                      label:(resources string:'Attention')
-                      image:(WarningBox iconBitmap)
-                      buttonLabels:(resources array:#('Cancel' 'Remove'))
-                      values:#(false true)
-                      default:false
-                      onCancel:false) ifFalse:[^ self].
-
-    ] ifFalse:[
-        (self confirm:msg withCRs) ifFalse:[^ self].
+              request:msg withCRs
+              label:(resources string:'Attention')
+              image:(WarningBox iconBitmap)
+              buttonLabels:(resources array:#('Cancel' 'Remove'))
+              values:#(false true)
+              default:false
+              onCancel:false
+        ) ifFalse:[^ self].
+
+    ] ifFalse:[
+        "/ suppress confirmation when removing already inherited functionality
+        "/ (which is common during refactoring)
+        (self canUseRefactoringParser
+        and:[
+            methodsToRemove value 
+                conform:[:eachMethod |
+                    |nonNilMessageIfSame|
+                    
+                    "/ do removed methods redefine inherited methods, which do the same ?
+                    nonNilMessageIfSame := self checkIfSameSemanticsRedefinedWith:eachMethod inClass:(eachMethod mclass).
+                    nonNilMessageIfSame notNil
+                ]
+        ]) ifTrue:[
+            self showInfo:'Method same as inherited (no confirmation needed)'
+        ] ifFalse:[       
+            (self confirm:msg withCRs) ifFalse:[^ self].
+        ].
     ].
 
     classes := methods := nil.
@@ -59282,8 +59300,8 @@
 !
 
 checkIfSameSemanticsRedefinedWith:methodHere inClass:aClass
-    "check if the just accepted method redefines an inherited method, 
-     which does the same ?
+    "check if methodHere (the just accepted or tobe removed method) 
+     redefines an inherited method, which does the same?
      Returns an info-message string (if so) or nil if not.
     "
 
@@ -59296,7 +59314,6 @@
     sel := methodHere selector.
     methodHere getMclass == aClass ifFalse:[
         "/ has become obsolete
-        
         ^ nil
     ].