Java SE 8 已将新方法 visitIntersection 添加到 javax.lang.model.type.TypeVisitor 接口。 此规则将检测并标记实现此接口但不实现 visitIntersection(IntersectionType t, P p) 方法的 Java 类。任何不具有直接实现此 Java 接口的 visitIntersection 方法的类都不会进行编译。
由于未来可能的接口扩展,因此 TypeVisitor Java 文档提醒用户不要直接实现此接口。应扩展实用程序访问程序之一,而不是直接实现此接口。