{"action":"created","issue":{"url":"https://api.github.com/repos/google/gson/issues/692","labels_url":"https://api.github.com/repos/google/gson/issues/692/labels{/name}","comments_url":"https://api.github.com/repos/google/gson/issues/692/comments","events_url":"https://api.github.com/repos/google/gson/issues/692/events","html_url":"https://github.com/google/gson/issues/692","id":104012472,"number":692,"title":"Double cannot be casted to Integer.","user":{"login":"adiantek","id":13407885,"avatar_url":"https://avatars.githubusercontent.com/u/13407885?v=3","gravatar_id":"","url":"https://api.github.com/users/adiantek","html_url":"https://github.com/adiantek","followers_url":"https://api.github.com/users/adiantek/followers","following_url":"https://api.github.com/users/adiantek/following{/other_user}","gists_url":"https://api.github.com/users/adiantek/gists{/gist_id}","starred_url":"https://api.github.com/users/adiantek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adiantek/subscriptions","organizations_url":"https://api.github.com/users/adiantek/orgs","repos_url":"https://api.github.com/users/adiantek/repos","events_url":"https://api.github.com/users/adiantek/events{/privacy}","received_events_url":"https://api.github.com/users/adiantek/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-08-31T08:50:10Z","updated_at":"2015-10-07T20:16:24Z","closed_at":"2015-10-07T20:14:23Z","body":"Long cannot be casted to Integer, Integer cannot be casted to Short, etc. Could you fix it in https://github.com/google/gson/blob/master/gson/src/main/java/com/google/gson/internal/bind/ObjectTypeAdapter.java? When serializing Map&lt;String, Object&gt; and deserializing, it throws Exception. I can't edit this, because I can't edit Spigot/Bukkit. If JSON save Integer, it should read Integer, not make Double unnecessarily.\r\n\r\nI maked it in issue, because I had to download sources GSON and edit this:.\r\n```\r\n    case NUMBER:\r\n      try {\r\n        return in.nextInt();\r\n      } catch(NumberFormatException exception) {\r\n      }\r\n      try {\r\n        return in.nextLong();\r\n      } catch(NumberFormatException exception) {\r\n      }\r\n      return in.nextDouble();\r\n```"},"comment":{"url":"https://api.github.com/repos/google/gson/issues/comments/146315622","html_url":"https://github.com/google/gson/issues/692#issuecomment-146315622","issue_url":"https://api.github.com/repos/google/gson/issues/692","id":146315622,"user":{"login":"adiantek","id":13407885,"avatar_url":"https://avatars.githubusercontent.com/u/13407885?v=3","gravatar_id":"","url":"https://api.github.com/users/adiantek","html_url":"https://github.com/adiantek","followers_url":"https://api.github.com/users/adiantek/followers","following_url":"https://api.github.com/users/adiantek/following{/other_user}","gists_url":"https://api.github.com/users/adiantek/gists{/gist_id}","starred_url":"https://api.github.com/users/adiantek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adiantek/subscriptions","organizations_url":"https://api.github.com/users/adiantek/orgs","repos_url":"https://api.github.com/users/adiantek/repos","events_url":"https://api.github.com/users/adiantek/events{/privacy}","received_events_url":"https://api.github.com/users/adiantek/received_events","type":"User","site_admin":false},"created_at":"2015-10-07T20:16:24Z","updated_at":"2015-10-07T20:16:24Z","body":"No. Some keys is String, some Double, some Float, some Map. Map is parsed\nby Bukkit for ItemStack, so I can't modify it.\n7 paź 2015 22:14 \"Jesse Wilson\" <notifications@github.com> napisał(a):\n\n> I think you want to decode it as a Map<String, Integer>. No action to\n> take here.\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/google/gson/issues/692#issuecomment-146315171>.\n>\n"}}