mirror of
https://github.com/arduino/Arduino.git
synced 2025-02-11 05:54:16 +01:00
ZipFile and Socket are not Closable in java 1.6
This commit is contained in:
parent
181211eb40
commit
76c5d99123
@ -966,7 +966,13 @@ public class Editor extends JFrame implements RunnerListener {
|
|||||||
//System.err.println("Ignoring " + filename + " (" + e.getMessage() + ")");
|
//System.err.println("Ignoring " + filename + " (" + e.getMessage() + ")");
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
IOUtils.closeQuietly(zipFile);
|
if (zipFile != null) {
|
||||||
|
try {
|
||||||
|
zipFile.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
// noop
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
package processing.app.helpers;
|
package processing.app.helpers;
|
||||||
|
|
||||||
import org.apache.commons.compress.utils.IOUtils;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.InetAddress;
|
import java.net.InetAddress;
|
||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
@ -45,7 +43,13 @@ public abstract class NetUtils {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
return false;
|
return false;
|
||||||
} finally {
|
} finally {
|
||||||
IOUtils.closeQuietly(socket);
|
if (socket != null) {
|
||||||
|
try {
|
||||||
|
socket.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
// noop
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user