Replace val with native final var in Java >= 10

This commit is contained in:
Rawi01 authored and Roel Spilker committed 2021-09-06 11:58:05 +02:00
1 parent e050dafc90
commit fdcbaa033d
36 files changed
+128 -16

No files matched your search

@@ -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();
}
}
}