NetBeans Java debugger should work well with the the new JDK 8 language features.
Evaluator needs to be able to process:
1. Intersection types,
2. Lambda expressions,
3. Member references.
The evaluator is adapted by these changes:
Intersection types are handled by changeset: 248754:df18a035253c
Lambda expressions and member references are recognized by
changeset: 248755:335cc0441395, but they are reported as unsupported,
because it's problematic to create new classes in the target VM.
By default, it's possible to step through Lambda expressions and breakpoints do work in Lambda expressions, but there are several inconveniences:
1. Debugger is suspended twice on Lambda expression declaration during
When a definition of a Lambda expression is provided as an argument to
a method, stepping over is suspended on following locations:
1.1. On the method invocation line
(if there are other arguments preceding the Lambda expression
1.2. On the Lambda expression
(on the arguments paranthesis, or the -> arrow)
1.3. On the method invocation line.
2. Breakpoint on the method invocation line is hit two times when there
are other arguments preceding the Lambda expression definition.
3. Step into on a Lambda expression goes to
4. Step over expression does not work inside the Lambda body.
5. Step into with method selection does not work inside the Lambda body.
6. Method breakpoints break on Lambdas, but they suspend on unexpected
Having a method breakpoint on PropertyChangeListener.propertyChange()
method and following code:
PropertyChangeListener pchl =
chl.propertyChange(new PropertyChangeEvent("a", "b", "c", "d"));
The method breakpoint is hit in native method
and further step into skips from the Lambda body into it's invoked
methods (into PropertyChangeEvent.getPropertyName() method).
7. Step into Lambda implementation does not work correctly.
Debugger suspends in Integer.valueOf() and after further step skips the
8. Step that leaves Lambda implementation and goes back to it's caller
suspends in ClassName$$Lambda$<name> synthetic class. One extra step is
necessary to get to the caller.
Problems 1. and 2. should be fixed by
3. is fixed by changeset: 249185:e9ac310ef3c3
4. and 5. is fixed by changeset: 249187:578dadd91fc0
6. we can probably do nothing about method breakpoint being hit at
further stepping should work fine - fixed by other changes.
7. is fixed by changeset: 249186:b32557783edb
8. is fixed by changeset: 249188:3b10a731a550
Debugger should work fine with JDK 8 code now.
Integrated into 'main-golden', will be available in build *201303241718* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Log: #224716: Assure that step into on Lambda expression does not go into Java implementation internals.