Class InterningVisitor

All Implemented Interfaces:
TreeVisitor<Void,Void>

public final class InterningVisitor extends BaseTypeVisitor<InterningAnnotatedTypeFactory>
Typechecks source code for interning violations. A type is considered interned if its primary annotation is Interned or InternedDistinct. This visitor reports errors or warnings for violations for the following cases:
  1. either argument to a "==" or "!=" comparison is not Interned (error "not.interned"). As a special case, the comparison is permitted if either arugment is InternedDistinct.
  2. the receiver and argument for a call to an equals method are both Interned (optional warning "unnecessary.equals")
See Also: