{"action":"created","issue":{"url":"https://api.github.com/repos/INRIA/spoon/issues/826","repository_url":"https://api.github.com/repos/INRIA/spoon","labels_url":"https://api.github.com/repos/INRIA/spoon/issues/826/labels{/name}","comments_url":"https://api.github.com/repos/INRIA/spoon/issues/826/comments","events_url":"https://api.github.com/repos/INRIA/spoon/issues/826/events","html_url":"https://github.com/INRIA/spoon/issues/826","id":177604320,"number":826,"title":"DefaultJavaPrettyPrinter.visitCtThisAccess","user":{"login":"leventov","id":609240,"avatar_url":"https://avatars.githubusercontent.com/u/609240?v=3","gravatar_id":"","url":"https://api.github.com/users/leventov","html_url":"https://github.com/leventov","followers_url":"https://api.github.com/users/leventov/followers","following_url":"https://api.github.com/users/leventov/following{/other_user}","gists_url":"https://api.github.com/users/leventov/gists{/gist_id}","starred_url":"https://api.github.com/users/leventov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leventov/subscriptions","organizations_url":"https://api.github.com/users/leventov/orgs","repos_url":"https://api.github.com/users/leventov/repos","events_url":"https://api.github.com/users/leventov/events{/privacy}","received_events_url":"https://api.github.com/users/leventov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-17T19:51:31Z","updated_at":"2016-09-23T13:00:35Z","closed_at":null,"body":"I think it shouldn't rely on getTarget().isImplicit() when printing this qualifier, because classes could be moved around, and Implicit flag is usually not modified.\r\n\r\nSuch implementation work better for me, probably it should be adapted for DefaultJavaPrettyPrinter itself (+ corner cases, which I omitted in my code because not the case for me):\r\n\r\n```java\r\n    class MyPrinter extends DefaultJavaPrettyPrinter {\r\n\r\n        Deque<CtClass<?>> currentThis = new ArrayDeque<>();\r\n\r\n        public MyPrinter(Environment env) {\r\n            super(env);\r\n        }\r\n\r\n        @Override\r\n        public <T> void visitCtClass(CtClass<T> ctClass) {\r\n            currentThis.push(ctClass);\r\n            super.visitCtClass(ctClass);\r\n            currentThis.pop();\r\n        }\r\n\r\n        @Override\r\n        public <T> void visitCtThisAccess(CtThisAccess<T> thisAccess) {\r\n            enterCtExpression(thisAccess);\r\n            if (!thisAccess.isImplicit()) {\r\n                if (thisAccess.getType().getDeclaration() != currentThis.peek()) {\r\n                    visitCtTypeReferenceWithoutGenerics(thisAccess.getType());\r\n                    write(\".\");\r\n                }\r\n                write(\"this\");\r\n            }\r\n            exitCtExpression(thisAccess);\r\n        }\r\n    }\r\n```"},"comment":{"url":"https://api.github.com/repos/INRIA/spoon/issues/comments/249185666","html_url":"https://github.com/INRIA/spoon/issues/826#issuecomment-249185666","issue_url":"https://api.github.com/repos/INRIA/spoon/issues/826","id":249185666,"user":{"login":"monperrus","id":803666,"avatar_url":"https://avatars.githubusercontent.com/u/803666?v=3","gravatar_id":"","url":"https://api.github.com/users/monperrus","html_url":"https://github.com/monperrus","followers_url":"https://api.github.com/users/monperrus/followers","following_url":"https://api.github.com/users/monperrus/following{/other_user}","gists_url":"https://api.github.com/users/monperrus/gists{/gist_id}","starred_url":"https://api.github.com/users/monperrus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monperrus/subscriptions","organizations_url":"https://api.github.com/users/monperrus/orgs","repos_url":"https://api.github.com/users/monperrus/repos","events_url":"https://api.github.com/users/monperrus/events{/privacy}","received_events_url":"https://api.github.com/users/monperrus/received_events","type":"User","site_admin":false},"created_at":"2016-09-23T13:00:35Z","updated_at":"2016-09-23T13:00:35Z","body":"if it's a bug, could you provide us with a failing test case? thanks."}}
{"actor":{"display_login":"monperrus"}}