.map(request -> ((BreakpointRequest) request).location()).toList().subscribe(list -> { existingLocations.addAll(list); });
@Override public List<Breakpoint> getAllBreakpoints() throws DebuggerException { List<BreakpointRequest> breakpointRequests; try { breakpointRequests = getEventManager().breakpointRequests(); } catch (DebuggerException e) { Throwable cause = e.getCause(); if (cause instanceof VMCannotBeModifiedException) { // If target VM in read-only state then list of break point always empty. return emptyList(); } throw e; } List<Breakpoint> breakPoints = new ArrayList<>(breakpointRequests.size()); for (BreakpointRequest breakpointRequest : breakpointRequests) { com.sun.jdi.Location location = breakpointRequest.location(); // Breakpoint always enabled at the moment. Managing states of breakpoint is not supported for // now. breakPoints.add( newDto(BreakpointDto.class) .withEnabled(true) .withLocation(asDto(new JdbLocation(languageServer, location)))); } breakPoints.sort(BREAKPOINT_COMPARATOR); return breakPoints; }
@Override public void deleteBreakpoint(Location location) throws DebuggerException { final String target = location.getTarget(); final String className = !target.endsWith(".java") ? target : languageServer.identifyFqnInResource(location.getTarget(), location.getLineNumber()); final int lineNumber = location.getLineNumber(); EventRequestManager requestManager = getEventManager(); List<BreakpointRequest> snapshot = new ArrayList<>(requestManager.breakpointRequests()); for (BreakpointRequest breakpointRequest : snapshot) { com.sun.jdi.Location jdiLocation = breakpointRequest.location(); if (jdiLocation.declaringType().name().equals(className) && jdiLocation.lineNumber() == lineNumber) { requestManager.deleteEventRequest(breakpointRequest); LOG.debug("Delete breakpoint: {}", location); } } List<Breakpoint> defferedByClass = deferredBreakpoints.get(className); if (defferedByClass != null) { defferedByClass.removeIf( breakpoint -> { Location l = breakpoint.getLocation(); return l.getLineNumber() == location.getLineNumber() && l.getTarget().equals(location.getTarget()); }); } }
Location location = req.location(); if( getOutermostType( location.declaringType() ).equals( bp.getFqn() ) && location.lineNumber() == bp.getLine() )
for( BreakpointRequest req : bpRequests ) Location location = req.location(); if( getOutermostType( location.declaringType() ).equals( bp.getFqn() ) && location.lineNumber() == bp.getLine() )
Location location = req.location(); Breakpoint breakpoint = _bpm.findBreakpoint( location.declaringType().name().replace( '$', '.' ), location.lineNumber() ); req.setEnabled( breakpoint.isActive() );
if (location.equals(breakpointRequest.location())) { LOG.debug("Breakpoint at {} already set", location); return;