mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
global inspections: store parameter references only once
This commit is contained in:
@@ -78,6 +78,26 @@ public class RefMethodImpl extends RefJavaElementImpl implements RefMethod {
|
||||
setConstructor(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void add(RefEntity child) {
|
||||
if (child instanceof RefParameter) {
|
||||
return;
|
||||
}
|
||||
super.add(child);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<RefEntity> getChildren() {
|
||||
List<RefEntity> superChildren = super.getChildren();
|
||||
if (myParameters == null) return superChildren;
|
||||
if (superChildren == null || superChildren.isEmpty()) return Arrays.<RefEntity>asList(myParameters);
|
||||
|
||||
List<RefEntity> allChildren = new ArrayList<RefEntity>(superChildren.size() + myParameters.length);
|
||||
allChildren.addAll(superChildren);
|
||||
Collections.addAll(allChildren, myParameters);
|
||||
return allChildren;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initialize() {
|
||||
final PsiMethod method = (PsiMethod)getElement();
|
||||
|
||||
Reference in New Issue
Block a user