This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 224716 - Assure that the evaluator and other parts of the Java debugger are up-to-date with the JDK 8 language features.
Summary: Assure that the evaluator and other parts of the Java debugger are up-to-date...
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Java (show other bugs)
Version: 7.4
Hardware: All All
: P1 normal (vote)
Assignee: Martin Entlicher
URL: http://openjdk.java.net/projects/jdk8/
Keywords: PLAN
Depends on:
Blocks: 206487
  Show dependency tree
 
Reported: 2013-01-10 15:52 UTC by Martin Entlicher
Modified: 2013-03-24 21:01 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Entlicher 2013-01-10 15:52:57 UTC
NetBeans Java debugger should work well with the the new JDK 8 language features.
Comment 1 Martin Entlicher 2013-03-15 16:20:40 UTC
Evaluator needs to be able to process:
1. Intersection types,
2. Lambda expressions,
3. Member references.
Comment 2 Martin Entlicher 2013-03-19 17:32:31 UTC
The evaluator is adapted by these changes:
Intersection types are handled by changeset:   248754:df18a035253c
http://hg.netbeans.org/core-main/rev/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.
http://hg.netbeans.org/core-main/rev/335cc0441395

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
   stepping:
   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
        definition)
   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
   java.lang.invoke.Invokers.getCallSiteTarget(Invokers.java:436)
   and
   java.lang.invoke.ConstantCallSite.getTarget(ConstantCallSite.java:95)

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
   locations:
   Having a method breakpoint on PropertyChangeListener.propertyChange()
   method and following code:

   PropertyChangeListener pchl =
       (PropertyChangeEvent evt)
       ->
       {        
           System.out.println("EVT["+evt.getPropertyName()+"]");
       };       
   chl.propertyChange(new PropertyChangeEvent("a", "b", "c", "d"));

   The method breakpoint is hit in native method
   com.test.LambdaExpressions$$Lambda$7.propertyChange
   and further step into skips from the Lambda body into it's invoked
   methods (into PropertyChangeEvent.getPropertyName() method).
Comment 3 Martin Entlicher 2013-03-21 17:12:41 UTC
7. Step into Lambda implementation does not work correctly.
   Debugger suspends in Integer.valueOf() and after further step skips the
   Lambda body.
Comment 4 Martin Entlicher 2013-03-22 15:26:47 UTC
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.
Comment 5 Martin Entlicher 2013-03-22 16:28:57 UTC
Problems 1. and 2. should be fixed by
https://jbs.oracle.com/bugs/browse/JDK-8010404

3. is fixed by changeset:   249185:e9ac310ef3c3
   http://hg.netbeans.org/core-main/rev/e9ac310ef3c3

4. and 5. is fixed by changeset:   249187:578dadd91fc0
   http://hg.netbeans.org/core-main/rev/578dadd91fc0

6. we can probably do nothing about method breakpoint being hit at
   com.test.LambdaExpressions$$Lambda$7.propertyChange
   further stepping should work fine - fixed by other changes.

7. is fixed by changeset:   249186:b32557783edb
   http://hg.netbeans.org/core-main/rev/b32557783edb

8. is fixed by changeset:   249188:3b10a731a550
   http://hg.netbeans.org/core-main/rev/3b10a731a550

Debugger should work fine with JDK 8 code now.
Comment 6 Quality Engineering 2013-03-24 21:01:43 UTC
Integrated into 'main-golden', will be available in build *201303241718* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e9ac310ef3c3
User: mentlicher@netbeans.org
Log: #224716: Assure that step into on Lambda expression does not go into Java implementation internals.