--- a/langtools/test/tools/javac/TryWithResources/TwrForVariable2.java Tue Dec 08 21:02:07 2015 +0100
+++ b/langtools/test/tools/javac/TryWithResources/TwrForVariable2.java Wed Dec 09 14:26:56 2015 +0100
@@ -8,6 +8,7 @@
public static void main(String... args) {
TwrForVariable2 v = new TwrForVariable2();
TwrForVariable3[] v2 = new TwrForVariable3[1];
+ TwrForVariable3[][] v3 = new TwrForVariable3[1][1];
try (final v) {
fail("no modifiers before variables");
@@ -24,9 +25,15 @@
try (v2[0]) {
fail("array access not allowed");
}
+ try (v3[0][0]) {
+ fail("array access not allowed");
+ }
try (args.length == 0 ? v : v) {
fail("general expressions not allowed");
}
+ try ((TwrForVariable2)null) {
+ fail("null as variable is not allowed");
+ }
}
static void fail(String reason) {