From 66dd22be4e93fec2554c65710ec5846a2f598c02 Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Thu, 22 Oct 2020 11:11:15 +0200 Subject: [PATCH] Remove deprecated exception. --- .../src/org/argeo/cms/e4/rap/CmsLoginLifecycle.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/CmsLoginLifecycle.java b/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/CmsLoginLifecycle.java index 300c7566b..12ee3c55e 100644 --- a/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/CmsLoginLifecycle.java +++ b/org.argeo.cms.e4.rap/src/org/argeo/cms/e4/rap/CmsLoginLifecycle.java @@ -10,7 +10,6 @@ import javax.security.auth.login.LoginException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.argeo.api.NodeConstants; -import org.argeo.cms.CmsException; import org.argeo.cms.auth.CurrentUser; import org.argeo.cms.ui.CmsImageManager; import org.argeo.cms.ui.CmsView; @@ -114,7 +113,7 @@ public class CmsLoginLifecycle implements CmsView { @Override public void authChange(LoginContext loginContext) { if (loginContext == null) - throw new CmsException("Login context cannot be null"); + throw new IllegalArgumentException("Login context cannot be null"); // logout previous login context // if (this.loginContext != null) // try { @@ -128,12 +127,12 @@ public class CmsLoginLifecycle implements CmsView { @Override public void logout() { if (loginContext == null) - throw new CmsException("Login context should not be null"); + throw new IllegalStateException("Login context should not be null"); try { CurrentUser.logoutCmsSession(loginContext.getSubject()); loginContext.logout(); } catch (LoginException e) { - throw new CmsException("Cannot log out", e); + throw new IllegalStateException("Cannot log out", e); } } -- 2.30.2