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.
Summary: | Assure that the evaluator and other parts of the Java debugger are up-to-date with the JDK 8 language features. | ||
---|---|---|---|
Product: | debugger | Reporter: | Martin Entlicher <mentlicher> |
Component: | Java | Assignee: | Martin Entlicher <mentlicher> |
Status: | RESOLVED FIXED | ||
Severity: | normal | Keywords: | PLAN |
Priority: | P1 | ||
Version: | 7.4 | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://openjdk.java.net/projects/jdk8/ | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 206487 |
Description
Martin Entlicher
2013-01-10 15:52:57 UTC
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 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). 7. Step into Lambda implementation does not work correctly. Debugger suspends in Integer.valueOf() and after further step skips the Lambda body. 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 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. 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. |