{"action":"opened","issue":{"url":"https://api.github.com/repos/snielsson/XmlRpcLight/issues/1","labels_url":"https://api.github.com/repos/snielsson/XmlRpcLight/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/snielsson/XmlRpcLight/issues/1/comments","events_url":"https://api.github.com/repos/snielsson/XmlRpcLight/issues/1/events","html_url":"https://github.com/snielsson/XmlRpcLight/issues/1","id":117205740,"number":1,"title":"XmlRpcStruct | Possible duplicate key in private ArrayList","user":{"login":"titobrasolin","id":1615561,"avatar_url":"https://avatars.githubusercontent.com/u/1615561?v=3","gravatar_id":"","url":"https://api.github.com/users/titobrasolin","html_url":"https://github.com/titobrasolin","followers_url":"https://api.github.com/users/titobrasolin/followers","following_url":"https://api.github.com/users/titobrasolin/following{/other_user}","gists_url":"https://api.github.com/users/titobrasolin/gists{/gist_id}","starred_url":"https://api.github.com/users/titobrasolin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/titobrasolin/subscriptions","organizations_url":"https://api.github.com/users/titobrasolin/orgs","repos_url":"https://api.github.com/users/titobrasolin/repos","events_url":"https://api.github.com/users/titobrasolin/events{/privacy}","received_events_url":"https://api.github.com/users/titobrasolin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-11-16T20:00:25Z","updated_at":"2015-11-16T20:00:25Z","closed_at":null,"body":"In my opinion there is a problem in this override: https://github.com/snielsson/XmlRpcLight/blob/master/XmlRpcLight/DataTypes/XmlRpcStruct.cs#L21\r\n\r\nSetting an item always adds a new _key e.g.\r\n```csharp\r\n    var x = new XmlRpcStruct ();\r\n    x [\"title\"] = \"Hi!\";\r\n    x [\"title\"] = \"Hi again!\";\r\n    x [\"title\"] = \"Hi (third time)!\";\r\n```\r\nYou will end up with a single \"title\" in the base class but three items in the private _keys.\r\nThis can possibly lead to serialization problems.\r\n\r\nPossible solution: check if the key already exists e.g. after line 31\r\n```csharp\r\n    var indexOfKey = _keys.IndexOf (key);\r\n    if (indexOfKey < 0) {\r\n        _keys.Add (key);\r\n        _values.Add (value);\r\n    } else {\r\n        _values [indexOfKey] = value;\r\n    }\r\n```"}}