prefStream = new BufferedOutputStream(out); props.store(prefStream, "FindBugs User Preferences"); prefStream.flush(); } finally { try { if (prefStream != null) prefStream.close(); } catch (IOException ioe) { }
File prefFile = new File(SystemProperties.getProperty("user.home"), PREF_FILE_NAME); write(new FileOutputStream(prefFile)); } catch (IOException e) { if (FindBugs.DEBUG) e.printStackTrace();
	public void write(OutputStream out) throws IOException {		Properties props = new Properties();		for (int i = 0; i < recentProjectsList.size(); i++) {			String projectName = recentProjectsList.get(i);			String key = "recent" + i;			props.put(key, projectName);		}		Iterator<Map.Entry<String, Boolean>> it = detectorEnablementMap.entrySet().iterator();		int i = 0;		while (it.hasNext()) {			Map.Entry<String, Boolean> entry = it.next();			props.put("detector" + i, entry.getKey() + "|" + String.valueOf(entry.getValue().booleanValue()));			i++;		}		// Save ProjectFilterSettings		props.put(FILTER_SETTINGS_KEY, filterSettings.toEncodedString());				// Backwards-compatibility: save minimum warning priority as integer.		// This will allow the properties file to work with older versions		// of FindBugs.		props.put(DETECTOR_THRESHOLD_KEY, String.valueOf(filterSettings.getMinPriorityAsInt()));				props.put(DEFAULT_DIRECTORY, System.getProperty("user.dir"));		OutputStream prefStream = null;		try {			prefStream = new BufferedOutputStream(out);			props.store(prefStream, "FindBugs User Preferences");			prefStream.flush();		} finally {			try {				if (prefStream != null)					prefStream.close();			} catch (IOException ioe) {			}		}	}