Skip to content

Refined Generator.java to fix a flaky error#784

Merged
saudet merged 2 commits into
bytedeco:masterfrom
Ethan-Chin:fix-flaky
Oct 28, 2024
Merged

Refined Generator.java to fix a flaky error#784
saudet merged 2 commits into
bytedeco:masterfrom
Ethan-Chin:fix-flaky

Conversation

@Ethan-Chin
Copy link
Copy Markdown
Contributor

@Ethan-Chin Ethan-Chin commented Oct 24, 2024

Description

This PR fixes a flaky error in setUpClass() caused by inconsistent ordering of methods returned by two separate getDeclaredMethods() calls, as described in #727.

The previous solution in #727 sorted methods by name, which added inefficiency. Instead, this PR merges the two getDeclaredMethods() calls into one, ensuring a consistent method order without the need for sorting. (#727 (comment))

Key Changes

Modified the function static Method[] functionMethods to accept the methods array as a parameter, avoiding the redundant call to getDeclaredMethods() within the function that lead to inconsistency.

Related Issues

#727

@Ethan-Chin Ethan-Chin changed the title Refined Generator.java to a fix flaky error Refined Generator.java to fix a flaky error Oct 24, 2024
Comment thread src/main/java/org/bytedeco/javacpp/tools/Generator.java
@saudet
Copy link
Copy Markdown
Member

saudet commented Oct 28, 2024

Looks good, thanks for the fix!

@saudet saudet merged commit aeaad31 into bytedeco:master Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants