diff --git a/intellij/src/saros/intellij/ui/eventhandler/ConnectingFailureHandler.java b/intellij/src/saros/intellij/ui/eventhandler/ConnectingFailureHandler.java index 5349df5413..a5d778f99f 100644 --- a/intellij/src/saros/intellij/ui/eventhandler/ConnectingFailureHandler.java +++ b/intellij/src/saros/intellij/ui/eventhandler/ConnectingFailureHandler.java @@ -1,23 +1,17 @@ package saros.intellij.ui.eventhandler; -import saros.account.XMPPAccount; import saros.communication.connection.ConnectionHandler; -import saros.communication.connection.IConnectingFailureCallback; import saros.intellij.ui.util.NotificationPanel; import saros.ui.CoreMessages; /** Callback handler informing the user of a failed XMPP connection attempt. */ public class ConnectingFailureHandler { - @SuppressWarnings("FieldCanBeLocal") - private final IConnectingFailureCallback connectingFailureCallback = this::handleConnectionFailed; - public ConnectingFailureHandler(ConnectionHandler connectionHandler) { - connectionHandler.setCallback(connectingFailureCallback); - } - - public void handleConnectionFailed(XMPPAccount account, String errorMessage) { - // TODO offer user possibility of adjusting settings and re-connect - NotificationPanel.showError(errorMessage, CoreMessages.ConnectingFailureHandler_title); + connectionHandler.setCallback( + (account, errorMessage) -> { + // TODO offer user possibility of adjusting settings and re-connect + NotificationPanel.showError(errorMessage, CoreMessages.ConnectingFailureHandler_title); + }); } }