Bug 52062 [spell checking] SpellCheckEngine.getAvailableLocales() should close its input streams
3.0M7 stable. I was just digging around the new code out of curiousity and found a place where streams are opened but never closed. I believe this is not strictly a resource leak because Java finalization will eventually close the stream, but it wouldn't hurt to do it explicitly. stream= url.openStream(); if (stream != null) result.add(locale); stream.close(); // add me As an aside, this looks like a very indirect way of iterating over dictionaries. Perhaps they should be supplied via fragments bound to an appropriate extension point. Also, the function always includes the default locale even if no dictionaries were found. I think this behaviour is misleading and prevents the UI from presenting a more useful "no dictionaries available" kind of cue, if none were installed (as in M7?). Looks good. I hope this support gets generalized somewhat and moved into org.eclipse.text eventually.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/spelling/SpellCheckEngine.java
}
		result.add(getDefaultLocale());
		return result;
	}
	/**
	 * Returns the default locale for this engine.
	 * 
	 * @return The default locale
	 */
	public static Locale getDefaultLocale() {
		return Locale.US;
	}
	/**
	 * Returns the dictionary location.
	 * 
	 * @throws MalformedURLException
	 *                    if the URL could not be created
	 * @return The dictionary location, or <code>null</code> iff the location
	 *               is not known
	 */
	public static URL getDictionaryLocation() throws MalformedURLException {
		final JavaPlugin plugin= JavaPlugin.getDefault();
		if (plugin != null)
			return new URL(plugin.getDescriptor().getInstallURL(), DICTIONARY_LOCATION);
		return null;
	}
	/**
	 * Returns the singleton instance of the spell check engine.
	 * 
	 * @return The singleton instance of the spell check engine