From fdcbaa033d27b344adfea99d8d7bdd99cceacfb3 Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Tue, 2 Feb 2021 09:44:36 +0100 Subject: Replace val with native final var in Java >= 10 --- test/transform/resource/before/ValToNative.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/transform/resource/before/ValToNative.java (limited to 'test/transform/resource/before/ValToNative.java') diff --git a/test/transform/resource/before/ValToNative.java b/test/transform/resource/before/ValToNative.java new file mode 100644 index 00000000..3b4e6fa8 --- /dev/null +++ b/test/transform/resource/before/ValToNative.java @@ -0,0 +1,19 @@ +// version 10: +import java.io.IOException; +import java.util.Arrays; + +import lombok.val; + +public class ValToNative { + private void test() throws IOException { + val intField = 1; + + for (val s : Arrays.asList("1")) { + val s2 = s; + } + + try (val in = getClass().getResourceAsStream("ValToNative.class")) { + val j = in.read(); + } + } +} -- cgit