{"action":"opened","issue":{"url":"https://api.github.com/repos/easymock/easymock/issues/153","labels_url":"https://api.github.com/repos/easymock/easymock/issues/153/labels{/name}","comments_url":"https://api.github.com/repos/easymock/easymock/issues/153/comments","events_url":"https://api.github.com/repos/easymock/easymock/issues/153/events","html_url":"https://github.com/easymock/easymock/issues/153","id":84299028,"number":153,"title":"Using eq with autoboxing causes null pointer exception","user":{"login":"henri-tremblay","id":1216819,"avatar_url":"https://avatars.githubusercontent.com/u/1216819?v=3","gravatar_id":"","url":"https://api.github.com/users/henri-tremblay","html_url":"https://github.com/henri-tremblay","followers_url":"https://api.github.com/users/henri-tremblay/followers","following_url":"https://api.github.com/users/henri-tremblay/following{/other_user}","gists_url":"https://api.github.com/users/henri-tremblay/gists{/gist_id}","starred_url":"https://api.github.com/users/henri-tremblay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henri-tremblay/subscriptions","organizations_url":"https://api.github.com/users/henri-tremblay/orgs","repos_url":"https://api.github.com/users/henri-tremblay/repos","events_url":"https://api.github.com/users/henri-tremblay/events{/privacy}","received_events_url":"https://api.github.com/users/henri-tremblay/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/easymock/easymock/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/easymock/easymock/labels/minor","name":"minor","color":"bfe5bf"}],"state":"open","locked":false,"assignee":{"login":"henri-tremblay","id":1216819,"avatar_url":"https://avatars.githubusercontent.com/u/1216819?v=3","gravatar_id":"","url":"https://api.github.com/users/henri-tremblay","html_url":"https://github.com/henri-tremblay","followers_url":"https://api.github.com/users/henri-tremblay/followers","following_url":"https://api.github.com/users/henri-tremblay/following{/other_user}","gists_url":"https://api.github.com/users/henri-tremblay/gists{/gist_id}","starred_url":"https://api.github.com/users/henri-tremblay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henri-tremblay/subscriptions","organizations_url":"https://api.github.com/users/henri-tremblay/orgs","repos_url":"https://api.github.com/users/henri-tremblay/repos","events_url":"https://api.github.com/users/henri-tremblay/events{/privacy}","received_events_url":"https://api.github.com/users/henri-tremblay/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2015-06-03T01:34:47Z","updated_at":"2015-06-03T01:34:47Z","closed_at":null,"body":"*Migrated from:* CodeHaus issue EASYMOCK-142\n*Original reporter:* Ken Warkentyne\n\n---------------------------------------------------------\nHere's a test that produces a null pointer exception due to trying to convert the null value returned by 'eq' to a primitive long.\r\n{code}\r\nimport org.testng.annotations.Test;\r\n\r\nimport static org.easymock.EasyMock.createMock;\r\nimport static org.easymock.EasyMock.eq;\r\nimport static org.easymock.EasyMock.expect;\r\n\r\npublic class TestClass {\r\n\r\n    @Test\r\n    public void testMethod() {\r\n\r\n        ClassToMock mock = createMock(ClassToMock.class);\r\n        Long longObject = 101L;\r\n\r\n        expect(mock.checkLong(eq(longObject))).andReturn(1);\r\n    }\r\n\r\n    class ClassToMock {\r\n        public int checkLong(long lvalue) {\r\n            return 0;\r\n        }\r\n    }\r\n}\r\n{code}\r\n\n"}}