StackOverflow 文档 groovy 教程 传播运算符 它是无效的 它是无效的 Created: November-22, 2018 如果集合上有 null 对象,则不会抛出 NPE,而是返回 null: placeholderCopyassert ['cat', 'dog', 'fish', null]*.length() == [3, 3, 4, null]直接在 null 对象中使用它也是 null 安全的: placeholderCopydef nullCollection = null assert nullCollection*.length() == null 调用方法