我有以下代码:
public class SomeClass {
//InterfaceUpdateListener is an interface
private InterfaceUpdateListener listener = new InterfaceUpdateListener(){
public void onUpdate() {
SomeClass.this.someMethod(); //complier complains on this line of code
}
};
private void someMethod() {
//do something in here on an update event occuring
}
//other code to register the listener with another class...
}
我在 Eclipse 中的编译器抱怨说
Access to enclosing method 'someMethod' from type SomeClass is emulated by a synthetic accessor method.
谁能准确解释
- 这意味着什么,
- 如果我保持原样(因为它只是一个警告),可能的后果可能意味着什么,以及
- 我该如何解决?
谢谢