arusinha commented on a change in pull request #2055:
URL: https://github.com/apache/netbeans/pull/2055#discussion_r416512289
##########
File path:
java/debugger.jpda/src/org/netbeans/modules/debugger/jpda/breakpoints/LineBreakpointImpl.java
##########
@@ -337,32 +343,35 @@ protected void classLoaded (List<ReferenceType>
referenceTypes) {
continue;
}
// Submit the breakpoint for the lowest location on the line
only:
- Location location = locations.get(0);
- com.sun.jdi.Method m0 = location.method();
- for (int li = 1; li < locations.size(); li++) {
- Location l = locations.get(li);
- if (l.codeIndex() < location.codeIndex()) {
- if (l.method().equals(m0)) {
- // Assure that we're still in the same method
- location = l;
- }
- }
- }
+ /* If location contains multiple event breakpoint for the same
line
+ (e.g lambda expression along with any function calling
+ map(n -> foo(
+ boo(n))))
+ then take the lowest location from each type of event*/
+ Collection<Location> lowestLocationList = locations
+ .stream()
+ .collect(groupingBy(loc->loc.method().toString(),
+ LinkedHashMap::new,
+
collectingAndThen(minBy(Comparator.comparingDouble(Location::codeIndex)),
Review comment:
Please squash the commits before merging
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists