mirror of
https://github.com/tiennm99/lombok.git
synced 2026-05-28 10:23:55 +00:00
Replace val with native final var in Java >= 10
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user