Skip to content

Instantly share code, notes, and snippets.

@brianmfear
Created July 14, 2018 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianmfear/f6f562ebe501a79cf122e82650ba59c6 to your computer and use it in GitHub Desktop.
Save brianmfear/f6f562ebe501a79cf122e82650ba59c6 to your computer and use it in GitHub Desktop.
System.debug Fixes Your HashCodes
USER_DEBUG [5]|DEBUG|null
USER_DEBUG [6]|DEBUG|{Account:{Name=Test, Id=0015000001wL7JRAA0}=42}
USER_DEBUG [7]|DEBUG|42
Map<Account, Integer> v = new Map<Account, Integer>();
Account a = new Account(Name='Test');
v.put(a, 42);
insert a;
System.debug(v.get(a));
System.debug(v);
System.debug(v.get(a));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment