protected String getClassNameToPrepare() { String className = myLocation.getTargetUnitName(); if (className == null) { // todo when this case does actually happen? String fileName = myLocation.getFileName(); if (fileName.endsWith(".java")) { fileName = fileName.substring(0, fileName.length() - ".java".length()); } className = myLocation.getNodePointer().getModelReference().getLongName() + "." + fileName; } return className; }
@Override protected void createRequestForPreparedClass( DebugVMEventsProcessor debugProcess, final ReferenceType classType) { RequestManager requestManager = debugProcess.getRequestManager(); try { int lineIndex = myLocation.getLineIndexInFile(); List<Location> locs = classType.locationsOfLine(lineIndex); if (locs.size() > 0) { for (final Location location : locs) { BreakpointRequest request = requestManager.createBreakpointRequest(this, location); requestManager.enableRequest(request); } } else { // there's no executable code in this class requestManager.setInvalid(this, "no executable code found"); String message = "No locations of type " + classType.name() + " found at line " + myLocation.getLineIndexInFile(); LOG.warning(message); } } catch (ClassNotPreparedException ex) { LOG.warning("ClassNotPreparedException: " + ex.getMessage()); // there's a chance to add a breakpoint when the class is prepared } catch (ObjectCollectedException ex) { LOG.warning("ObjectCollectedException: " + ex.getMessage()); // there's a chance to add a breakpoint when the class is prepared } catch (InvalidLineNumberException ex) { requestManager.setInvalid(this, "no executable code found"); LOG.warning("InvalidLineNumberException: " + ex.getMessage()); } catch (InternalException ex) { LOG.error(ex); } catch (Exception ex) { LOG.error(ex); } }
@Override public String getPresentation() { return myLocation.getPresentation(); }
@Override public boolean isValid() { return myLocation.getTargetCodePosition() != null; }
@NonNls public String getPresentation() { return myLocation.getPresentation(); }