On Dec 2, 4:50 pm, Alexey <[email protected]> wrote:
> Hm... this is interesting.  Is java.util.Date mutable?  If one avoids
> deprecated method calls, it is not and I've been treating it as such
> for a couple years now.  The fact that Sun has not yanked those horrid
> deprecated API is another matter.  But we do know that using static
> analysis, the compiler can tell us if we're making any deprecated
> calls and we should also be able to tell if a third-party library is
> doing the same, even sans source.  So, what the harm in pretending
> java.util.Date is immutable as it should be?

Because j.u.Date is not properly immutable (final and final fields),
the Java Memory Model doesn't consider it immutable. Thus, sharing it
across threads may not work in the way you intended.

Stephen

--

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.


Reply via email to