Skip to content

@Before and @After hook order comparison susceptible to underflow #985

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

Closed
auno opened this issue Apr 6, 2016 · 4 comments
Closed

@Before and @After hook order comparison susceptible to underflow #985

auno opened this issue Apr 6, 2016 · 4 comments

Comments

@auno
Copy link

auno commented Apr 6, 2016

If two @before hooks are created with a great enough difference (i.e. greater than 2^31), they may be executed in the incorrect order due to an arithmetic underflow in HookComparator.

@aslakhellesoy
Copy link
Contributor

Why is this a problem? How many hooks do you have? Feel free to submit a fix if this is a problem for you.

@aslakhellesoy
Copy link
Contributor

Just spotted the PR - thanks!

@auno
Copy link
Author

auno commented Apr 6, 2016

You don't need that many. My scenario is that I have one @before hook that I want to always run first, so to guard against future bugs I give it order = Integer.MIN_VALUE. This combined with another @before hook with the default order of 10000 triggers this.

@lock
Copy link

lock bot commented Oct 25, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants