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

[CALCITE-6698] Add Javadoc to PartiallyOrderedSet#getNonChildren and getNonParents to clarify their behavior #4054

Closed
wants to merge 2 commits into from

Conversation

zabetak
Copy link
Contributor

@zabetak zabetak commented Nov 18, 2024

  1. Add Javadoc to clarify the results of each method and avoid potential misinterpretation of their name.
  2. Add some test cases with explicit tests for the aforementioned methods.

…hildren and getNonParents

1. Align the behavior of getNonChildren/getNonParents with:
i) the class documentation;
ii) the behavior of getParents/getChildren methods.
2. Add explicit Javadoc to clarify the results of its method.
3. Update and add test cases with expected results.
PartiallyOrderedSet<Integer> poset =
new PartiallyOrderedSet<>((i, j) -> i >= j, Arrays.asList(20, 30, 40));
printValidate(poset);
System.out.println(poset.getChildren(20));
Copy link
Member

Choose a reason for hiding this comment

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

This has slipped through the cracks I guess

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for catching this. I removed those in the last commit.

@julianhyde
Copy link
Contributor

-1 There is no bug here. You are just mistaken what 'non-parents' means.

@zabetak zabetak added the discussion-in-jira There's open discussion in JIRA to be resolved before proceeding with the PR label Nov 18, 2024
@zabetak zabetak changed the title [CALCITE-6698] Wrong (swapped) results in PartiallyOrderedSet#getNonChildren and getNonParents [CALCITE-6698] Add Javadoc to PartiallyOrderedSet#getNonChildren and getNonParents to clarify their behavior Nov 19, 2024
@zabetak
Copy link
Contributor Author

zabetak commented Nov 19, 2024

As discussed, under the ticket there is no reason to change the behavior of the methods. The scope of the PR changed to simply clarify the current behavior by adding Javadoc comments so I updated the summary and description.

Copy link

sonarcloud bot commented Nov 19, 2024

@zabetak zabetak closed this in b635174 Nov 21, 2024
@zabetak zabetak deleted the CALCITE-6698 branch November 21, 2024 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion-in-jira There's open discussion in JIRA to be resolved before proceeding with the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants