Author: noelr
Date: 2009-08-12 10:28:37 -0700 (Wed, 12 Aug 2009)
New Revision: 17793
Modified:
cytoscape/trunk/tests/cytoscape/plugin/PluginManagerTest.java
Log:
Second batch of fixes for Bug 1988
These are the files that required non-trivial alteration
Modified: cytoscape/trunk/tests/cytoscape/plugin/PluginManagerTest.java
===================================================================
--- cytoscape/trunk/tests/cytoscape/plugin/PluginManagerTest.java
2009-08-12 17:18:03 UTC (rev 17792)
+++ cytoscape/trunk/tests/cytoscape/plugin/PluginManagerTest.java
2009-08-12 17:28:37 UTC (rev 17793)
@@ -680,15 +680,27 @@
try {
BufferedReader reader = new BufferedReader( new
FileReader(fileToCopy) );
- BufferedWriter writer = new BufferedWriter( new
FileWriter(tempFile) );
- String line = null;
- while ((line = reader.readLine()) != null) {
- writer.write(line);
- writer.newLine();
- writer.flush();
- }
- reader.close();
- writer.close();
+ try {
+ BufferedWriter writer = new BufferedWriter( new
FileWriter(tempFile) );
+ try {
+ String line = null;
+ while ((line = reader.readLine()) != null) {
+ writer.write(line);
+ writer.newLine();
+ writer.flush();
+ }
+ }
+ finally {
+ if (writer != null) {
+ writer.close();
+ }
+ }
+ }
+ finally {
+ if (reader != null) {
+ reader.close();
+ }
+ }
} catch (Exception e) {
e.printStackTrace();
}
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---