commons-dev mailing list archives

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

> > [...]
> 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.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message