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

DaoAuthenticationProviderTests#avg function doesn't return fraction #10426

Merged
merged 1 commit into from
Oct 28, 2021

Conversation

Emkas
Copy link
Contributor

@Emkas Emkas commented Oct 21, 2021

DaoAuthenticationProviderTests#avg function returns double, but because of lack of a cast to double at one point in return statement it will always return number without fraction (long casted to double). This works in tests now, but it may be broken in the future.

I've change manual counting of avg for a steam and avg from Java standard libs.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 21, 2021
@eleftherias eleftherias self-assigned this Oct 21, 2021
@eleftherias eleftherias added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 21, 2021
@jzheaux
Copy link
Contributor

jzheaux commented Oct 27, 2021

Thanks for the PR, @Emkas!

Will you please update your commit message to reflect the new code state instead of the old? Maybe the title could be "DaoAuthenticationProviderTests#avg Returns Fraction".

@Emkas
Copy link
Contributor Author

Emkas commented Oct 28, 2021

Will you please update your commit message to reflect the new code state instead of the old?

Do you mean commit, not "commit message"? If not, I don't know what you want me to do. As far as I can see nothing change in this class since my first PR, so I just did rebase.

Maybe the title could be "DaoAuthenticationProviderTests#avg Returns Fraction".

Sure. I used small letters. Tell me if it's OK.

@jzheaux jzheaux merged commit e0821f2 into spring-projects:main Oct 28, 2021
@jzheaux jzheaux added in: core An issue in spring-security-core status: duplicate A duplicate of another issue and removed status: duplicate A duplicate of another issue labels Oct 28, 2021
@jzheaux jzheaux added this to the 5.6.0 milestone Oct 28, 2021
@jzheaux
Copy link
Contributor

jzheaux commented Oct 28, 2021

Thanks, @Emkas! Both sentences referred to the same thing. Thanks for updating the commit message.

@Emkas Emkas deleted the avg-fix branch October 28, 2021 15:39
@Emkas
Copy link
Contributor Author

Emkas commented Oct 28, 2021

Both sentences referred to the same thing.

Oh, OK. I didn't get it, I thought that there were some changes in DaoAuthenticationProviderTests and the code will break. Sorry :-)

@jzheaux
Copy link
Contributor

jzheaux commented Oct 28, 2021

No worries. Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core An issue in spring-security-core type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants