Open JanStolze opened 4 years ago
@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.
Pool is only throwing IllegalArgEx when somethings wrong without stating what,