For thread-safety reasons it is argumented:
Do not allow the this reference to escape during construction.
But is this always an issue and should be avoided by using newInstance() methods? Inside my model class I have a TableModel which should be instantiated, within the model class, but which also requires a reference to the model class:
public class MainModel {
TableModel tableMode;
public MainModel() {
tableModel = new MyTableModel(this);
}
}
If the constructor does not use this right away is it then safe or should it be avoided in any means?