Some types of Collections, such as instances of Dictionary, Set, and their respective subclasses, use a hashing mechanism so that their elements can be accessed efficiently. Objects loaded into a different image or into the same image from which they were unloaded will retain their hash values. Thus, hashed collections containing these objects need not be rehashed when they are loaded. However, if an object is mutated or replaced or its hashing implementation has changed, then the hashed collections containing these objects must be rehashed to ensure their correct behavior. The ObjectLoader assumes that this rehashing process is part of your application because not all applications require these objects to be rehashed each time they are loaded. The next example shows how you can rehash all instances of Set each time an object is loaded.
|