1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-19 09:42:11 +03:00

Lots of unclosed input and output streams now properly closed. They were preventing Boards Manager from working on Windows

This commit is contained in:
Federico Fissore
2015-05-04 15:44:34 +02:00
parent 71106edbf8
commit cd49d29e52
15 changed files with 252 additions and 201 deletions

View File

@ -21,18 +21,14 @@
*/
package processing.app.helpers;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import processing.app.legacy.PApplet;
import java.io.*;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.SortedSet;
import java.util.TreeSet;
import processing.app.legacy.PApplet;
@SuppressWarnings("serial")
public class PreferencesMap extends LinkedHashMap<String, String> {
@ -71,7 +67,15 @@ public class PreferencesMap extends LinkedHashMap<String, String> {
* @throws IOException
*/
public void load(File file) throws IOException {
load(new FileInputStream(file));
FileInputStream fileInputStream = null;
try {
fileInputStream = new FileInputStream(file);
load(fileInputStream);
} finally {
if (fileInputStream != null) {
fileInputStream.close();
}
}
}
protected String processPlatformSuffix(String key, String suffix, boolean isCurrentPlatform) {