Well... I would say actually, that this is one of these cases where the 
Language has it wrong ...
... and now every developer dow that road has to pay the tax of knowing 
that "thee shall never use == for comparing objects for equality. And oh, 
by the way, Integer is an object too..."

laupäev, 10. märts 2012 23:23.28 UTC+2 kirjutas Ricky Clarkson:
>
> That's lovely, but doesn't help at all when you inherit code that does it 
> wrong. :)
>
> On Sat, Mar 10, 2012 at 6:20 PM, Jon Kiparsky <[email protected]>wrote:
>
>> "Also, knowing that Integers are objects isn't the problem, it's that == 
>> succeeds sometimes."
>>
>> That's for sure. I don't remember who said it, but this is a case of 
>> "syntactic sugar leads to cancer of the semicolon". I still say it's the 
>> programmers job to know the language, and part of that is knowing that 
>> object comparison with == is always wrong, even if the implementers have 
>> made a stupid decision to make it work for some arbitrary values. Really, 
>> it's not a particularly obscure or subtle fact about the language. 
>>  
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "The Java Posse" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to 
>> [email protected].
>> For more options, visit this group at 
>> http://groups.google.com/group/javaposse?hl=en.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/javaposse/-/tKKTvZCNqToJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en.

Reply via email to