PsiParameter (int index) { if (index < 0) { throw new IllegalArgumentException("index is negative: " + index); } PsiParameterListStub stub = getGreenStub(); if (stub != null) { int count = 0; for (StubElement<?> child : stub.getChildrenStubs()) { if (child.getStubType() == JavaStubElementTypes.PARAMETER) { if (count == index) return (PsiParameter)child.getPsi(); count++; } } } else { CompositeElement node = getNode(); int count = 0; for (ASTNode child = node.getFirstChildNode(); child != null; child = child.getTreeNext()) { if (child.getElementType() == JavaStubElementTypes.PARAMETER) { if (count == index) return (PsiParameter)child.getPsi(); count++; } } } return null; }