Generic nonViolators for ReConditions#18645
Merged
Ducasse merged 4 commits intopharo-project:Pharo14from Oct 9, 2025
Merged
Conversation
…ects (methods in ReNegation are temporary while we create a single hierarchy for conditions)
Comment on lines
1536
to
-1621
| @@ -1614,11 +1609,6 @@ SequenceableCollection >> middle [ | |||
| ^ self at: self size // 2 + 1 | |||
| ] | |||
|
|
|||
| { #category : 'comparing' } | |||
| SequenceableCollection >> min: aSelectorOrOneArgBlock [ | |||
| ^ (self collect: aSelectorOrOneArgBlock) min | |||
| ] | |||
|
|
|||
Member
There was a problem hiding this comment.
I'm assuming these got deleted by mistake
Comment on lines
+39
to
+44
| { #category : 'accessing' } | ||
| ReReifiedCondition >> subjects [ | ||
|
|
||
| self subclassResponsibility | ||
| ] | ||
|
|
Member
There was a problem hiding this comment.
What would be benefits of using accessor instead of instance variable?
Member
There was a problem hiding this comment.
@carolahp my thinking was that if we have them as instance variables, every conditions will in its constructor define them. And I feel like this hook can be avoided then. Just to explain on why I asked this.
This was referenced Oct 9, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a follow up from @balsa-sarenac comment in #PR18497... We should merge this one before the one in the link.
This PR is the first step to implement a generic method
nonViolatorsfor conditions.To do so I have introduced the accessor
subjectsin conditions. Subjects are candidates to be violators.Normally
subjectsshould be overriden only by abstract classes such asReClassesConditionorReMethodsCondition, because their subclasses handle different kinds of violators (i.e.: classes and methods). However there are exceptions (checkReClassesExistCondition). This,nonViolatorsare computed as the difference betweensubjectsandviolators.I added tests for all subclasses of
ReClassesCondition, where I check for nonViolators and also for the condition's error string.By overriding
subjects, negated conditions can also use the generic implementation ofnonViolators.More tests for complex conditions are required