Code review request, JDK-8010815, some constructors issues in com.sun.jndi.toolkit
xuelei.fan at oracle.com
Mon May 13 15:06:34 UTC 2013
On 5/13/2013 10:52 PM, Wang Weijun wrote:
> I'll read them tomorrow.
OK. It's not a urgent fix.
> One question: are all of them designed to be call-by-value instead of shareable?
I'm not sure I understand the term "call-by-value" or "shareable". From
my understand, they are public classes, and copy-on-write or share-value
is the not right solution. Cloning mutable objects is more robust.
Otherwise, we need to check every caller to the method and the thread
stacks to make sure it is not abused. It's nightmare to maintain such code.
In the JNDI specification, we normally declare like "This constructor
will not modify environment or save a reference to it, but may save a
clone. Caller should not modify mutable keys and values in environment
after it has been passed to the constructor."
> On May 13, 2013, at 10:05 PM, Xuelei Fan <xuelei.fan at oracle.com> wrote:
>> There is some constructors issues about mutable objects in
>> webrev: http://cr.openjdk.java.net/~xuelei/8010815/webrev.00/
More information about the core-libs-dev