From 6439bba5cc09d6febc59bdc9e0d9bc25f1f1eb18 Mon Sep 17 00:00:00 2001
From: matthew_swift <matthew_swift@localhost>
Date: Wed, 01 Sep 2010 09:04:15 +0000
Subject: [PATCH] Various improvements:
---
sdk/src/com/sun/opends/sdk/tools/DataSource.java | 28 +++++++++++++++++++++-------
1 files changed, 21 insertions(+), 7 deletions(-)
diff --git a/sdk/src/com/sun/opends/sdk/tools/DataSource.java b/sdk/src/com/sun/opends/sdk/tools/DataSource.java
index 4c4438f..bb529f7 100644
--- a/sdk/src/com/sun/opends/sdk/tools/DataSource.java
+++ b/sdk/src/com/sun/opends/sdk/tools/DataSource.java
@@ -22,7 +22,7 @@
* CDDL HEADER END
*
*
- * Copyright 2009 Sun Microsystems, Inc.
+ * Copyright 2009-2010 Sun Microsystems, Inc.
*/
package com.sun.opends.sdk.tools;
@@ -65,10 +65,17 @@
{
lines = new ArrayList<String>();
final BufferedReader in = new BufferedReader(new FileReader(file));
- String line;
- while ((line = in.readLine()) != null)
+ try
{
- lines.add(line);
+ String line;
+ while ((line = in.readLine()) != null)
+ {
+ lines.add(line);
+ }
+ }
+ finally
+ {
+ in.close();
}
}
@@ -151,10 +158,17 @@
lines = new ArrayList<String>();
random = new Random(seed);
final BufferedReader in = new BufferedReader(new FileReader(file));
- String line;
- while ((line = in.readLine()) != null)
+ try
{
- lines.add(line);
+ String line;
+ while ((line = in.readLine()) != null)
+ {
+ lines.add(line);
+ }
+ }
+ finally
+ {
+ in.close();
}
}
--
Gitblit v1.10.0