directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@gmail.com>
Subject UserLogRecord class : some questions
Date Tue, 25 Oct 2011 16:23:33 GMT
Hi,

I have a few questions about this class.

1) We keep an offset field, which is not used. Can we remove it, or is 
it intended to be activated later, and if so, in which purpose ?

2) The stored data aren't copied, which might put the code at risk, if 
any external code modifies the byte array (as we just store a ref on 
it). Should we copy this array, or at least warn the user about this 
potential issue ?

3) We also have a 'length' field, I'm wondering if it's a useful 
addition. We can either consider that the buffer contains all the bytes 
the use wants to store, or that it may be bigger than the data we want 
to store. I'm not sure it worth the extra effort, and it would propably 
be a simpler idea to have the buffer contain all the bytes, and nothing 
else.

4) Can't we use a constructor instead of an init() method ?

-- 
Regards,
Cordialement,
Emmanuel L├ęcharny
www.iktek.com


Mime
View raw message