Last active
December 18, 2015 08:19
-
-
Save mjgallag/5752966 to your computer and use it in GitHub Desktop.
Salesforce Summer '13 (28.0) Regression - Map<Id, Id> Comparison Bug (Known Issue - https://success.salesforce.com/issues_view?id=a1p30000000SytdAAC)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final Map <Id, Id> identicalMapIdA = new Map<Id, Id>{'001E000000etpxTIAQ' => '001E000000etpxSIAQ'}; | |
| final Map <Id, Id> identicalMapIdB = new Map<Id, Id>{'001E000000etpxTIAQ' => '001E000000etpxSIAQ'}; | |
| final Map<String, String> identicalMapStringA = new Map<String, String>{}; | |
| final Map<String, String> identicalMapStringB = new Map<String, String>{}; | |
| for (Id keyId : identicalMapIdA.keySet()) identicalMapStringA.put(keyId, identicalMapIdA.get(keyId)); | |
| for (Id keyId : identicalMapIdB.keySet()) identicalMapStringB.put(keyId, identicalMapIdB.get(keyId)); | |
| // Workaround is to put Map<Id, Id> into Map<String, String> | |
| System.assertEquals(identicalMapStringA, identicalMapStringB); | |
| // Comparision of two identical Map<Id, Id> fails in Summer '13 (28.0), was passing in Spring '13 (27.0) | |
| System.assertEquals(identicalMapIdA, identicalMapIdB); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Known Issue - System.assertEquals() fails for identical Map<ID,ID> in summer 13 - https://success.salesforce.com/issues_view?id=a1p30000000SytdAAC