X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fnotify%2FListNotification.java;h=6447990975beec379f04fb1e79e630fe40699268;hb=2e03e9dddbea4b81aacaf1aa316f5c3ccffd4bf9;hp=57cb7fe1e23e303b5c17d14c3491aa113a0fb9d0;hpb=c55737094ab4551ae6d9805e4397b25322c87c78;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/notify/ListNotification.java b/src/main/java/net/pterodactylus/sone/notify/ListNotification.java index 57cb7fe..6447990 100644 --- a/src/main/java/net/pterodactylus/sone/notify/ListNotification.java +++ b/src/main/java/net/pterodactylus/sone/notify/ListNotification.java @@ -1,5 +1,5 @@ /* - * Sone - ListNotification.java - Copyright © 2010 David Roden + * Sone - ListNotification.java - Copyright © 2010–2013 David Roden * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -141,7 +141,9 @@ public class ListNotification extends TemplateNotification { * The element to remove */ public void remove(T element) { - elements.remove(element); + while (elements.remove(element)) { + /* do nothing, just remove all instances of the element. */ + } if (elements.isEmpty()) { dismiss(); } @@ -152,9 +154,6 @@ public class ListNotification extends TemplateNotification { // ABSTRACTNOTIFICATION METHODS // - /** - * {@inheritDoc} - */ @Override public void dismiss() { super.dismiss(); @@ -165,9 +164,6 @@ public class ListNotification extends TemplateNotification { // OBJECT METHODS // - /** - * {@inheritDoc} - */ @Override public int hashCode() { int hashCode = super.hashCode(); @@ -177,15 +173,15 @@ public class ListNotification extends TemplateNotification { return hashCode; } - /** - * {@inheritDoc} - */ @Override public boolean equals(Object object) { if (!(object instanceof ListNotification)) { return false; } ListNotification listNotification = (ListNotification) object; + if (!super.equals(listNotification)) { + return false; + } if (!key.equals(listNotification.key)) { return false; }