Indexing access for Lists and Maps considered harmful?

Bruce Chapman brucechapman at paradise.net.nz
Wed Jun 24 02:34:09 PDT 2009


Ted Neward wrote:
> Under what situation would a = b = c (where b is boxed(c) ) yield different
> results? Aside from concurrency scenarios, my understanding is that boxed or
> not, the value is still "c", thus a would hold the value "c", boxed or
> otherwise.
>   
Digressing from a multiple assignment (its just one example of using the 
value of an assigment expression), but still using an assignment 
expression as an expression then given

list<Integer> list;

void doSomething(int v) { .... }

void doSomething(Integer v) { ...}

which method is invoked by the following?

    doSomething(list[0]=5)

If the implementation is consistent with the existing JLS, then it MUST 
be the second method.

Bruce

>   




More information about the coin-dev mailing list