Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The highlighted container is called ImmutableHolder. When value is assigned in ImmutableHolder's constructor, it is a younger object that is referencing an older one (Hashtable<Integer, String> ht). This is a much better position to be in as far as the garbage collector is concerned. Note that a shall shallow copy was used in this case to preserve references to the older value.

...