System.out.println("Looking for detecors in: " + findBugsHome);
System.out.println("Looking for detectors in: " + findBugsHome);
	public void work(Collection files) throws CoreException {		if (files == null) {			if (DEBUG) {				System.out.println("No files to build"); //$NON-NLS-1$			}		}		String findBugsHome = FindbugsPlugin.getFindBugsEnginePluginLocation();		if (DEBUG) {			System.out.println("Looking for detecors in: " + findBugsHome); //$NON-NLS-1$		}		// FIXME hardcoded findbugs.home property		System.setProperty("findbugs.home", findBugsHome); //$NON-NLS-1$		Project findBugsProject = new Project();		Iterator iter = files.iterator();		while (iter.hasNext()) {			// get the resource			IResource res = (IResource) iter.next();			if (Util.isJavaArtifact(res)) {				res.deleteMarkers(					FindBugsMarker.NAME,					true,					IResource.DEPTH_INFINITE);			}			if (Util.isClassFile(res)) {				// add this file to the work list:				String fileName = res.getLocation().toOSString();				res.refreshLocal(IResource.DEPTH_INFINITE, null);				if (DEBUG) {					System.out.println(						"Resource: " + fileName //$NON-NLS-1$						+ ": in sync: " + res.isSynchronized(IResource.DEPTH_INFINITE)); //$NON-NLS-1$				}				findBugsProject.addFile(fileName);			}		}		Reporter bugReporter = new Reporter(this.project, this.monitor, findBugsProject);		bugReporter.setPriorityThreshold(Detector.LOW_PRIORITY);    		String[] classPathEntries = createClassPathEntries();		// add to findbugs classpath		for (int i = 0; i < classPathEntries.length; i++) {			findBugsProject.addAuxClasspathEntry(classPathEntries[i]);		}        		FindBugs findBugs = new FindBugs(bugReporter, findBugsProject);		// configure detectors.		findBugs.setUserPreferences(this.userPrefs);		try {			// Perform the analysis!			findBugs.execute();						// Merge new results into existing results.			updateBugCollection(findBugsProject, bugReporter);		}		catch (InterruptedException e) {			if (DEBUG) {				e.printStackTrace();			}			// @see IncrementalProjectBuilder.build			//throw new OperationCanceledException("FindBugs operation cancelled by user");		} catch (RuntimeException e) {			throw e;		} catch (Exception e) {			FindbugsPlugin.getDefault().logException(e, "Error performing FindBugs analysis");		}	}