{"action":"created","issue":{"url":"https://api.github.com/repos/square/javapoet/issues/343","labels_url":"https://api.github.com/repos/square/javapoet/issues/343/labels{/name}","comments_url":"https://api.github.com/repos/square/javapoet/issues/343/comments","events_url":"https://api.github.com/repos/square/javapoet/issues/343/events","html_url":"https://github.com/square/javapoet/issues/343","id":111384039,"number":343,"title":"Enum with custom toString() breaks tests","user":{"login":"sormuras","id":2319838,"avatar_url":"https://avatars.githubusercontent.com/u/2319838?v=3","gravatar_id":"","url":"https://api.github.com/users/sormuras","html_url":"https://github.com/sormuras","followers_url":"https://api.github.com/users/sormuras/followers","following_url":"https://api.github.com/users/sormuras/following{/other_user}","gists_url":"https://api.github.com/users/sormuras/gists{/gist_id}","starred_url":"https://api.github.com/users/sormuras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sormuras/subscriptions","organizations_url":"https://api.github.com/users/sormuras/orgs","repos_url":"https://api.github.com/users/sormuras/repos","events_url":"https://api.github.com/users/sormuras/events{/privacy}","received_events_url":"https://api.github.com/users/sormuras/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-14T12:06:37Z","updated_at":"2015-10-14T13:40:45Z","closed_at":null,"body":"If you implement custom `toString()` in `AnnotationSpecTest` like\r\n```java\r\n  public enum Breakfast {\r\n    WAFFLES, PANCAKES;\r\n    public String toString() { return \"Lunch#\" + name(); }\r\n  }\r\n```\r\nsome tests fail due to the assumption of `toString()` returning always `name()`.\r\n\r\nI can fix the test code by using `name()` explictely or introduce an `$E` token for enum references. May even take the #317 issue into account.\r\n\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/square/javapoet/issues/comments/148052276","html_url":"https://github.com/square/javapoet/issues/343#issuecomment-148052276","issue_url":"https://api.github.com/repos/square/javapoet/issues/343","id":148052276,"user":{"login":"swankjesse","id":133019,"avatar_url":"https://avatars.githubusercontent.com/u/133019?v=3","gravatar_id":"","url":"https://api.github.com/users/swankjesse","html_url":"https://github.com/swankjesse","followers_url":"https://api.github.com/users/swankjesse/followers","following_url":"https://api.github.com/users/swankjesse/following{/other_user}","gists_url":"https://api.github.com/users/swankjesse/gists{/gist_id}","starred_url":"https://api.github.com/users/swankjesse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swankjesse/subscriptions","organizations_url":"https://api.github.com/users/swankjesse/orgs","repos_url":"https://api.github.com/users/swankjesse/repos","events_url":"https://api.github.com/users/swankjesse/events{/privacy}","received_events_url":"https://api.github.com/users/swankjesse/received_events","type":"User","site_admin":false},"created_at":"2015-10-14T13:40:45Z","updated_at":"2015-10-14T13:40:45Z","body":"https://github.com/square/javapoet/issues/317"}}