commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilles Sadowski <gil...@harfang.homelinux.org>
Subject Re: [math] Checking preconditions on package private functions
Date Tue, 27 Nov 2012 22:43:20 GMT
Hello.

> > [...]
> Actually, I would like the methods to be tested, so they cannot be
> private. That's the reason why I made them package private.

You can indirectly test them by passing appropriate arguments to the public
methods that use them. Please do not select a visibility scope just for the
sake of unit testing.

> If we remove
> the checks (which I really have mixed feelings about) I ropose to fully
> state in the javadoc that the preconditions are *not* checked, and that
> it's the responsibility of the client to check them. But in fact, may be
> it's too much risky work. It's probably better to leave the checks in
> place.

Leave them then. They are not necessary but if efficiency is not going to
suffer noticeably, it certainly does not hurt to keep them.

Regards,
Gilles

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@commons.apache.org
For additional commands, e-mail: dev-help@commons.apache.org


Mime
View raw message