ASTNode (int role) { LOG.assertTrue(ChildRole.isUnique(role), role); switch (role) { case ChildRole.REFERENCE_NAME: return TreeUtil.findChildBackward(this, JavaTokenType.IDENTIFIER); case ChildRole.REFERENCE_PARAMETER_LIST: TreeElement lastChild = getLastChildNode(); return lastChild.getElementType() == JavaElementType.REFERENCE_PARAMETER_LIST ? lastChild : null; case ChildRole.QUALIFIER: return findChildByType(JavaElementType.JAVA_CODE_REFERENCE); case ChildRole.DOT: return findChildByType(JavaTokenType.DOT); } return null; }