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

Fix division by zero and check for isFinite() to fix comparator issue. #12697

Merged
merged 3 commits into from
Jul 5, 2024

Conversation

asvitkine
Copy link
Contributor

@asvitkine asvitkine commented Jul 5, 2024

The check was intended to verify whether #12693 was caused by non-finite values.
However, tests caught that this could actually trigger due to a division by zero.
I suspect this should therefore fix #12693

Notes to Reviewer

This would verify whether triplea-game#12693 is caused by non-finite values.
@asvitkine
Copy link
Contributor Author

Aha, looks like this precondition actually failed in testAiGameMovingConsumedUnitsToFactories! So that does show it's probably this that is responsible. Will need to debug.

@asvitkine asvitkine changed the title Add check for isFinite() to diagnose comparator issue. Fix division by zero and check for isFinite() to fix comparator issue. Jul 5, 2024
@asvitkine asvitkine merged commit 991e5f0 into triplea-game:master Jul 5, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2.6.14752: ProSortMoveOptionsUtils#sortUnitNeededOptionsThenAttack:118 - java.lang.IllegalArgumentException
1 participant