On Wed, 19 Jan 2022 15:13:57 GMT, Rob McKenna <r...@openjdk.org> wrote:

>> src/java.naming/share/classes/com/sun/jndi/ldap/pool/PooledConnectionFactory.java
>>  line 54:
>> 
>>> 52:      * @param timeout the connection timeout
>>> 53:      */
>>> 54:     public abstract PooledConnection 
>>> createPooledConnection(PoolCallback pcb, long timeout)
>> 
>> why not use int timeout to be consistent with existing code ?
>> You've been required to "squash" it into an int in the factory ?
>
> IIRC this was a request from an earlier review. (long being the standard 
> throughout other new public apis) I'm happy with either, but int does avoid 
> the trouble of casting.

Well I guess the request was "why not use long everywhere to avoid casting to 
int" ;-)
But I'm happy with either too - as long as the place where you have a long (e.g 
obtained by substracting two nano times) and call a method that takes an int 
has the proper guards in place, and either assert/throws/floor or ceil if the 
assumptions are not met - provided that a comment explains why that particular 
alternative is selected.

-------------

PR: https://git.openjdk.java.net/jdk/pull/6568

Reply via email to