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] Issues 650, 675, 676
Date Mon, 10 Oct 2011 11:20:44 GMT
On Mon, Oct 10, 2011 at 03:26:01AM +0100, sebb wrote:
> On 9 October 2011 18:16, Gilles Sadowski <gilles@harfang.homelinux.org> wrote:
> 
> >> This is slightly different from the original suggestion; IIRC that did
> >> not include using getters.
> >
> > I put getters because you asked them. But, indeed, there is no difference
> > with direct accessing the arrays since the getters do not return a copy: it
> > is possible to modify the "original" array.
> 
> Those are *not* the getters I was referring to.
> 
> I intended the getter to return an array element, not the array, so as
> to protect the array contents.

Don't you think that it will make the access much slower?

> As you point out, there's absolutely no point having the getter otherwise.
> 
> The current implementation is not particularly secure against
> malicious or accidental tampering.

The only tampering could come from a bug in classes in the same package. OR
do I miss something?

> That is why I left the arrays in the same source file originally, as
> it allows the arrays to be automatically protected, without needing a
> getter.

Yes I understand the argument. Mine is that this data should not be stored
there.


Gilles

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


Mime
View raw message