public InflatableSet<T> build() { InflatableSet<T> set = new InflatableSet<T>(list); // make sure no further insertions are possible list = Collections.emptyList(); return set; } }
/** * Returns a shallow copy of this <tt>InflatableSet</tt> instance: the keys and * values themselves are not cloned. * * @return a shallow copy of this set */ @Override @SuppressFBWarnings(value = "CN_IDIOM", justification = "Deliberate, documented contract violation") @SuppressWarnings({"checkstyle:superclone", "CloneDoesntCallSuperClone"}) protected Object clone() { return new InflatableSet<T>(this); }
/** * Returns a shallow copy of this <tt>InflatableSet</tt> instance: the keys and * values themselves are not cloned. * * @return a shallow copy of this set */ @Override @SuppressFBWarnings(value = "CN_IDIOM", justification = "Deliberate, documented contract violation") @SuppressWarnings({"checkstyle:superclone", "CloneDoesntCallSuperClone"}) protected Object clone() { return new InflatableSet<T>(this); }
public InflatableSet<T> build() { InflatableSet<T> set = new InflatableSet<T>(list); // make sure no further insertions are possible list = Collections.emptyList(); return set; } }