mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
java: minor optimization
This commit is contained in:
+4
-12
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2014 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.
|
||||
@@ -26,13 +26,12 @@ 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;
|
||||
|
||||
@@ -81,18 +80,11 @@ public class PsiParameterStubImpl extends StubBase<PsiParameter> implements PsiP
|
||||
|
||||
public void setName(String name) {
|
||||
myName = StringRef.fromString(name);
|
||||
myGeneratedName = false;
|
||||
}
|
||||
|
||||
public boolean isAutoGeneratedName() {
|
||||
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());
|
||||
return myGeneratedName;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user