{"action":"opened","issue":{"url":"https://api.github.com/repos/immutables/immutables/issues/758","repository_url":"https://api.github.com/repos/immutables/immutables","labels_url":"https://api.github.com/repos/immutables/immutables/issues/758/labels{/name}","comments_url":"https://api.github.com/repos/immutables/immutables/issues/758/comments","events_url":"https://api.github.com/repos/immutables/immutables/issues/758/events","html_url":"https://github.com/immutables/immutables/issues/758","id":306562148,"number":758,"title":"`toString` of byte arrays should be represented as base64/hex","user":{"login":"felixdesouza","id":4521225,"avatar_url":"https://avatars3.githubusercontent.com/u/4521225?v=4","gravatar_id":"","url":"https://api.github.com/users/felixdesouza","html_url":"https://github.com/felixdesouza","followers_url":"https://api.github.com/users/felixdesouza/followers","following_url":"https://api.github.com/users/felixdesouza/following{/other_user}","gists_url":"https://api.github.com/users/felixdesouza/gists{/gist_id}","starred_url":"https://api.github.com/users/felixdesouza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felixdesouza/subscriptions","organizations_url":"https://api.github.com/users/felixdesouza/orgs","repos_url":"https://api.github.com/users/felixdesouza/repos","events_url":"https://api.github.com/users/felixdesouza/events{/privacy}","received_events_url":"https://api.github.com/users/felixdesouza/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-19T17:36:43Z","updated_at":"2018-03-19T17:36:43Z","closed_at":null,"author_association":"NONE","body":"If I have an example like this: \r\n\r\n```\r\n@Value.Immutable\r\n@JsonDeserialize(as = ImmutableExample.class)\r\ninterface Example {\r\n  byte[] contents();\r\n}\r\n```\r\n\r\nIt works pretty nicely with jackson since it automatically base64 encodes/decodes and we don't have to handle that logic ourselves. However, invoking `toString()` (commonly via logging) yields a quite unfavourable representation of said bytes.\r\n\r\ne.g.:\r\n```\r\nExample{contents=[10, 37, 10, 31, 10, 9, 109, 117, 108, 116, 105, 112, 97, 115, 115, 18, 18, 112, 114, 101,\r\n 114, 101, 103, 105, 115, 116, 101, 114, 101, 100, 85, 115, 101, 114, 115, 18, 2, 10, 0, 10, 33, 10, 27, 10, 9,\r\n 109, 117, 108, 116, 105, 112, 97, 115, 115, 18, 14, 114, 101, 97, 108, 109, 73, 110, 100, 101, 120, 95, 105,\r\n 100, 120, 18, 2, 10, 0, 10, 54, 10, 48, 10, 9, 109, 117, 108, 116, 105, 112, 97, 115, 115, 18, 35, 112, 114,\r\n 101, 114, 101, 103, 105, 115, 116, 101, 114, 101, 100, 85, 115, 101, 114, 115, 66, 121, 80, 114, 105, 110,\r\n 99, 105, 112, 97, 108, 73, 100, 95, 105, 100, 120, 18, 2, 10, 0, 10, 31, 10, 25, 10, 9, 109, 117, 108, 116,\r\n 105, 112, 97, 115, 115, 18, 12, 97, 112, 105, 77, 105, 103, 114, 97, 116, 105, 111, 110, 18, 2, 10, 0, 10, 33,\r\n 10, 27, 10, 9, 109, 117, 108, 116, 105, 112, 97, 115, 115, 18, 14, 112, 114, 101, 112, 97, 114, 101, 100, 69,\r\n 118, 101, 110, 116, 115, 18, 2, 10, 0, 10, 44, 10, 38, 10, 9, 109, 117, 108, 116, 105, 112, 97, 115, 115, 18,\r\n 25, 117, 115, 101, 114, 110, 97, 109, 101, 83, 104, 97, 82, 101, 97, 108, 109, 73, 110, 100, 101, 120, 95,\r\n 105, 100, 120, 18, 2, 10, 0, 10, 46, 10, 40, 10, 9, 109, 117, 108, 116, 105, 112, 97, 115, 115, 18, 27, 105,\r\n 110, 100, 101, 120, 67, 111, 110, 115, 117, 109, 101, 114, 83, 101, 113, 117, 101, 110, 99, 101, 80, 111, 105,\r\n 110, 116, 115, 18, 2, 10, 0, 10, 40, 10, 34, 10, 9, 109, 117, 108, 116, 105, 112, 97, ...]}\r\n```\r\n\r\nI would propose having the default be base64, as that is slightly more legible than a large array of numbers. I believe this is also safe to do by default as it seems unlikely/unreasonable/strange for tests to assert the contents of a `toString()` especially from a generated class.\r\n\r\nIf people do desire the old behaviour, it could be opened up via a `@Value.Style` annotation? Only downside is that it would apply to all properties within the class, unless you can apply `@Value.Style` on individual properties?\r\n\r\nThoughts? Ideas?"}}
{"actor":{"display_login":"felixdesouza"}}