When reading < Java Concurrency in Practice >, there's an example saying that the following code snippet will lead to this
pointer escape in the constructor method. But I'm not sure what exactly does it mean, since I couldn't see any this
reference in the source code of ThisEscape
constructor method. Any ideas? Thanks.
public class ThisEscape {
public ThisEscape(EventSource source) {
source.registerListener(
new EventListener() {
public void onEvent(Event e) {
doSomething(e);
}
}
);
}
}