From f1d68efbd516ea37ed12a0d2da430b59b8e418f9 Mon Sep 17 00:00:00 2001 From: "Brian S. O'Neill" Date: Tue, 30 Jan 2007 03:19:58 +0000 Subject: More cursor closing paranoia. --- src/main/java/com/amazon/carbonado/layout/Layout.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/main/java/com/amazon/carbonado/layout') diff --git a/src/main/java/com/amazon/carbonado/layout/Layout.java b/src/main/java/com/amazon/carbonado/layout/Layout.java index 62e29f2..1c6b63d 100644 --- a/src/main/java/com/amazon/carbonado/layout/Layout.java +++ b/src/main/java/com/amazon/carbonado/layout/Layout.java @@ -231,13 +231,17 @@ public class Layout { .orderBy("ordinal") .fetch(); - List list = new ArrayList(); + try { + List list = new ArrayList(); - while (cursor.hasNext()) { - list.add(new LayoutProperty(cursor.next())); - } + while (cursor.hasNext()) { + list.add(new LayoutProperty(cursor.next())); + } - mAllProperties = Collections.unmodifiableList(list); + mAllProperties = Collections.unmodifiableList(list); + } finally { + cursor.close(); + } } return mAllProperties; -- cgit v1.2.3