private static void readBugCollectionAndProject ( IProject project , IProgressMonitor monitor ) throws IOException , DocumentException , CoreException { SortedBugCollection bugCollection ; IPath bugCollectionPath = getBugCollectionFile ( project ) ; // Don't turn the path to an IFile because it isn't local to the // project. // see the javadoc for org.eclipse.core.runtime.Plugin File bugCollectionFile = bugCollectionPath . toFile ( ) ; if ( ! bugCollectionFile . exists ( ) ) { // throw new // FileNotFoundException(bugCollectionFile.getLocation().toOSString()); getDefault ( ) . logInfo ( "creating new bug collection: " + bugCollectionPath . toOSString ( ) ) ; createDefaultEmptyBugCollection ( project ) ; // since we no longer // throw, have to do this // here return ; } UserPreferences prefs = getUserPreferences ( project ) ; bugCollection = new SortedBugCollection ( ) ; bugCollection . getProject ( ) . setGuiCallback ( new EclipseGuiCallback ( project ) ) ; bugCollection . readXML ( bugCollectionFile ) ; cacheBugCollectionAndProject ( project , bugCollection , bugCollection . getProject ( ) ) ; }
Read saved bug collection and findbugs project from file . Will populate the bug collection and findbugs project session properties if successful . If there is no saved bug collection and project for the eclipse project then FileNotFoundException will be thrown .