You need to sign in to do that
Don't have an account?
SeanDevine
Bug in Set of Concrete SObjects
I just hit a strange Apex bug this morning. I have a set of concrete sobjects. If you debug the set, there is only one item. If you debug the set.size() it says that there are two items. When I .addAll() the set to a list, the list has two identical Sobjects. To solve the problem, I need to use a map of the concrete sobjects and then add the .values() of the map to the list.
My guess is that there is a bug in the code does the SObject comparison within the set class.
Can you share your code .
--yvk
I would, but I don't see a practical way to. The issue is happening in a particular context in our app, and I haven't taken the time to write an example that would work in Anonymous Apex.
Love to see the code here