Balzanka / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

how come an ImmutableMap has a non-final property? #1335

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
How come a supposedly immutable class ImmutableMap has a non-final property 
"entrySet"? I had an impression that immutable classes have only final 
properties.

Original issue reported on code.google.com by egor@technoparkcorp.com on 14 Mar 2013 at 2:53

GoogleCodeExporter commented 9 years ago
See 
http://stackoverflow.com/questions/11282219/why-string-class-is-immutable-even-t
hough-it-has-a-non-final-field-called-hash .  The reasoning is the same: it's a 
fiels  computed on demand that causes no harm if it's never computed at all or 
even multiple times.

Original comment by lowas...@google.com on 14 Mar 2013 at 3:51

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<issue id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:12

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:08