Re: JavaMemoryModel: final isn't used much in the JDK, even when it could

From: Joshua Bloch (jbloch@eng.sun.com)
Date: Wed Jul 21 1999 - 16:47:39 EDT


Bill,

  I'm skeptical of any automated procedure to identify immutable classes. I
believe (as I mentioned before) that we haven't formally defined what
constitutes an immutable class. Further, I do not know whether it's
feasible to do so.

   A related point worth mentioning is that any immutable class that isn't
final (or whose methods aren't final) is inherently insecure. BigInteger
and BigDecimal come to mind. (It was simply an error on my part that all of
the methods in these classes weren't final.) While we could "protect" such
classes, it seems less compelling than protecting "final immutable" classes
like String.

                  Josh

-------------------------------
This is the JavaMemoryModel mailing list, managed by Majordomo 1.94.4.

To send a message to the list, email JavaMemoryModel@cs.umd.edu
To send a request to the list, email majordomo@cs.umd.edu and put
your request in the body of the message (use the request "help" for help).
For more information, visit http://www.cs.umd.edu/~pugh/java/memoryModel



This archive was generated by hypermail 2b29 : Thu Oct 13 2005 - 07:00:17 EDT