aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2013-05-24 01:02:13 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2013-05-24 01:02:13 +0200
commitb3b91a0ddd1770f8646d27e421e2cfef96940f8f (patch)
treedafd250352d51d2c0f86feeb2d42541e792b1ae7
parent2c53dc7a6567be0d9e3f9aaeb298befe194f80c7 (diff)
downloadlombok-b3b91a0ddd1770f8646d27e421e2cfef96940f8f.tar.gz
lombok-b3b91a0ddd1770f8646d27e421e2cfef96940f8f.tar.bz2
lombok-b3b91a0ddd1770f8646d27e421e2cfef96940f8f.zip
added test case and delombok result for issue 520 (val in try-with-resources). WARNING: I havent added ecj test output yet because so far there is no ecj7 available for testing with our buildscripts. I should fix that first and then Ill sort this out.
-rw-r--r--test/transform/resource/after-delombok/ValInTryWithResources.java10
-rw-r--r--test/transform/resource/before/ValInTryWithResources.java12
2 files changed, 22 insertions, 0 deletions
diff --git a/test/transform/resource/after-delombok/ValInTryWithResources.java b/test/transform/resource/after-delombok/ValInTryWithResources.java
new file mode 100644
index 00000000..73f8d1a2
--- /dev/null
+++ b/test/transform/resource/after-delombok/ValInTryWithResources.java
@@ -0,0 +1,10 @@
+//version 7
+import java.io.IOException;
+public class ValInTryWithResources {
+ public void whyTryInsteadOfCleanup() throws IOException {
+ try (final java.io.InputStream in = getClass().getResourceAsStream("ValInTryWithResources.class");) {
+ final java.io.InputStream i = in;
+ final int j = in.read();
+ }
+ }
+}
diff --git a/test/transform/resource/before/ValInTryWithResources.java b/test/transform/resource/before/ValInTryWithResources.java
new file mode 100644
index 00000000..780e1c71
--- /dev/null
+++ b/test/transform/resource/before/ValInTryWithResources.java
@@ -0,0 +1,12 @@
+//version 7
+import lombok.val;
+import java.io.IOException;
+
+public class ValInTryWithResources {
+ public void whyTryInsteadOfCleanup() throws IOException {
+ try (val in = getClass().getResourceAsStream("ValInTryWithResources.class")) {
+ val i = in;
+ val j = in.read();
+ }
+ }
+} \ No newline at end of file