mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 08:15:48 +00:00
Replace val with native final var in Java >= 10
This commit is contained in:
1 parent
e050dafc90
commit
fdcbaa033d
36 files changed
+128
-16
No files matched your search
@@ -0,0 +1,19 @@
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import lombok.val;
|
||||
public class ValToNative {
|
||||
public ValToNative() {
|
||||
super();
|
||||
}
|
||||
private void test() throws IOException {
|
||||
final @val var intField = 1;
|
||||
for (final @val var s : Arrays.asList("1"))
|
||||
{
|
||||
final @val var s2 = s;
|
||||
}
|
||||
try (final @val var in = getClass().getResourceAsStream("ValToNative.class"))
|
||||
{
|
||||
final @val var j = in.read();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user