Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean the way to get the selectors in a protocol #13759

Conversation

jecisc
Copy link
Member

@jecisc jecisc commented May 17, 2023

This PR add multiple cleanings in the way we can get the selectors in a protocol from a class.

  • #selectorsInCategory: was the same than #selectorsInProtocol: so I deprecated it
  • #selectorsInProtocol: was removing duplicates but it should never be able to have a duplicates so I removed this extra step that was done with two cast of a collection
  • #selectorsInProtocol: was sorting the selectors but no sender was caring about the order. This method is not the place to do sorting. So I removed the sort
  • I inlined #methodSelectorsInProtocol: from ClassOrganization to ClassDescription>>#selectorsInProtocol:
  • I added missing tests on #selectorsInProtocol: with one tests showing that it was not able to deal with real protocols
  • I updated #selectorsInProtocol: to be able to deal with real protocols and not just a protocol name
  • I replaced some (class organization protocolNamed: x) methodSelectors to call class selectorsInProtocol: x which is more readable

This cleans a lot of code, reduces some API while making the existing API more robust! This will also help to clean other parts of the system more easily afterward :)

@MarcusDenker MarcusDenker merged commit 35a7e64 into pharo-project:Pharo12 May 18, 2023
1 of 2 checks passed
@jecisc jecisc deleted the inline-and-improve-methodSelectorsInProtocol branch May 19, 2023 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants