public void read(InputStream in) throws IOException { BufferedInputStream prefStream = null; Properties props = new Properties();
public void read() { File prefFile = new File(SystemProperties.getProperty("user.home"), PREF_FILE_NAME); if (!prefFile.exists() || !prefFile.isFile()) return;
	public void read(InputStream in) throws IOException {		BufferedInputStream prefStream = null;		Properties props = new Properties();		try {			prefStream = new BufferedInputStream(in);			props.load(prefStream);		} finally {			try {				if (prefStream != null)					prefStream.close();			} catch (IOException ioe) {				// Ignore			}		}		if (props.size() == 0)			return;		for (int i = 0; i < MAX_RECENT_FILES; i++) {			String key = "recent" + i;			String projectName = (String) props.get(key);			if (projectName != null)				recentProjectsList.add(projectName);		}		int i = 0;		while (true) {			String key = "detector" + i;			String detectorState = (String) props.get(key);			if (detectorState == null)				break;			int pipePos = detectorState.indexOf("|");			if (pipePos >= 0) {				String name = detectorState.substring(0, pipePos);				String enabled = detectorState.substring(pipePos + 1);				detectorEnablementMap.put(name, Boolean.valueOf(enabled));			}			i++;		}		if (props.get(FILTER_SETTINGS_KEY) != null) {			// Properties contain encoded project filter settings.			filterSettings = ProjectFilterSettings.fromEncodedString(props.getProperty(FILTER_SETTINGS_KEY));		} else {			// Properties contain only minimum warning priority threshold (probably).			// We will honor this threshold, and enable all bug categories.			String threshold = (String) props.get(DETECTOR_THRESHOLD_KEY);			if (threshold != null) {				try {					int detectorThreshold = Integer.parseInt(threshold);					setUserDetectorThreshold(detectorThreshold);				} catch (NumberFormatException nfe) {					//Ok to ignore				}			}		}				String dd = (String)props.get(DEFAULT_DIRECTORY);		if (dd != null)			System.setProperty("user.dir", dd);	}