From 7eb9dbe80caa7cb01842d76ebf2b84b3747aea0f Mon Sep 17 00:00:00 2001 From: "Egor.Ushakov" Date: Wed, 12 Oct 2016 12:40:18 +0300 Subject: [PATCH] IDEA-162354 Idea does not suggests to execute 'finally' block for try-with-resources expression - support jdk9 --- .../impl/src/com/intellij/debugger/actions/PopFrameAction.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/java/debugger/impl/src/com/intellij/debugger/actions/PopFrameAction.java b/java/debugger/impl/src/com/intellij/debugger/actions/PopFrameAction.java index d085e0a4e770..0e46dd22b57e 100644 --- a/java/debugger/impl/src/com/intellij/debugger/actions/PopFrameAction.java +++ b/java/debugger/impl/src/com/intellij/debugger/actions/PopFrameAction.java @@ -221,6 +221,9 @@ public class PopFrameAction extends DebuggerAction implements DumbAware { if (listElement instanceof PsiResourceVariable) { res.add(factory.createStatementFromText(((PsiResourceVariable)listElement).getName() + ".close();", tryStatement)); } + else if (listElement instanceof PsiResourceExpression) { + res.add(factory.createStatementFromText(((PsiResourceExpression)listElement).getExpression().getText() + ".close();", tryStatement)); + } } } PsiCodeBlock finallyBlock = tryStatement.getFinallyBlock();