Suppose I have the following class and you want to set a conditional breakpoint to arg == null at the marked position. This will not work in eclipse and will give the error "conditional breakpoint has compilation error (s). Reason: arg could not be resolved to a variable."
I found some related information here , but even if I change the condition to "val $ arg == null" (val $ arg is the variable name displayed in the debugger variable view), eclipse gives me the same error.
public abstract class Test { public static void main(String[] args) { Test t1 = foo("123"); Test t2 = foo(null); t1.bar(); t2.bar(); } abstract void bar(); static Test foo(final String arg) { return new Test() { @Override void bar() {
source share