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 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
@MikielAgutu MikielAgutu added this to the Flyway 6.0.3 milestone Sep 12, 2019
@konopka konopka deleted the compare_fnc_should_return_minus_one_zero_or_one branch Sep 12, 2019
dohrayme pushed a commit to dohrayme/flyway that referenced this issue Feb 3, 2020
…_minus_one_zero_or_one

Compare function(s) should return -1 || 0 || 1
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.

None yet

2 participants