public static void createMarkers ( final IJavaProject javaProject , final SortedBugCollection theCollection , final ISchedulingRule rule , IProgressMonitor monitor ) { if ( monitor . isCanceled ( ) ) { return ; } final List < MarkerParameter > bugParameters = createBugParameters ( javaProject , theCollection , monitor ) ; if ( monitor . isCanceled ( ) ) { return ; } WorkspaceJob wsJob = new WorkspaceJob ( "Creating SpotBugs markers" ) { @ Override public IStatus runInWorkspace ( IProgressMonitor monitor1 ) throws CoreException { IProject project = javaProject . getProject ( ) ; try { new MarkerReporter ( bugParameters , theCollection , project ) . run ( monitor1 ) ; } catch ( CoreException e ) { FindbugsPlugin . getDefault ( ) . logException ( e , "Core exception on add marker" ) ; return e . getStatus ( ) ; } return monitor1 . isCanceled ( ) ? Status . CANCEL_STATUS : Status . OK_STATUS ; } } ; wsJob . setRule ( rule ) ; wsJob . setSystem ( true ) ; wsJob . setUser ( false ) ; wsJob . schedule ( ) ; }
Create an Eclipse marker for given BugInstance .