Skip to content
This repository has been archived by the owner on Dec 20, 2022. It is now read-only.

Extension for sorting projects/environments #19

Merged
merged 1 commit into from
Sep 14, 2021
Merged

Conversation

d-gs
Copy link
Member

@d-gs d-gs commented Sep 13, 2021

Type of request

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Refactoring
  • Documentation or documentation changes

Related Issue(s)

Closes #18

Checklist:

  • All the commits are signed.
  • My code follows the code style of this project.
  • I agree with die CLA.
  • I have read the CONTRIBUTING docs.
  • I have added/updated necessary documentation (if appropriate).

@d-gs d-gs requested a review from davu-all September 13, 2021 14:10
* @throws GemException if more than one sorter is provided.
*/
public default IGemSorter getGemSorter() {
final Collection<IGemSorter> sorters = getGemServices(IGemSorter.class);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why a Collection and not a List (or Set)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API for getGemServices is already returning a collection; this change is not refactoring that API but just using it. I believe that it is because the implementation of the IServiceContainer is using Map::values to return the services. In any case, as the services are used mostly internally to provide hooks on GEM, it shouldn't be a problem and we can always change between collection implementations as required.

*/
@Override
public default String getName() {
return getId();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it correct that both method call getId?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the gem-sorter, the name and display name are irrelevant by now cause only one should be provided and it is not used out of the core plug-in. In case that we allow in the future several sorters and a way to switch between them this should be reverted and each of the sorters should provide its own implementation of this methods (thus, removing the default one on the interface).

Copy link
Contributor

@davu-all davu-all left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@d-gs d-gs merged commit fd517b5 into main Sep 14, 2021
@d-gs d-gs deleted the gem/main/d-gs/#18 branch September 14, 2021 11:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Extension for sorting projects/environments
2 participants