void (DebugProcessImpl debugProcess, ReferenceType classType) { try { final CompoundPositionManager positionManager = debugProcess.getPositionManager(); List<Location> locations = positionManager.locationsOfLine(classType, myCustomPosition); if (locations.isEmpty()) { // sometimes first statements are mapped to some weird line number, or there are no executable instructions at first statement's line // so if lambda or method body spans for more than one lines, try get some locations from these lines final int lastLine = myFilter.getLastStatementLine(); if (lastLine >= 0) { int nextLine = myCustomPosition.getLine() + 1; while (nextLine <= lastLine && locations.isEmpty()) { locations = positionManager.locationsOfLine(classType, SourcePosition.createFromLine(myCustomPosition.getFile(), nextLine++)); } } } if (!locations.isEmpty()) { MultiMap<Method, Location> methods = new MultiMap<>(); for (Location loc : locations) { if (acceptLocation(debugProcess, classType, loc)) { methods.putValue(loc.method(), loc); } } Location location = null; final int methodsFound = methods.size(); if (methodsFound == 1) { location = methods.values().iterator().next(); } else { if (myFilter instanceof LambdaMethodFilter lambdaFilter) { if (lambdaFilter.getLambdaOrdinal() < methodsFound) { Method[] candidates = methods.keySet().toArray(new Method[methodsFound]); Arrays.sort(candidates, DebuggerUtilsEx.LAMBDA_ORDINAL_COMPARATOR); location = methods.get(candidates[lambdaFilter.getLambdaOrdinal()]).iterator().next(); } } else { if (methodsFound > 0) { location = methods.values().iterator().next(); } } } createLocationBreakpointRequest(this, location, debugProcess); } } catch (ClassNotPreparedException ex) { if (LOG.isDebugEnabled()) { LOG.debug("ClassNotPreparedException: " + ex.getMessage()); } } catch (ObjectCollectedException ex) { if (LOG.isDebugEnabled()) { LOG.debug("ObjectCollectedException: " + ex.getMessage()); } } catch (Exception ex) { LOG.info(ex); } }