Skip to content

Commit 76c5d99

Browse files
author
Federico Fissore
committed
ZipFile and Socket are not Closable in java 1.6
1 parent 181211e commit 76c5d99

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

app/src/processing/app/Editor.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,13 @@ protected String findClassInZipFile(String base, File file) {
966966
//System.err.println("Ignoring " + filename + " (" + e.getMessage() + ")");
967967
e.printStackTrace();
968968
} finally {
969-
IOUtils.closeQuietly(zipFile);
969+
if (zipFile != null) {
970+
try {
971+
zipFile.close();
972+
} catch (IOException e) {
973+
// noop
974+
}
975+
}
970976
}
971977
return null;
972978
}

arduino-core/src/processing/app/helpers/NetUtils.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package processing.app.helpers;
22

3-
import org.apache.commons.compress.utils.IOUtils;
4-
53
import java.io.IOException;
64
import java.net.InetAddress;
75
import java.net.InetSocketAddress;
@@ -45,7 +43,13 @@ private static boolean isPortOpen(InetAddress address, int port) {
4543
} catch (IOException e) {
4644
return false;
4745
} finally {
48-
IOUtils.closeQuietly(socket);
46+
if (socket != null) {
47+
try {
48+
socket.close();
49+
} catch (IOException e) {
50+
// noop
51+
}
52+
}
4953
}
5054
}
5155
}

0 commit comments

Comments
 (0)