Class AnnotationMirrorSet

java.lang.Object
org.checkerframework.javacutil.AnnotationMirrorSet
All Implemented Interfaces:
Iterable<AnnotationMirror>, Collection<AnnotationMirror>, NavigableSet<@KeyFor("this") AnnotationMirror>, SequencedCollection<AnnotationMirror>, SequencedSet<AnnotationMirror>, Set<AnnotationMirror>, SortedSet<AnnotationMirror>, org.plumelib.util.DeepCopyable<AnnotationMirrorSet>

public class AnnotationMirrorSet extends Object implements NavigableSet<@KeyFor("this") AnnotationMirror>, org.plumelib.util.DeepCopyable<AnnotationMirrorSet>
The Set interface defines many methods with respect to the equals method. This implementation of Set violates those specifications, but fulfills the same property using AnnotationUtils.areSame(javax.lang.model.element.AnnotationMirror, javax.lang.model.element.AnnotationMirror) rather than equals.

For example, the specification for the contains(Object o) method says: "returns true if and only if this collection contains at least one element e such that (o == null ? e == null : o.equals(e))." The specification for contains(java.lang.Object) is "returns true if and only if this collection contains at least one element e such that (o == null ? e == null : AnnotationUtils.areSame(o, e))".

AnnotationMirror is an interface and not all implementing classes provide a correct equals method; therefore, the existing implementations of Set cannot be used.