Maarten Bosteels wrote:

I agree that nobody will pass in hours or days, but IMHO  it improves
readability a lot:

connector.setConnectTimeout(250, TimeUnit.MILLISECONDS);
or
connector.setConnectTimeout(250);

Especially when one is changing the API from seconds to millis, we should
try to make
it unambiguous and it's inline with a lot of the java.util.concurrent API.
The problem with changing the method parameters semantic is that it does not align anymore with the underlying semantic of the select( timeout ) method :


     select

public abstract int *select*(long timeout)
                   throws IOException 
<http://java.sun.com/j2se/1.4.2/docs/api/java/io/IOException.html>

...

*Parameters:*
   |timeout| - If positive, block for up to timeout milliseconds, more
   or less...

The method should use milliseconds, no need to be explicit with that, IMHO. I agree with Julien on that.



--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org


Reply via email to