{"action":"created","issue":{"url":"https://api.github.com/repos/jcabi/jcabi-aspects/issues/209","repository_url":"https://api.github.com/repos/jcabi/jcabi-aspects","labels_url":"https://api.github.com/repos/jcabi/jcabi-aspects/issues/209/labels{/name}","comments_url":"https://api.github.com/repos/jcabi/jcabi-aspects/issues/209/comments","events_url":"https://api.github.com/repos/jcabi/jcabi-aspects/issues/209/events","html_url":"https://github.com/jcabi/jcabi-aspects/issues/209","id":129619887,"number":209,"title":"jcabi-aspects does not validate static methods","user":{"login":"HDouss","id":2956255,"avatar_url":"https://avatars.githubusercontent.com/u/2956255?v=3","gravatar_id":"","url":"https://api.github.com/users/HDouss","html_url":"https://github.com/HDouss","followers_url":"https://api.github.com/users/HDouss/followers","following_url":"https://api.github.com/users/HDouss/following{/other_user}","gists_url":"https://api.github.com/users/HDouss/gists{/gist_id}","starred_url":"https://api.github.com/users/HDouss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HDouss/subscriptions","organizations_url":"https://api.github.com/users/HDouss/orgs","repos_url":"https://api.github.com/users/HDouss/repos","events_url":"https://api.github.com/users/HDouss/events{/privacy}","received_events_url":"https://api.github.com/users/HDouss/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jcabi/jcabi-aspects/labels/30%20mins","name":"30 mins","color":"eb6421"},{"url":"https://api.github.com/repos/jcabi/jcabi-aspects/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/jcabi/jcabi-aspects/labels/DEV","name":"DEV","color":"bfd4f3"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":11,"created_at":"2016-01-28T23:45:42Z","updated_at":"2016-06-23T08:30:17Z","closed_at":null,"body":"In jcabi-aspects 0.22.3, validation of static methods arguments fails.\r\nThis is caused by the fact that `beforeMethod` validation passes a `this` reference of the `JoinPoint`. This `this` reference is null in case of a static method and the validation fails because validators like Hibernate validator asserts that the passed object on which the method to validate is invoked should not be null.\r\n\r\nThis is an example to reproduce:\r\n```java\r\npackage issue209;\r\n\r\nimport com.jcabi.aspects.Loggable;\r\nimport javax.validation.constraints.NotNull;\r\n\r\npublic class Dummy {\r\n\r\n    @Loggable\r\n    public void done() {\r\n        Dummy.call(this);\r\n    }\r\n\r\n    private static void call(@NotNull Dummy d) {\r\n\r\n    }\r\n}\r\n\r\n```\r\n\r\nIf we try to execute a test like this one:\r\n```java\r\npackage issue209;\r\n\r\nimport org.junit.Test;\r\n\r\npublic class DummyTest {\r\n\r\n    @Test\r\n    public void testDummy(){\r\n        new Dummy().done();\r\n    }\r\n}\r\n\r\n```\r\n\r\nIt will fail."},"comment":{"url":"https://api.github.com/repos/jcabi/jcabi-aspects/issues/comments/227983773","html_url":"https://github.com/jcabi/jcabi-aspects/issues/209#issuecomment-227983773","issue_url":"https://api.github.com/repos/jcabi/jcabi-aspects/issues/209","id":227983773,"user":{"login":"dmarkov","id":5993843,"avatar_url":"https://avatars.githubusercontent.com/u/5993843?v=3","gravatar_id":"","url":"https://api.github.com/users/dmarkov","html_url":"https://github.com/dmarkov","followers_url":"https://api.github.com/users/dmarkov/followers","following_url":"https://api.github.com/users/dmarkov/following{/other_user}","gists_url":"https://api.github.com/users/dmarkov/gists{/gist_id}","starred_url":"https://api.github.com/users/dmarkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmarkov/subscriptions","organizations_url":"https://api.github.com/users/dmarkov/orgs","repos_url":"https://api.github.com/users/dmarkov/repos","events_url":"https://api.github.com/users/dmarkov/events{/privacy}","received_events_url":"https://api.github.com/users/dmarkov/received_events","type":"User","site_admin":false},"created_at":"2016-06-23T08:30:17Z","updated_at":"2016-06-23T08:30:17Z","body":"> @dmarkov pls assign this to @westonized \n\n@yegor256 OK @westonized please proceed, this task is yours"}}
{"actor":{"display_login":"dmarkov"}}