{"action":"created","issue":{"url":"https://api.github.com/repos/FasterXML/jackson-dataformat-smile/issues/30","labels_url":"https://api.github.com/repos/FasterXML/jackson-dataformat-smile/issues/30/labels{/name}","comments_url":"https://api.github.com/repos/FasterXML/jackson-dataformat-smile/issues/30/comments","events_url":"https://api.github.com/repos/FasterXML/jackson-dataformat-smile/issues/30/events","html_url":"https://github.com/FasterXML/jackson-dataformat-smile/issues/30","id":121178256,"number":30,"title":"Problem writing \"empty\" Map key (String with length 0)","user":{"login":"cowtowncoder","id":55065,"avatar_url":"https://avatars.githubusercontent.com/u/55065?v=3","gravatar_id":"","url":"https://api.github.com/users/cowtowncoder","html_url":"https://github.com/cowtowncoder","followers_url":"https://api.github.com/users/cowtowncoder/followers","following_url":"https://api.github.com/users/cowtowncoder/following{/other_user}","gists_url":"https://api.github.com/users/cowtowncoder/gists{/gist_id}","starred_url":"https://api.github.com/users/cowtowncoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cowtowncoder/subscriptions","organizations_url":"https://api.github.com/users/cowtowncoder/orgs","repos_url":"https://api.github.com/users/cowtowncoder/repos","events_url":"https://api.github.com/users/cowtowncoder/events{/privacy}","received_events_url":"https://api.github.com/users/cowtowncoder/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/FasterXML/jackson-dataformat-smile/milestones/11","html_url":"https://github.com/FasterXML/jackson-dataformat-smile/milestones/2.6.5","labels_url":"https://api.github.com/repos/FasterXML/jackson-dataformat-smile/milestones/11/labels","id":1453043,"number":11,"title":"2.6.5","description":null,"creator":{"login":"cowtowncoder","id":55065,"avatar_url":"https://avatars.githubusercontent.com/u/55065?v=3","gravatar_id":"","url":"https://api.github.com/users/cowtowncoder","html_url":"https://github.com/cowtowncoder","followers_url":"https://api.github.com/users/cowtowncoder/followers","following_url":"https://api.github.com/users/cowtowncoder/following{/other_user}","gists_url":"https://api.github.com/users/cowtowncoder/gists{/gist_id}","starred_url":"https://api.github.com/users/cowtowncoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cowtowncoder/subscriptions","organizations_url":"https://api.github.com/users/cowtowncoder/orgs","repos_url":"https://api.github.com/users/cowtowncoder/repos","events_url":"https://api.github.com/users/cowtowncoder/events{/privacy}","received_events_url":"https://api.github.com/users/cowtowncoder/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":1,"state":"open","created_at":"2015-12-10T01:29:23Z","updated_at":"2015-12-10T01:29:23Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2015-12-09T07:20:50Z","updated_at":"2015-12-10T01:30:18Z","closed_at":"2015-12-10T01:29:07Z","body":"(problem reported by user via email)\r\n\r\n-----\r\n\r\nSmile reader doesn’t do well with a map with an empty String key.\r\n\r\n    Map map = new HashMap();\r\n    map.put(\"foo\", Collections.singletonMap(\"\", \"bar\"));\r\n    ObjectMapper smileMapper = new ObjectMapper(new SmileFactory());\r\n    byte[] bytes = smileMapper.writer().writeValueAsBytes(map);\r\n    smileMapper.reader().readTree(new ByteArrayInputStream(bytes));\r\n\r\nI get this exception:\r\nException in thread \"main\" com.fasterxml.jackson.core.JsonParseException: Invalid shared name reference 2; only got 1 names in buffer (invalid content)\r\n at [Source: java.io.ByteArrayInputStream@30c7da1e; line: -1, column: 12]\r\n\r\n-----\r\n"},"comment":{"url":"https://api.github.com/repos/FasterXML/jackson-dataformat-smile/issues/comments/163457763","html_url":"https://github.com/FasterXML/jackson-dataformat-smile/issues/30#issuecomment-163457763","issue_url":"https://api.github.com/repos/FasterXML/jackson-dataformat-smile/issues/30","id":163457763,"user":{"login":"cowtowncoder","id":55065,"avatar_url":"https://avatars.githubusercontent.com/u/55065?v=3","gravatar_id":"","url":"https://api.github.com/users/cowtowncoder","html_url":"https://github.com/cowtowncoder","followers_url":"https://api.github.com/users/cowtowncoder/followers","following_url":"https://api.github.com/users/cowtowncoder/following{/other_user}","gists_url":"https://api.github.com/users/cowtowncoder/gists{/gist_id}","starred_url":"https://api.github.com/users/cowtowncoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cowtowncoder/subscriptions","organizations_url":"https://api.github.com/users/cowtowncoder/orgs","repos_url":"https://api.github.com/users/cowtowncoder/repos","events_url":"https://api.github.com/users/cowtowncoder/events{/privacy}","received_events_url":"https://api.github.com/users/cowtowncoder/received_events","type":"User","site_admin":false},"created_at":"2015-12-10T01:30:18Z","updated_at":"2015-12-10T01:30:18Z","body":"So this is a regression from 2.5, due to rewrite of `nextFieldName()` method; it does not update state properly for the case of empty String (which has its dedicated token byte, separate from others).\r\n\r\nThe reason it had gone undetected is probably because:\r\n\r\n1. Use of empty String as JSON Object key is not very common AND\r\n2. This only caused problems with `nextFieldName()` but NOT with `nextToken()`.\r\n"}}