• SeanDevine
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies

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.

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.