mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
more useful parse of broken try-with-resources resource expression (IDEA-157118)
This commit is contained in:
+12
@@ -42,4 +42,16 @@ class TryWithResources {
|
||||
System.out.println(r);
|
||||
}
|
||||
}
|
||||
|
||||
static class Resource implements AutoCloseable {
|
||||
static Resource create() {
|
||||
return new Resource();
|
||||
}
|
||||
@Override public void close() { }
|
||||
}
|
||||
|
||||
void testMoreUsefulParseForIncorrectExpression() {
|
||||
try (<error descr="Declaration, final or effectively final variable expected">new Resource()</error>) {}
|
||||
try (<error descr="Declaration, final or effectively final variable expected">Resource.create()</error>) {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user