-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Objects should not call eventBus.register(this)
in constructors
#155
Comments
this
in constructorseventBus.register(this)
in constructors
eventBus.register(this)
in constructorseventBus.register(this)
in constructors
Resolution, this will be handled with dependency injection. |
Now that our exception dialog at least doesn't stack overflow when there's a problem with the GUI thread, here's a full stacktrace for the fabled Identical traces seem to be pretty common in JavaFX applications if you do some Googling, but the actual cause is kind of hard to track down. Avoiding unsafe things like leaking
|
This should be resolved with dependency injection #215 |
Problem
Registering an object to the event bus inside of a constructor call can result in a subscriber being called prior to all of the fields in the class being fully constructed. This can lead to null pointer exceptions for fields that are final and should have been initialized in the classes constructor.
Relavent Gitter Discussion Discovery of problem and discussion of how to fix it.
Guava Google Groups Discussion with Dev
Resolution
This can be resolved by ensuring that constructors never call a register method
The text was updated successfully, but these errors were encountered: