{"action":"created","issue":{"url":"https://api.github.com/repos/protostuff/protostuff/issues/147","labels_url":"https://api.github.com/repos/protostuff/protostuff/issues/147/labels{/name}","comments_url":"https://api.github.com/repos/protostuff/protostuff/issues/147/comments","events_url":"https://api.github.com/repos/protostuff/protostuff/issues/147/events","html_url":"https://github.com/protostuff/protostuff/issues/147","id":114507552,"number":147,"title":"cannot serialize Locale","user":{"login":"dicolar","id":486693,"avatar_url":"https://avatars.githubusercontent.com/u/486693?v=3","gravatar_id":"","url":"https://api.github.com/users/dicolar","html_url":"https://github.com/dicolar","followers_url":"https://api.github.com/users/dicolar/followers","following_url":"https://api.github.com/users/dicolar/following{/other_user}","gists_url":"https://api.github.com/users/dicolar/gists{/gist_id}","starred_url":"https://api.github.com/users/dicolar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dicolar/subscriptions","organizations_url":"https://api.github.com/users/dicolar/orgs","repos_url":"https://api.github.com/users/dicolar/repos","events_url":"https://api.github.com/users/dicolar/events{/privacy}","received_events_url":"https://api.github.com/users/dicolar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/protostuff/protostuff/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-02T01:31:18Z","updated_at":"2015-11-03T14:20:35Z","closed_at":null,"body":"seems that java.util.Locale cannot be serialized correctly,any idea with it?\r\nhere's my code:\r\n\r\n```java\r\nSchema<Locale> schema = RuntimeSchema.getSchema(Locale.class);\r\n\r\nLocale locale = Locale.getDefault();\r\nLinkedBuffer buffer = LinkedBuffer.allocate(4096);\r\nbyte[] bytes = ProtostuffIOUtil.toByteArray(locale, schema, buffer);\r\nSystem.out.println(bytes.length);//it's 0\r\nSystem.out.println(new String(bytes));// blank string\r\n\r\nLocale l = new Locale(\"\", \"aa\");\r\nProtostuffIOUtil.mergeFrom(bytes, l, schema);\r\n\r\nSystem.out.println(l);//nothing changed\r\n```"},"comment":{"url":"https://api.github.com/repos/protostuff/protostuff/issues/comments/153369176","html_url":"https://github.com/protostuff/protostuff/issues/147#issuecomment-153369176","issue_url":"https://api.github.com/repos/protostuff/protostuff/issues/147","id":153369176,"user":{"login":"dicolar","id":486693,"avatar_url":"https://avatars.githubusercontent.com/u/486693?v=3","gravatar_id":"","url":"https://api.github.com/users/dicolar","html_url":"https://github.com/dicolar","followers_url":"https://api.github.com/users/dicolar/followers","following_url":"https://api.github.com/users/dicolar/following{/other_user}","gists_url":"https://api.github.com/users/dicolar/gists{/gist_id}","starred_url":"https://api.github.com/users/dicolar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dicolar/subscriptions","organizations_url":"https://api.github.com/users/dicolar/orgs","repos_url":"https://api.github.com/users/dicolar/repos","events_url":"https://api.github.com/users/dicolar/events{/privacy}","received_events_url":"https://api.github.com/users/dicolar/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T14:20:35Z","updated_at":"2015-11-03T14:20:35Z","body":"hi again,i read the code&found a weird but useful way 2 build up my code,like this:\r\n\r\n```\r\nstatic {\r\n\tDefaultIdStrategy strategy = (DefaultIdStrategy) RuntimeEnv.ID_STRATEGY;\r\n\tstrategy.registerDelegate(LOCALE_DELEGATE);\r\n\tSCHEMA = RuntimeSchema.getSchema(NetMessage.class);\r\n}\r\n```\r\n\r\nbecause when i use `IncrementalIdStrategy` 2 build schema each time,i found that i cannot de-serialize the bytes which i stored last time.i think `IncrementalIdStrategy` has some internal random factors that is different when i use it each time. "}}