Inheriting a Singleton
Hi, I am having some trouble inheriting from a Singleton class.
I have a parent singleton class that looks like:
public class ProviewReportQueryWin{
private static ProviewReportQueryWin proviewReportQueryWin = null;
...
protected ProviewReportQueryWin(final ProviewReportGUI gui){
...
}
public static ProviewReportQueryWin getInstance(final ProviewReportGUI gui){
if(proviewReportQueryWin == null)
proviewReportQueryWin = new ProviewReportQueryWin(gui);
return proviewReportQueryWin;
}
...
}
and a subclass that extends ProviewReportQueryWin:
public class FailureReportQueryWin extends ProviewReportQueryWin {
private static FailureReportQueryWin failureReportQueryWin = null;
public FailureReportQueryWin(final ProviewReportGUI gui){
super(gui);
...
}
public static FailureReportQueryWin getInstance(final ProviewReportGUI gui){
if(failureReportQueryWin == null)
failureReportQueryWin = new FailureReportQueryWin(gui);
return failureReportQueryWin;
}
}
...
}
However, when I compile it I get an error for FailureReportQueryWin.getInstance(), saying that "The return type is incompatiable with ProviewReportQueryWin.getInstance(ProviewReportGUI)." Does anyone know where my problem is? Thanx!

