How can I access outer class' super
from an inner class?
I'm overriding a method to make it run on a different thread. From an inline Thread, I need to call the original method but of course just calling method()
would turn into an infinite recursion.
Specifically, I'm extending BufferedReader:
public WaitingBufferedReader(InputStreamReader in, long waitingTime)
{
[..]
@Override
public String readLine()
{
Thread t= new Thread(){
public void run()
{
try { setMessage(WaitingBufferedReader.super.readLine()); } catch (IOException ex) { }
}
};
t.start();
[..]
}
}
This somewhere gives me a NullPointerException I'm not able to find.
Thanks.