Deprecate some chat2 ChatManager APIs

because their functional interfaces clashes. This helps to prepare
Smack for Java 8 where such a construct results in a compile time error.
This commit is contained in:
Florian Schmaus 2018-02-10 12:08:40 +01:00
parent 6dfc20ee5e
commit 278c15d52d
1 changed files with 17 additions and 5 deletions

View File

@ -218,12 +218,24 @@ public final class ChatManager extends Manager {
*
* @param listener the listener to remove.
* @return <code>true</code> if the listener was active and got removed.
* @deprecated Use {@link #removeIncomingListener(IncomingChatMessageListener)} instead.
*/
@Deprecated
@SuppressWarnings("FunctionalInterfaceClash")
public boolean removeListener(IncomingChatMessageListener listener) {
return incomingListeners.remove(listener);
}
/**
* Remove an incoming chat message listener.
*
* @param listener the listener to remove.
* @return <code>true</code> if the listener was active and got removed.
*/
public boolean removeIncomingListener(IncomingChatMessageListener listener) {
return incomingListeners.remove(listener);
}
/**
* Add a new listener for outgoing chat messages.
*
@ -252,9 +264,11 @@ public final class ChatManager extends Manager {
*
* @param listener the listener to remove.
* @return <code>true</code> if the listener was active and got removed.
* @deprecated use {@link #removeOutgoingListener(OutgoingChatMessageListener)} instead.
*/
@Deprecated
public boolean removeListener(OutgoingChatMessageListener listener) {
return outgoingListeners.remove(listener);
return removeOutgoingListener(listener);
}
/**
@ -262,11 +276,9 @@ public final class ChatManager extends Manager {
*
* @param listener the listener to remove.
* @return <code>true</code> if the listener was active and got removed.
* @deprecated use {@link #removeListener(OutgoingChatMessageListener)} instead.
*/
@Deprecated
public boolean removeOutoingLIstener(OutgoingChatMessageListener listener) {
return removeListener(listener);
public boolean removeOutgoingListener(OutgoingChatMessageListener listener) {
return outgoingListeners.remove(listener);
}
/**