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

Add message indicating what is wrong with the supplied argument(s) #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

JanStolze
Copy link

@JanStolze JanStolze commented Apr 10, 2020

Pool is only throwing IllegalArgEx when somethings wrong without stating what,

@simeonmalchev simeonmalchev self-assigned this Apr 14, 2020
@simeonmalchev
Copy link
Member

@JanStolze, I'm happy to have forbidIllegalArgument with additional message parameter which indicates what exactly is wrong but it has to be evaluated slightly differently. First, the existing forbidIllegalArgument method that is without message parameter needs to remain as is as it is part of the public API of vibur-object-pool, and second, the supplied new message parameter to the new forbidIllegalArgument method must be a static string. Otherwise, the message parameter will be always evaluated on each call to forbidIllegalArgument which is not ideal. Alternatively, this new parameter could be a Supplier of message if this was a Java 8 source, but this project is not Java 8 yet, so we need to stick to sending short static string as an additional parameter.

I'll implement shortly the needed new method myself. Note that I'm not planning to push a new release of vibur-object-pool very soon, if you need a version with the new forbidIllegalArgument method just take the latest source code version from the mater branch and build it on your local.

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