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
/*******************************************************************************
 * Copyright (c) 2000, 2003 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/