{"action":"created","issue":{"url":"https://api.github.com/repos/CodeNarc/CodeNarc/issues/165","repository_url":"https://api.github.com/repos/CodeNarc/CodeNarc","labels_url":"https://api.github.com/repos/CodeNarc/CodeNarc/issues/165/labels{/name}","comments_url":"https://api.github.com/repos/CodeNarc/CodeNarc/issues/165/comments","events_url":"https://api.github.com/repos/CodeNarc/CodeNarc/issues/165/events","html_url":"https://github.com/CodeNarc/CodeNarc/issues/165","id":175691805,"number":165,"title":"UnnecessaryGetter false positive","user":{"login":"mkordas","id":5467276,"avatar_url":"https://avatars.githubusercontent.com/u/5467276?v=3","gravatar_id":"","url":"https://api.github.com/users/mkordas","html_url":"https://github.com/mkordas","followers_url":"https://api.github.com/users/mkordas/followers","following_url":"https://api.github.com/users/mkordas/following{/other_user}","gists_url":"https://api.github.com/users/mkordas/gists{/gist_id}","starred_url":"https://api.github.com/users/mkordas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkordas/subscriptions","organizations_url":"https://api.github.com/users/mkordas/orgs","repos_url":"https://api.github.com/users/mkordas/repos","events_url":"https://api.github.com/users/mkordas/events{/privacy}","received_events_url":"https://api.github.com/users/mkordas/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-08T08:14:38Z","updated_at":"2016-09-08T23:16:06Z","closed_at":null,"body":"For the following code\r\n```groovy\r\nclass Spec extends Specification {\r\n\r\n    private final field = 'field'\r\n\r\n    def test() {\r\n        expect:\r\n        field == 'field'\r\n        getField() == 'getField'\r\n    }\r\n\r\n    private static String getField() {\r\n        'getField'\r\n    }\r\n}\r\n```\r\nCodenarc says\r\n```\r\n[UnnecessaryGetter] Violation in class Spec. getField() can probably be rewritten as field \r\n```\r\n\r\nIt is false positive, as changing `getField()` invocation to `field` changes behavior of code (and test does not pass anymore).\r\n"},"comment":{"url":"https://api.github.com/repos/CodeNarc/CodeNarc/issues/comments/245771410","html_url":"https://github.com/CodeNarc/CodeNarc/issues/165#issuecomment-245771410","issue_url":"https://api.github.com/repos/CodeNarc/CodeNarc/issues/165","id":245771410,"user":{"login":"chrismair","id":2054847,"avatar_url":"https://avatars.githubusercontent.com/u/2054847?v=3","gravatar_id":"","url":"https://api.github.com/users/chrismair","html_url":"https://github.com/chrismair","followers_url":"https://api.github.com/users/chrismair/followers","following_url":"https://api.github.com/users/chrismair/following{/other_user}","gists_url":"https://api.github.com/users/chrismair/gists{/gist_id}","starred_url":"https://api.github.com/users/chrismair/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrismair/subscriptions","organizations_url":"https://api.github.com/users/chrismair/orgs","repos_url":"https://api.github.com/users/chrismair/repos","events_url":"https://api.github.com/users/chrismair/events{/privacy}","received_events_url":"https://api.github.com/users/chrismair/received_events","type":"User","site_admin":false},"created_at":"2016-09-08T23:16:06Z","updated_at":"2016-09-08T23:16:06Z","body":"Interesting. Yeah, I guess the special case here is that there is an instance field with the same name as the static _property_."}}
{"actor":{"display_login":"chrismair"}}