Source:
<code>private void updateBreakpointMessages(final IBreakpoint[] breakpoints) { IWorkspaceRunnable runnable = new IWorkspaceRunnable() { @Override public void run(IProgressMonitor monitor) throws CoreException { for (int i = 0; i < breakpoints.length; i++) { IBreakpoint breakpoint = breakpoints[i]; if (breakpoint instanceof IJavaBreakpoint) { String info = fLabelProvider.getText(breakpoint); String type = DebugUIMessages.JavaDebugOptionsManager_Breakpoint___1; if (breakpoint instanceof IJavaMethodBreakpoint || breakpoint instanceof IJavaMethodEntryBreakpoint) { type = DebugUIMessages.JavaDebugOptionsManager_Method_breakpoint___2; } else if (breakpoint instanceof IJavaWatchpoint) { type = DebugUIMessages.JavaDebugOptionsManager_Watchpoint___3; } else if (breakpoint instanceof IJavaLineBreakpoint) { type = DebugUIMessages.JavaDebugOptionsManager_Line_breakpoint___4; } IMarker marker = breakpoint.getMarker(); if (marker.exists()) { marker.setAttribute(IMarker.MESSAGE, type + info); } } } } }; class UpdateBreakpointMessagesJob extends Job { UpdateBreakpointMessagesJob() { super("Updating breakpoint messages"); } @Override protected IStatus run(IProgressMonitor monitor) { if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } try { ISchedulingRule modifyWorkspaceRule = modifyWorkspaceRule(); ResourcesPlugin.getWorkspace().run(runnable, modifyWorkspaceRule, 0, null); } catch (CoreException e) { String errorMessage = "Failed to update breakpoint messages"; IStatus errorStatus = new Status(IStatus.ERROR, IJavaDebugUIConstants.PLUGIN_ID, errorMessage, e); return errorStatus; } return Status.OK_STATUS; } @Override public boolean belongsTo(Object family) { return UpdateBreakpointMessagesJob.class == family; } } UpdateBreakpointMessagesJob updateBreakpointMessagesJob = new UpdateBreakpointMessagesJob(); <START> updateBreakpointMessagesJob.schedule(); <END> }</code><technical_language>in debugger running in context of workspace build job, owns rule. I avoid scheduling this jobs if JobManager.currentRule() matches rule</technical_language>

Target:
private void updateBreakpointMessages(final IBreakpoint[] breakpoints) { IWorkspaceRunnable runnable = new IWorkspaceRunnable() { @Override public void run(IProgressMonitor monitor) throws CoreException { for (int i = 0; i < breakpoints.length; i++) { IBreakpoint breakpoint = breakpoints[i]; if (breakpoint instanceof IJavaBreakpoint) { String info = fLabelProvider.getText(breakpoint); String type = DebugUIMessages.JavaDebugOptionsManager_Breakpoint___1; if (breakpoint instanceof IJavaMethodBreakpoint || breakpoint instanceof IJavaMethodEntryBreakpoint) { type = DebugUIMessages.JavaDebugOptionsManager_Method_breakpoint___2; } else if (breakpoint instanceof IJavaWatchpoint) { type = DebugUIMessages.JavaDebugOptionsManager_Watchpoint___3; } else if (breakpoint instanceof IJavaLineBreakpoint) { type = DebugUIMessages.JavaDebugOptionsManager_Line_breakpoint___4; } IMarker marker = breakpoint.getMarker(); if (marker.exists()) { marker.setAttribute(IMarker.MESSAGE, type + info); } } } } }; final ISchedulingRule modifyWorkspaceRule = modifyWorkspaceRule(); class UpdateBreakpointMessagesJob extends Job { UpdateBreakpointMessagesJob() { super("Updating breakpoint messages"); } @Override protected IStatus run(IProgressMonitor monitor) { if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } try { ResourcesPlugin.getWorkspace().run(runnable, modifyWorkspaceRule, 0, null); } catch (CoreException e) { String errorMessage = "Failed to update breakpoint messages"; IStatus errorStatus = new Status(IStatus.ERROR, IJavaDebugUIConstants.PLUGIN_ID, errorMessage, e); return errorStatus; } return Status.OK_STATUS; } @Override public boolean belongsTo(Object family) { return UpdateBreakpointMessagesJob.class == family; } } ISchedulingRule currentRule = Job.getJobManager().currentRule(); if (currentRule != null && currentRule.contains(modifyWorkspaceRule)) { try { ResourcesPlugin.getWorkspace().run(runnable, modifyWorkspaceRule, 0, null); } catch (CoreException e) { JDIDebugUIPlugin.log(e); } } else { UpdateBreakpointMessagesJob updateBreakpointMessagesJob = new UpdateBreakpointMessagesJob(); updateBreakpointMessagesJob.schedule(); } }