Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
Showing
12 changed files
with
36 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
Refactoring-Critics.package/RBSentNotImplementedRule.class/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
2 changes: 1 addition & 1 deletion
2
Refactoring-Critics.package/RBSentNotImplementedRule.class/definition.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
RBBlockLintRule subclass: #RBSentNotImplementedRule | ||
instanceVariableNames: '' | ||
instanceVariableNames: 'implementorsCache' | ||
classVariableNames: '' | ||
poolDictionaries: '' | ||
category: 'Refactoring-Critics-BlockRules' |
2 changes: 2 additions & 0 deletions
2
...ng-Critics.package/RBSentNotImplementedRule.class/instance/accessing/implementorsCache.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
implementorsCache | ||
^ implementorsCache ifNil: [ implementorsCache := (SystemNavigation default allMethods collect:#selector) asSet ] |
2 changes: 2 additions & 0 deletions
2
...-Critics.package/RBSentNotImplementedRule.class/instance/accessing/implementorsExists_.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
implementorsExists: aMessage | ||
^ self implementorsCache includes: aMessage |
2 changes: 2 additions & 0 deletions
2
...Critics.package/RBSentNotImplementedRule.class/instance/private/resetImplementorsCache.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
resetImplementorsCache | ||
implementorsCache := nil |
3 changes: 3 additions & 0 deletions
3
Refactoring-Critics.package/RBSentNotImplementedRule.class/instance/running/checkClass_.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
checkClass: aClass | ||
self resetImplementorsCache. | ||
super checkClass: aClass |
38 changes: 6 additions & 32 deletions
38
Refactoring-Critics.package/RBSentNotImplementedRule.class/instance/running/checkMethod_.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 0 additions & 12 deletions
12
ScriptLoader50.package/ScriptLoader.class/instance/pharo - updates/update50292.st
This file was deleted.
Oops, something went wrong.
9 changes: 9 additions & 0 deletions
9
ScriptLoader50.package/ScriptLoader.class/instance/pharo - updates/update50293.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
11 changes: 4 additions & 7 deletions
11
ScriptLoader50.package/ScriptLoader.class/instance/public/commentForCurrentUpdate.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' |