Indexing access for Lists and Maps considered harmful?

Joshua Bloch jjb at google.com
Wed Jun 24 14:34:03 PDT 2009


Roel,
You're right.  What I said was an approximation to the truth.  My bad.  But
the point remains.

              Josh

On Wed, Jun 24, 2009 at 2:26 PM, Roel Spilker <r.spilker at gmail.com> wrote:

> The following code and compiler output suggest that the value of (a = expr) not expr is.
>
> class Foo {
> 	public static void main() {
> 		int x, expr;
> 		long a;
> 		x = (a = expr);
>
> 	}
> }
>
> Foo.java:5: possible loss of precision
> found   : long
> required: int
>                 x = (a = expr);
>                        ^
> 1 error
>
>
>
> 2009/6/24 Joshua Bloch <jjb at google.com>
>
>> I'm with Artur on this.  I think we're making a mountain out of a
>> molehill.
>>  The fact that  collection.put(value) is an implementation detail.  The
>> value of (a = expr) is and should remain expr.
>>                   Josh
>>
>



More information about the coin-dev mailing list