Search in sources :

Example 1 with GrFinallyClause

use of org.jetbrains.plugins.groovy.lang.psi.api.statements.GrFinallyClause in project intellij-community by JetBrains.

the class GroovyTryUnwrapper method doUnwrap.

@Override
protected void doUnwrap(final PsiElement element, final Context context) throws IncorrectOperationException {
    GrTryCatchStatement trySt = (GrTryCatchStatement) element;
    context.extractFromCodeBlock(trySt.getTryBlock(), trySt);
    GrFinallyClause finallyClause = trySt.getFinallyClause();
    if (finallyClause != null) {
        context.extractFromCodeBlock(finallyClause.getBody(), trySt);
    }
    context.delete(trySt);
}
Also used : GrTryCatchStatement(org.jetbrains.plugins.groovy.lang.psi.api.statements.GrTryCatchStatement) GrFinallyClause(org.jetbrains.plugins.groovy.lang.psi.api.statements.GrFinallyClause)

Aggregations

GrFinallyClause (org.jetbrains.plugins.groovy.lang.psi.api.statements.GrFinallyClause)1 GrTryCatchStatement (org.jetbrains.plugins.groovy.lang.psi.api.statements.GrTryCatchStatement)1