final BufferedReader reader= new BufferedReader(new InputStreamReader(stream)); line++; while ((word= reader.readLine()) != null) { line++; hashWord(word);
CharsetDecoder decoder= Charset.forName(System.getProperty("file.encoding")).newDecoder(); decoder.onMalformedInput(CodingErrorAction.REPORT); decoder.onUnmappableCharacter(CodingErrorAction.REPORT); final BufferedReader reader= new BufferedReader(new InputStreamReader(stream, decoder));  boolean doRead= true; while (doRead) { try { word= reader.readLine(); } catch (MalformedInputException ex) {  decoder.onMalformedInput(CodingErrorAction.REPLACE); word= reader.readLine(); decoder.onMalformedInput(CodingErrorAction.REPORT);  String message= Messages.format(JavaUIMessages.AbstractSpellingDictionary_encodingError, new String[] { word, decoder.replacement(), url.toString() }); IStatus status= new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, IStatus.OK, message, ex); JavaPlugin.log(status);  doRead= word != null; continue; } doRead= word != null; if (doRead) hashWord(word);
	protected synchronized boolean load(final URL url) {		if (url != null) {			InputStream stream= null;			int line= 0;			try {				stream= url.openStream();				if (stream != null) {					String word= null;					final BufferedReader reader= new BufferedReader(new InputStreamReader(stream));					line++;					while ((word= reader.readLine()) != null) {						line++;						hashWord(word);					}					return true;				}			} catch (IOException exception) {				if (line > 0) {					String message= Messages.format(JavaUIMessages.AbstractSpellingDictionary_encodingError, new Object[] { new Integer(line), url.toString() });					IStatus status= new Status(IStatus.ERROR, JavaUI.ID_PLUGIN, IStatus.OK, message, exception);					JavaPlugin.log(status);				} else					JavaPlugin.log(exception);			} finally {				fMustLoad= false;				try {					if (stream != null)						stream.close();				} catch (IOException x) {				}			}		}		return false;	}