There's very little memory or performance overhead.  There's no deep copy.  The 
returned collection is a proxy to the underlying one, insuring immutability.

 Alexey





________________________________
From: "[email protected]" <[email protected]>
To: The Java Posse <[email protected]>
Sent: Tue, March 29, 2011 10:50:58 PM
Subject: [The Java Posse] Re: How to deal with CheckedExceptions

A general question to the Immutable fans out there.  In Kevin's
example he had:

> final List<Widget> widgets = ImmutableList.copyOf(widgetsBuilder)

Is the benefit of having an immutable version of that list, really
worth wasting the extra memory?  I don't think I can recall ever
seeing a bug where someone broke a program by accidentally adding
extra elements to a (temporary) List.

Just curious if people really think this is worthwhile here, or if it
was just a case of force-of-habit on Kevins part?

Paul

-- 
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 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