public WatchpointChange(IJavaWatchpoint watchpoint) throws CoreException { super(watchpoint); fFieldName = watchpoint.getFieldName(); fAccess = watchpoint.isAccess(); fModification = watchpoint.isModification(); }
protected String getWatchpointText(IJavaWatchpoint watchpoint) throws CoreException { String typeName= watchpoint.getTypeName(); IMember member= BreakpointUtils.getMember(watchpoint); StringBuffer label= new StringBuffer(); label.append(getQualifiedName(typeName)); appendHitCount(watchpoint, label); appendSuspendPolicy(watchpoint,label); appendThreadFilter(watchpoint, label); boolean access= watchpoint.isAccess(); boolean modification= watchpoint.isModification(); if (access && modification) { label.append(DebugUIMessages.JDIModelPresentation_access_and_modification_70); } else if (access) { label.append(DebugUIMessages.JDIModelPresentation_access_71); } else if (modification) { label.append(DebugUIMessages.JDIModelPresentation_modification_72); } label.append(" - "); //$NON-NLS-1$ if (member != null) { label.append(getJavaLabelProvider().getText(member)); } else { label.append(watchpoint.getFieldName()); } return label.toString(); }
/** * Returns any existing watchpoint for the given field, or <code>null</code> if none. * * @param typeName fully qualified type name on which watchpoint may exist * @param fieldName field name * @return any existing watchpoint for the given field, or <code>null</code> if none * @throws CoreException */ private IJavaWatchpoint getWatchpoint(String typeName, String fieldName) throws CoreException { IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager(); IBreakpoint[] breakpoints = breakpointManager.getBreakpoints(JDIDebugModel.getPluginIdentifier()); for (int i = 0; i < breakpoints.length; i++) { IBreakpoint breakpoint = breakpoints[i]; if (breakpoint instanceof IJavaWatchpoint) { IJavaWatchpoint watchpoint = (IJavaWatchpoint) breakpoint; if (typeName.equals(watchpoint.getTypeName()) && fieldName.equals(watchpoint.getFieldName())) { return watchpoint; } } } return null; }
IJavaWatchpoint wp = (IJavaWatchpoint)jbp; IJavaFieldVariable fv = (IJavaFieldVariable)variable; if (variable.getName().equals(wp.getFieldName()) && fv.getDeclaringType().getName().equals(wp.getTypeName())) { valid = wp;
} else if (breakpoint instanceof IJavaWatchpoint) { IJavaWatchpoint wp = (IJavaWatchpoint)breakpoint; String fieldName = wp.getFieldName(); args = new String[] {thread.getName(), fieldName, typeName}; if (wp.isAccessSuspend(thread.getDebugTarget())) {