I am in the middle of a programme that has a number of Singleton classes and they are therefore structured similar to the following:
Code: Select all
class Singleton {
private static Singleton instance = null;
private Singleton(){
// constructor code
}
public static Singleton getInstance(){
if (instance == null){
instance = new Singleton();
}
return instance;
}
// other code
}
Does anyone have any clue as to what I could do? My Google searches led to many people asking similar questions. While being very interesting and informative, the information didn't really answer my question.
It's not the end of the world if I can't get it done, but the uniformity would be nice, as well as being an extra piece of knowledge which is always a good thing.
Thoughts?