PsiExpression (@Nullable PsiExpression expression) { expression = PsiUtil.skipParenthesizedExprDown(expression); if (!(expression instanceof final PsiReferenceExpression reference)) return null; final String referenceName = reference.getReferenceName(); if (!HardcodedMethodConstants.LENGTH.equals(referenceName)) return null; final PsiExpression qualifier = reference.getQualifierExpression(); if (qualifier == null) return null; final PsiType type = qualifier.getType(); if (type == null || type.getArrayDimensions() <= 0) return null; return qualifier; }