[groovy] use utility method instead of own implementation

Use findChildrenByClass() in GrMethodCallExpressionImpl
.getClosureArguments()
This commit is contained in:
Daniil Ovchinnikov
2017-06-06 13:48:17 +03:00
parent 6fbca226c9
commit 27a2f1517d
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2016 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,11 +17,9 @@
package org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.path;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import com.intellij.util.ArrayUtil;
import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.groovy.lang.parser.GroovyElementTypes;
import org.jetbrains.plugins.groovy.lang.psi.GroovyElementVisitor;
import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElementFactory;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.arguments.GrArgumentList;
@@ -31,8 +29,6 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.path.GrC
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.path.GrMethodCallExpression;
import org.jetbrains.plugins.groovy.lang.psi.impl.statements.expressions.GrMethodCallImpl;
import java.util.List;
/**
* @author ilyas
*/
@@ -78,7 +74,6 @@ public class GrMethodCallExpressionImpl extends GrMethodCallImpl implements GrMe
@Override
@NotNull
public GrClosableBlock[] getClosureArguments() {
final List<PsiElement> children = findChildrenByType(GroovyElementTypes.CLOSABLE_BLOCK);
return children.toArray(new GrClosableBlock[children.size()]);
return findChildrenByClass(GrClosableBlock.class);
}
}