Commit 87d63321 authored by Caleb C. Sander's avatar Caleb C. Sander
Browse files

Fix return value from ISet.add()

parent 7f14cf1d
1 merge request!1Fix return value from ISet.add()
Pipeline #28883 failed with stage
in 0 seconds
Showing with 1 addition and 12 deletions
+1 -12
......@@ -79,7 +79,7 @@ public class ISet<E> implements Iterable<E> {
* element
*/
public boolean add(E e) {
return this.internalDictionary.put(e, new Object()) != null;
return this.internalDictionary.put(e, new Object()) == null;
}
......@@ -100,17 +100,6 @@ public class ISet<E> implements Iterable<E> {
return this.internalDictionary.remove(e) != null;
}
/**
* Removes all of the elements from this set (optional operation).
* The set will be empty after this call returns.
*
* @throws UnsupportedOperationException if the {@code clear} method
* is not supported by this set
*/
public void clear() {
throw new UnsupportedOperationException();
}
@Override
public String toString() {
StringBuilder b = new StringBuilder();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment