From 17bcfda43b9e939ac22d5247ef98905741650432 Mon Sep 17 00:00:00 2001 From: Roel Spilker Date: Tue, 2 Nov 2010 20:39:58 +0100 Subject: Issue 154: Add null-check to @Cleanup --- test/transform/resource/after-ecj/CleanupName.java | 10 ++++++++-- test/transform/resource/after-ecj/CleanupPlain.java | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'test/transform/resource/after-ecj') diff --git a/test/transform/resource/after-ecj/CleanupName.java b/test/transform/resource/after-ecj/CleanupName.java index 944a81e1..4011721b 100644 --- a/test/transform/resource/after-ecj/CleanupName.java +++ b/test/transform/resource/after-ecj/CleanupName.java @@ -10,7 +10,10 @@ class CleanupName { } finally { - o.toString(); + if ((o != null)) + { + o.toString(); + } } } void test2() { @@ -21,7 +24,10 @@ class CleanupName { } finally { - o.toString(); + if ((o != null)) + { + o.toString(); + } } } } \ No newline at end of file diff --git a/test/transform/resource/after-ecj/CleanupPlain.java b/test/transform/resource/after-ecj/CleanupPlain.java index 6754b4f6..fe8d7571 100644 --- a/test/transform/resource/after-ecj/CleanupPlain.java +++ b/test/transform/resource/after-ecj/CleanupPlain.java @@ -18,12 +18,18 @@ class CleanupPlain { } finally { - out.close(); + if ((out != null)) + { + out.close(); + } } } finally { - in.close(); + if ((in != null)) + { + in.close(); + } } } } \ No newline at end of file -- cgit