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

Compare function(s) should return -1 || 0 || 1 #2499

Conversation

@konopka
Copy link
Contributor

konopka commented Sep 8, 2019

Using Integer.MIN_VALUE is dangerous because of this property: Integer.MIN_VALUE * -1 == Integer.MIN_VALUE
If someone would try to reverse ordering using these compare function, it would result in surprising results

Using Integer.MIN_VALUE is dangerous because of this property: Integer.MIN_VALUE * -1 == Integer.MIN_VALUE
@MikielAgutu MikielAgutu merged commit 56d9ff6 into flyway:master Sep 12, 2019
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details
@MikielAgutu MikielAgutu added this to the Flyway 6.0.3 milestone Sep 12, 2019
@konopka konopka deleted the konopka:compare_fnc_should_return_minus_one_zero_or_one branch Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.