Closure has GrParameters instead of PsiParameters

This commit is contained in:
Maxim Medvedev
2011-02-04 14:15:33 +03:00
parent 28c89d2f31
commit 7cda1e3eab
2 changed files with 6 additions and 7 deletions
@@ -17,7 +17,6 @@
package org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiParameter;
import com.intellij.psi.PsiType;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrParametersOwner;
@@ -43,7 +42,7 @@ public interface GrClosableBlock extends GrExpression, GrCodeBlock, GrParameters
@Nullable
PsiType getReturnType();
PsiParameter[] getAllParameters();
GrParameter[] getAllParameters();
@Nullable
PsiElement getArrow();
@@ -51,7 +51,7 @@ import org.jetbrains.plugins.groovy.refactoring.GroovyNamesUtil;
* @author ilyas
*/
public class GrClosableBlockImpl extends GrBlockImpl implements GrClosableBlock {
private volatile PsiParameter mySyntheticItParameter;
private volatile GrParameter mySyntheticItParameter;
private GrVariable myOwner;
public GrClosableBlockImpl(@NotNull ASTNode node) {
@@ -124,9 +124,9 @@ public class GrClosableBlockImpl extends GrBlockImpl implements GrClosableBlock
return GrParameter.EMPTY_ARRAY;
}
public PsiParameter[] getAllParameters() {
public GrParameter[] getAllParameters() {
if (hasParametersSection()) return getParameters();
return new PsiParameter[]{getSyntheticItParameter()};
return new GrParameter[]{getSyntheticItParameter()};
}
@Override
@@ -168,9 +168,9 @@ public class GrClosableBlockImpl extends GrBlockImpl implements GrClosableBlock
mySyntheticItParameter = null;
}
public PsiParameter getSyntheticItParameter() {
public GrParameter getSyntheticItParameter() {
if (mySyntheticItParameter == null) {
PsiParameter fresh = new ClosureSyntheticParameter(this);
GrParameter fresh = new ClosureSyntheticParameter(this);
synchronized (this) {
if (mySyntheticItParameter == null) {
mySyntheticItParameter = fresh;