Commit 61c3de6a authored by Adam Blank's avatar Adam Blank
Browse files

Merge branch 'fix/add' into 'master'

Fix return value from ISet.add()

See merge request !1
Pipeline #46463 canceled 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> { ...@@ -79,7 +79,7 @@ public class ISet<E> implements Iterable<E> {
* element * element
*/ */
public boolean add(E e) { 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> { ...@@ -100,17 +100,6 @@ public class ISet<E> implements Iterable<E> {
return this.internalDictionary.remove(e) != null; 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 @Override
public String toString() { public String toString() {
StringBuilder b = new StringBuilder(); 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