String homeDir = System.getProperty("findbugs.home"); if (homeDir == null) { System.err.println("Error: The findbugs.home property is not set!"); System.exit(1); }
String homeDir = FindBugs.getHome();
	private void loadPlugins() {		// Load all detector plugins.			String homeDir = System.getProperty("findbugs.home");		if (homeDir == null) {			System.err.println("Error: The findbugs.home property is not set!");			System.exit(1);		}			File pluginDir = new File(homeDir + File.separator + "plugin");		File[] contentList = pluginDir.listFiles();		if (contentList == null) {			System.err.println("Error: The path " + pluginDir.getPath() + " does not seem to be a directory!");			System.exit(1);		}			int numLoaded = 0;		for (int i = 0; i < contentList.length; ++i) {			File file = contentList[i];			if (file.getName().endsWith(".jar")) {				try {					URL url = file.toURL();					PluginLoader pluginLoader = new PluginLoader(url);						// Register all of the detectors that this plugin contains					DetectorFactory[] detectorFactoryList = pluginLoader.getDetectorFactoryList();					for (int j = 0; j < detectorFactoryList.length; ++j)						registerDetector(detectorFactoryList[j]);						I18N i18n = I18N.instance();						// Register the BugPatterns					BugPattern[] bugPatternList = pluginLoader.getBugPatternList();					for (int j = 0; j < bugPatternList.length; ++j)						i18n.registerBugPattern(bugPatternList[j]);						// Register the BugCodes					BugCode[] bugCodeList = pluginLoader.getBugCodeList();					for (int j = 0; j < bugCodeList.length; ++j)						i18n.registerBugCode(bugCodeList[j]);						++numLoaded;				} catch (Exception e) {					System.err.println("Warning: could not load plugin " + file.getPath() + ": " + e.toString());				}			}		}			//System.out.println("Loaded " + numLoaded + " plugins");	}