void (final DebugProcessImpl debugProcess, final ReferenceType classType) { if (!ReadAction.compute(() -> isInScopeOf(debugProcess, classType.name()))) { if (LOG.isDebugEnabled()) { LOG.debug(classType.name() + " is out of debug-process scope, breakpoint request won't be created for line " + getLineIndex()); } return; } try { SourcePosition position = getSourcePosition(); List<Location> locations = debugProcess.getPositionManager().locationsOfLine(classType, position); if (!locations.isEmpty()) { VirtualMachineProxyImpl vm = debugProcess.getVirtualMachineProxy(); locations = StreamEx.of(locations).peek(loc -> { if (LOG.isDebugEnabled()) { LOG.debug("Found location [codeIndex=" + loc.codeIndex() + "] for reference type " + classType.name() + " at line " + getLineIndex() + "; isObsolete: " + (vm.versionHigher("1.4") && loc.method().isObsolete())); } }).filter(l -> acceptLocation(debugProcess, classType, l)).toList(); if (getProperties() instanceof JavaLineBreakpointProperties props && props.isConditionalReturn()) { if (DebuggerUtils.isAndroidVM(vm.getVirtualMachine())) { XDebuggerManagerImpl.getNotificationGroup() .createNotification(JavaDebuggerBundle.message("message.conditional.return.breakpoint.on.android"), MessageType.INFO) .notify(debugProcess.getProject()); } else if (vm.canGetBytecodes() && vm.canGetConstantPool()) { locations = locations.stream() .map(l -> l.method()) .distinct() .flatMap(m -> JavaLineBreakpointType.collectInlineConditionalReturnLocations(m, position.getLine() + 1)) .toList(); } } else if (myIgnoreSameLineLocations) { locations = MethodBytecodeUtil.removeSameLineLocations(locations); } for (Location loc : locations) { createLocationBreakpointRequest(this, loc, debugProcess); if (LOG.isDebugEnabled()) { LOG.debug("Created breakpoint request for reference type " + classType.name() + " at line " + getLineIndex() + "; codeIndex=" + loc.codeIndex()); } } } else if (DebuggerUtilsEx.allLineLocations(classType) == null) { // there's no line info in this class debugProcess.getRequestsManager() .setInvalid(this, JavaDebuggerBundle.message("error.invalid.breakpoint.no.line.info", classType.name())); if (LOG.isDebugEnabled()) { LOG.debug("No line number info in " + classType.name()); } } else { // there's no executable code in this class debugProcess.getRequestsManager().setInvalid(this, JavaDebuggerBundle.message( "error.invalid.breakpoint.no.executable.code", (getLineIndex() + 1), classType.name()) ); if (LOG.isDebugEnabled()) { LOG.debug("No locations of type " + classType.name() + " found at line " + getLineIndex()); } } } catch (ClassNotPreparedException ex) { if (LOG.isDebugEnabled()) { LOG.debug("ClassNotPreparedException: " + ex.getMessage()); } // there's a chance to add a breakpoint when the class is prepared } catch (ObjectCollectedException ex) { if (LOG.isDebugEnabled()) { LOG.debug("ObjectCollectedException: " + ex.getMessage()); } // there's a chance to add a breakpoint when the class is prepared } catch (Exception ex) { LOG.info(ex); } updateUI(); }