Author: kono
Date: 2012-07-27 12:03:21 -0700 (Fri, 27 Jul 2012)
New Revision: 30023
Modified:
core3/impl/trunk/webservice-biomart-client-impl/src/main/java/org/cytoscape/io/webservice/biomart/rest/BiomartRestClient.java
core3/impl/trunk/webservice-biomart-client-impl/src/main/java/org/cytoscape/io/webservice/biomart/task/ImportTableTask.java
Log:
potential resource leaks had been fixed.
Modified:
core3/impl/trunk/webservice-biomart-client-impl/src/main/java/org/cytoscape/io/webservice/biomart/rest/BiomartRestClient.java
===================================================================
---
core3/impl/trunk/webservice-biomart-client-impl/src/main/java/org/cytoscape/io/webservice/biomart/rest/BiomartRestClient.java
2012-07-27 19:01:05 UTC (rev 30022)
+++
core3/impl/trunk/webservice-biomart-client-impl/src/main/java/org/cytoscape/io/webservice/biomart/rest/BiomartRestClient.java
2012-07-27 19:03:21 UTC (rev 30023)
@@ -283,7 +283,10 @@
is = connection.getInputStream();
} catch (Exception e) {
// Could not create connection.
+ is.close();
throw new IOException("Could not create connection.");
+ } finally {
+ is.close();
}
BufferedReader reader = new BufferedReader(new
InputStreamReader(is));
Modified:
core3/impl/trunk/webservice-biomart-client-impl/src/main/java/org/cytoscape/io/webservice/biomart/task/ImportTableTask.java
===================================================================
---
core3/impl/trunk/webservice-biomart-client-impl/src/main/java/org/cytoscape/io/webservice/biomart/task/ImportTableTask.java
2012-07-27 19:01:05 UTC (rev 30022)
+++
core3/impl/trunk/webservice-biomart-client-impl/src/main/java/org/cytoscape/io/webservice/biomart/task/ImportTableTask.java
2012-07-27 19:03:21 UTC (rev 30023)
@@ -12,11 +12,8 @@
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
-
import org.cytoscape.io.webservice.biomart.BiomartQuery;
import org.cytoscape.io.webservice.biomart.rest.BiomartRestClient;
-import org.cytoscape.model.CyNetwork;
-import org.cytoscape.model.CyNode;
import org.cytoscape.model.CyRow;
import org.cytoscape.model.CyTable;
import org.cytoscape.model.CyTableFactory;
@@ -71,13 +68,15 @@
final BufferedReader result =
client.sendQuery(query.getQueryString());
- if (result.ready() == false)
+ if (result.ready() == false) {
+ result.close();
throw new IOException("Could not get result.");
-
+ }
taskMonitor.setStatusMessage("Creating global table...");
final CyTable newTable = createGlobalTable(result,
query.getKeyColumnName());
+ result.close();
tables.add(newTable);
--
You received this message because you are subscribed to the Google Groups
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/cytoscape-cvs?hl=en.