{"action":"created","issue":{"url":"https://api.github.com/repos/square/otto/issues/148","labels_url":"https://api.github.com/repos/square/otto/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/square/otto/issues/148/comments","events_url":"https://api.github.com/repos/square/otto/issues/148/events","html_url":"https://github.com/square/otto/issues/148","id":63089048,"number":148,"title":"Is Bus.register() meant to be threadsafe?","user":{"login":"ppiech","id":1108079,"avatar_url":"https://avatars.githubusercontent.com/u/1108079?v=3","gravatar_id":"","url":"https://api.github.com/users/ppiech","html_url":"https://github.com/ppiech","followers_url":"https://api.github.com/users/ppiech/followers","following_url":"https://api.github.com/users/ppiech/following{/other_user}","gists_url":"https://api.github.com/users/ppiech/gists{/gist_id}","starred_url":"https://api.github.com/users/ppiech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ppiech/subscriptions","organizations_url":"https://api.github.com/users/ppiech/orgs","repos_url":"https://api.github.com/users/ppiech/repos","events_url":"https://api.github.com/users/ppiech/events{/privacy}","received_events_url":"https://api.github.com/users/ppiech/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-19T20:54:28Z","updated_at":"2015-03-19T20:57:39Z","closed_at":null,"body":"We're using it with the assumption it is, but seeing the following NPE:\r\n\r\nCaused by: java.lang.NullPointerException: Attempt to invoke interface method 'boolean java.util.Map.isEmpty()' on a null object reference\r\n       at com.squareup.otto.AnnotatedHandlerFinder.findAllProducers(AnnotatedHandlerFinder.java:129)\r\n       at com.squareup.otto.HandlerFinder$1.findAllProducers(HandlerFinder.java:33)\r\n       at com.squareup.otto.Bus.register(Bus.java:191)\r\n       ....\r\n\r\nLooking at the thread it appears that access to the static method caches PRODUCERS_CACHE and SUBSCRIBERS_CACHE is not synchronized in any way.\r\n\r\nThanks,\r\nPawel"},"comment":{"url":"https://api.github.com/repos/square/otto/issues/comments/83758458","html_url":"https://github.com/square/otto/issues/148#issuecomment-83758458","issue_url":"https://api.github.com/repos/square/otto/issues/148","id":83758458,"user":{"login":"JakeWharton","id":66577,"avatar_url":"https://avatars.githubusercontent.com/u/66577?v=3","gravatar_id":"","url":"https://api.github.com/users/JakeWharton","html_url":"https://github.com/JakeWharton","followers_url":"https://api.github.com/users/JakeWharton/followers","following_url":"https://api.github.com/users/JakeWharton/following{/other_user}","gists_url":"https://api.github.com/users/JakeWharton/gists{/gist_id}","starred_url":"https://api.github.com/users/JakeWharton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JakeWharton/subscriptions","organizations_url":"https://api.github.com/users/JakeWharton/orgs","repos_url":"https://api.github.com/users/JakeWharton/repos","events_url":"https://api.github.com/users/JakeWharton/events{/privacy}","received_events_url":"https://api.github.com/users/JakeWharton/received_events","type":"User","site_admin":false},"created_at":"2015-03-19T20:57:39Z","updated_at":"2015-03-19T20:57:39Z","body":"Thread safety was removed when we constrained the bus to the main thread. After exposing the ability to relax the main thread confinement the safety was never added back."}}