can complete normally for nested try-with-resources (IDEA-138961)

This commit is contained in:
Anna Kozlova
2015-04-09 13:34:17 +02:00
parent b9035c54ad
commit 4ee27fecce
3 changed files with 35 additions and 2 deletions

View File

@@ -0,0 +1,25 @@
import java.util.Collections;
import java.util.Set;
class Test {
Database database;
Set<Long> getItems() {
return database.perform(connection -> {
try (AutoCloseable c = null) {
try (AutoCloseable d = null) {
return Collections.emptySet();
}
}
});
}
public interface Database {
<V> V perform(BusinessLogic<V> logic);
}
public interface BusinessLogic<V> {
V execute(String connection) throws Exception;
}
}