revert (java: minor optimization)

only freshly build stubs were counted, wrong default for restored ones
This commit is contained in:
Roman Shevchenko
2014-06-05 18:31:29 +04:00
parent f8e2be2ba9
commit e5fcad3b60
@@ -26,12 +26,13 @@ import com.intellij.psi.stubs.StubElement;
import com.intellij.util.io.StringRef;
import org.jetbrains.annotations.NotNull;
import java.util.List;
/**
* @author max
*/
public class PsiParameterStubImpl extends StubBase<PsiParameter> implements PsiParameterStub {
private StringRef myName;
private boolean myGeneratedName = true;
private final TypeInfo myType;
private final boolean myIsEllipsis;
@@ -80,11 +81,18 @@ public class PsiParameterStubImpl extends StubBase<PsiParameter> implements PsiP
public void setName(String name) {
myName = StringRef.fromString(name);
myGeneratedName = false;
}
public boolean isAutoGeneratedName() {
return myGeneratedName;
final List children = getParentStub().getChildrenStubs();
int paramIndex = 0;
for (Object o : children) {
if (o instanceof PsiParameterStub) {
paramIndex++;
if (o == this) break;
}
}
return ("p" + paramIndex).equals(getName());
}
@Override