Relative Content

Tag Archive for javaconstructorcallback

Can callback to an incompletely constructed Java object be well-defined?

If a constructor of a class T passes this to as an argument to some method foo, and foo immediately performs a callback to the T object (which has not yet finished executing its constructor), things might obviously go wrong, but what if I make sure that any fields accessed by foo are initialized?