'this' must be qualified with a class name
The compiler detected that an attempt was made in an inner class to reference an outer class member using the this keyword with a name other than an outer class's name. Only the name of the outer class can be used from an inner class to reference members of the outer class.
The following example illustrates this error:
public class Simple{
int x;
class InnerClass{
void method1(){
int j = x.this;
/*error: only a class name can be used with
this to reference outer class */
}
}
}
The following example illustrates the proper way to reference an outer class's members:
public class Simple{
int x;
int method2(int arg1){
return arg1 * ;
}
class InnerClass{
void method1(){
int j = Simple.this.x; //This is OK!
int z = Simple.this.method2(10);
}
}
}