{"action":"created","issue":{"url":"https://api.github.com/repos/mockito/mockito/issues/220","labels_url":"https://api.github.com/repos/mockito/mockito/issues/220/labels{/name}","comments_url":"https://api.github.com/repos/mockito/mockito/issues/220/comments","events_url":"https://api.github.com/repos/mockito/mockito/issues/220/events","html_url":"https://github.com/mockito/mockito/issues/220","id":84960594,"number":220,"title":"2.0.8-beta -> 2.0.9-beta 'Unable to initialize @Spy annotated field","user":{"login":"brcolow","id":6589866,"avatar_url":"https://avatars.githubusercontent.com/u/6589866?v=3","gravatar_id":"","url":"https://api.github.com/users/brcolow","html_url":"https://github.com/brcolow","followers_url":"https://api.github.com/users/brcolow/followers","following_url":"https://api.github.com/users/brcolow/following{/other_user}","gists_url":"https://api.github.com/users/brcolow/gists{/gist_id}","starred_url":"https://api.github.com/users/brcolow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brcolow/subscriptions","organizations_url":"https://api.github.com/users/brcolow/orgs","repos_url":"https://api.github.com/users/brcolow/repos","events_url":"https://api.github.com/users/brcolow/events{/privacy}","received_events_url":"https://api.github.com/users/brcolow/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-04T07:29:05Z","updated_at":"2015-06-04T20:31:00Z","closed_at":null,"body":"No test failures when using 2.0.8-beta, but when incrementing to 2.0.9-beta, the following error occurs:\r\n\r\n````\r\norg.mockito.exceptions.base.MockitoException: Unable to initialize @Spy annotated field 'monitorTaskScheduler'.\r\nUnable to create mock instance of type 'MonitorTaskScheduler'\r\n\tat net.project.dash.monitor.MonitorTaskScheduler$MockitoMock$1184625981.getExecutorService(Unknown Source)\r\n\tat net.project.dash.monitor.MonitorTaskScheduler.<init>(MonitorTaskScheduler.java:39)\r\n\tat net.project.dash.monitor.MonitorTaskScheduler$MockitoMock$1184625981.<init>(Unknown Source)\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)\r\n\tat sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)\r\n\tat sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)\r\n\tat java.lang.reflect.Constructor.newInstance(Constructor.java:422)\r\n\tat org.mockito.internal.creation.instance.ConstructorInstantiator.invokeConstructor(ConstructorInstantiator.java:42)\r\n\tat org.mockito.internal.creation.instance.ConstructorInstantiator.noArgConstructor(ConstructorInstantiator.java:66)\r\n\tat org.mockito.internal.creation.instance.ConstructorInstantiator.newInstance(ConstructorInstantiator.java:17)\r\n\tat org.mockito.internal.creation.bytebuddy.ByteBuddyMockMaker.createMock(ByteBuddyMockMaker.java:27)\r\n\tat org.mockito.internal.util.MockUtil.createMock(MockUtil.java:33)\r\n\tat org.mockito.internal.MockitoCore.mock(MockitoCore.java:59)\r\n\tat org.mockito.Mockito.mock(Mockito.java:1284)\r\n\tat org.mockito.internal.configuration.SpyAnnotationEngine.newSpyInstance(SpyAnnotationEngine.java:117)\r\n\tat org.mockito.internal.configuration.SpyAnnotationEngine.process(SpyAnnotationEngine.java:67)\r\n\tat org.mockito.internal.configuration.InjectingAnnotationEngine.processIndependentAnnotations(InjectingAnnotationEngine.java:73)\r\n\tat org.mockito.internal.configuration.InjectingAnnotationEngine.process(InjectingAnnotationEngine.java:55)\r\n\tat org.mockito.MockitoAnnotations.initMocks(MockitoAnnotations.java:108)\r\n\tat net.project.dash.monitor.MonitorTaskSchedulerTest.setUp(MonitorTaskSchedulerTest.java:38)\r\n````\r\n\r\nRelevant code (MonitorTaskSchedulerTest.java)\r\n\r\n````java\r\n@Spy\r\nMonitorTaskScheduler monitorTaskScheduler;\r\n\r\n@Before\r\npublic void setUp()\r\n{\r\n    MockitoAnnotations.initMocks(this);\r\n}\r\n````\r\n\r\nRelevant code (MonitorTaskScheduler.java)\r\n\r\n````java\r\npublic class MonitorTaskScheduler\r\n{\r\n    public MonitorTaskScheduler()\r\n    {\r\n        this.futureToTaskMap = new ConcurrentHashMap<>();\r\n    }\r\n}\r\n````"},"comment":{"url":"https://api.github.com/repos/mockito/mockito/issues/comments/109039686","html_url":"https://github.com/mockito/mockito/issues/220#issuecomment-109039686","issue_url":"https://api.github.com/repos/mockito/mockito/issues/220","id":109039686,"user":{"login":"brcolow","id":6589866,"avatar_url":"https://avatars.githubusercontent.com/u/6589866?v=3","gravatar_id":"","url":"https://api.github.com/users/brcolow","html_url":"https://github.com/brcolow","followers_url":"https://api.github.com/users/brcolow/followers","following_url":"https://api.github.com/users/brcolow/following{/other_user}","gists_url":"https://api.github.com/users/brcolow/gists{/gist_id}","starred_url":"https://api.github.com/users/brcolow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brcolow/subscriptions","organizations_url":"https://api.github.com/users/brcolow/orgs","repos_url":"https://api.github.com/users/brcolow/repos","events_url":"https://api.github.com/users/brcolow/events{/privacy}","received_events_url":"https://api.github.com/users/brcolow/received_events","type":"User","site_admin":false},"created_at":"2015-06-04T20:31:00Z","updated_at":"2015-06-04T20:31:00Z","body":"Same problem with 2.0.11-beta (in fact, I started with that version, and then decremented one by one till the problem was gone)."}}