Skip to content

Commit

Permalink
50293
Browse files Browse the repository at this point in the history
16391 Switching hierarchy visually removes selection of a protocol
	https://pharo.fogbugz.com/f/cases/16391

14268 RBSentNotImplementedRule: checking for general senders is disabled
	https://pharo.fogbugz.com/f/cases/14268

http://files.pharo.org/image/50/50293.zip
  • Loading branch information
Jenkins Build Server authored and ci committed Aug 31, 2015
1 parent 57bb102 commit 26c3db6
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 59 deletions.
Expand Up @@ -11,8 +11,8 @@ showHierarchy: aBoolean
((aBoolean not and: [ self model showHierarchy ]) and: [ self selectedClass notNil ])
ifTrue:
[
(self selectedMethod isNotNil and: [ self selectedMethod methodClass ~= self selectedClass ])
ifTrue: [ self selectPackageFor: self selectedClass ] ].
(self selectedPackage includesClass: self selectedClass class)
ifFalse: [ self selectPackageFor: self selectedClass ] ].
"We check if we had a selectedMethod before toggling hierarchy button"
self model showHierarchy: aBoolean.
self updateClassView.
Expand Down
@@ -1 +1 @@
This smell arises when a message is sent by a method, but no class in the system implements such a message. This method sent will certainly cause a doesNotUnderstand: message when they are executed. Further this rule checks if messages sent to self or super exist in the hierarchy, since these can be statically typed.
This smell arises when a message is sent by a method, but no class in the system implements such a message. This method sent will certainly cause a doesNotUnderstand: message when they are executed.
@@ -1,5 +1,5 @@
RBBlockLintRule subclass: #RBSentNotImplementedRule
instanceVariableNames: ''
instanceVariableNames: 'implementorsCache'
classVariableNames: ''
poolDictionaries: ''
category: 'Refactoring-Critics-BlockRules'
@@ -0,0 +1,2 @@
implementorsCache
^ implementorsCache ifNil: [ implementorsCache := (SystemNavigation default allMethods collect:#selector) asSet ]
@@ -0,0 +1,2 @@
implementorsExists: aMessage
^ self implementorsCache includes: aMessage
@@ -0,0 +1,2 @@
resetImplementorsCache
implementorsCache := nil
@@ -0,0 +1,3 @@
checkClass: aClass
self resetImplementorsCache.
super checkClass: aClass
@@ -1,32 +1,6 @@
checkMethod: aMethod
| message |
self flag: #TODO. "This needs to be fixed"

"The logic is wrong: #messages contains self and super messages, too.
For now this rule just checks for not existing super and self sends,
as checking non-existing senders is too slow.
What needs to be done is
1. split the rule in two: super/self and unsent in general (but disable that as it is too slow)
2. speed up by caching
3. enable general unsent checking
"

message := #() "aMethod messages"
"here we need to take the environemnt into account that the code critique is run on. Maybe environemnts need to cache implemnted symbols"
detect: [ :each | ("SystemNavigation default implementorsExistOf: each"true ) not ]
ifNone:
[aMethod methodClass isTrait ifFalse: [
aMethod superMessages
detect:
[ :each |
aMethod methodClass superclass isNil or: [ (aMethod methodClass superclass canUnderstand: each) not ] ]
ifNone:
[ aMethod selfMessages
detect: [ :each | (aMethod methodClass allSelectors includes: each) not ]
ifNone: [ nil ] ] ] ] .
message notNil ifTrue: [
result
addSearchString: message;
addMethod: aMethod ]
checkMethod: aMethod
| messages |
messages := aMethod messages reject: [ :each | self implementorsExists: each ].
messages do: [ :m | result
addSearchString: m;
addMethod: aMethod ]
@@ -1,4 +1,4 @@
script50292
script50293

^ 'AST-Core-TheIntegrator.363.mcz
AST-Tests-Core-TheIntegrator.77.mcz
Expand Down Expand Up @@ -172,7 +172,7 @@ Morphic-Examples-TheIntegrator.46.mcz
Morphic-Widgets-Basic-TheIntegrator.57.mcz
Morphic-Widgets-ColorPicker-StephaneDucasse.17.mcz
Morphic-Widgets-Extra-TheIntegrator.24.mcz
Morphic-Widgets-FastTable-EstebanLorenzano.43.mcz
Morphic-Widgets-FastTable-NicolaiHess.44.mcz
Morphic-Widgets-List-TheIntegrator.21.mcz
Morphic-Widgets-NewList-TheIntegrator.7.mcz
Morphic-Widgets-Pluggable-TheIntegrator.59.mcz
Expand All @@ -197,7 +197,7 @@ NativeBoost-Pools-CamilloBruni.13.mcz
NativeBoost-Tests-TheIntegrator.94.mcz
NativeBoost-Unix-TheIntegrator.19.mcz
NativeBoost-Win32-TheIntegrator.59.mcz
Nautilus-TheIntegrator.1070.mcz
Nautilus-TheIntegrator.1073.mcz
Nautilus-GroupManager-TheIntegrator.13.mcz
Nautilus-GroupManagerUI-TheIntegrator.20.mcz
Nautilus-Tests-TheIntegrator.23.mcz
Expand Down Expand Up @@ -234,7 +234,7 @@ RPackage-Tests-TheIntegrator.175.mcz
RecentSubmissions-TheIntegrator.235.mcz
Refactoring-Changes-TheIntegrator.67.mcz
Refactoring-Core-TheIntegrator.285.mcz
Refactoring-Critics-TheIntegrator.213.mcz
Refactoring-Critics-TheIntegrator.214.mcz
Refactoring-Environment-TheIntegrator.61.mcz
Refactoring-Tests-Changes-MarcusDenker.38.mcz
Refactoring-Tests-Core-TheIntegrator.129.mcz
Expand Down

This file was deleted.

@@ -0,0 +1,9 @@
update50293
"self new update50293"
self withUpdateLog: '16391 Switching hierarchy visually removes selection of a protocol
https://pharo.fogbugz.com/f/cases/16391
14268 RBSentNotImplementedRule: checking for general senders is disabled
https://pharo.fogbugz.com/f/cases/14268'.
self loadTogether: self script50293 merge: false.
self flushCaches.
@@ -1,9 +1,6 @@
commentForCurrentUpdate
^ '15941 Color>>printHtmlString and Color>>asHTMLColor are similar
https://pharo.fogbugz.com/f/cases/15941
^ '16391 Switching hierarchy visually removes selection of a protocol
https://pharo.fogbugz.com/f/cases/16391
16416 spec predebug notification window should use text without code highlighting
https://pharo.fogbugz.com/f/cases/16416
16267 Fasttable isnt visible in athens (in bloc)
https://pharo.fogbugz.com/f/cases/16267'
14268 RBSentNotImplementedRule: checking for general senders is disabled
https://pharo.fogbugz.com/f/cases/14268'

0 comments on commit 26c3db6

Please sign in to comment.