From 96caa43a1af92df6feab14428ebab33d2f22880d Mon Sep 17 00:00:00 2001 From: shimingxy Date: Fri, 30 Aug 2024 17:24:59 +0800 Subject: [PATCH] Exception add serialVersionUID --- .../dromara/sureness/matcher/SurenessLoadDataException.java | 4 +++- .../org/dromara/sureness/mgt/SurenessNoInitException.java | 4 +++- .../sureness/processor/exception/BaseSurenessException.java | 4 +++- .../processor/exception/DisabledAccountException.java | 4 +++- .../processor/exception/ExcessiveAttemptsException.java | 4 +++- .../processor/exception/ExpiredCredentialsException.java | 4 +++- .../sureness/processor/exception/ExtSurenessException.java | 4 +++- .../processor/exception/IncorrectCredentialsException.java | 4 +++- .../processor/exception/NeedDigestInfoException.java | 3 ++- .../processor/exception/ProcessorNotFoundException.java | 4 +++- .../exception/SurenessAuthenticationException.java | 4 +++- .../processor/exception/SurenessAuthorizationException.java | 4 +++- .../sureness/processor/exception/UnauthorizedException.java | 4 +++- .../processor/exception/UnknownAccountException.java | 4 +++- .../processor/exception/UnsupportedSubjectException.java | 4 +++- .../dromara/sureness/mgt/SurenessSecurityManagerTest.java | 4 ++-- .../sample/bootstrap/config/SurenessConfiguration.java | 6 +++--- .../main/java/org/dromara/sureness/javalin/Application.java | 4 ++-- .../main/java/org/dromara/sureness/jfinal/Application.java | 4 ++-- .../dromara/sureness/microprofile/DemoRestApplication.java | 4 ++-- .../java/org/dromara/sureness/SurenessConfiguration.java | 4 ++-- .../main/java/gateway/sureness/SurenessConfiguration.java | 6 +++--- .../src/main/java/zuul/sureness/SurenessConfiguration.java | 6 +++--- 23 files changed, 63 insertions(+), 34 deletions(-) diff --git a/core/src/main/java/org/dromara/sureness/matcher/SurenessLoadDataException.java b/core/src/main/java/org/dromara/sureness/matcher/SurenessLoadDataException.java index a3a72582..b72f7ad5 100644 --- a/core/src/main/java/org/dromara/sureness/matcher/SurenessLoadDataException.java +++ b/core/src/main/java/org/dromara/sureness/matcher/SurenessLoadDataException.java @@ -9,7 +9,9 @@ */ public class SurenessLoadDataException extends ExtSurenessException { - public SurenessLoadDataException(String message) { + private static final long serialVersionUID = -6790251019252141726L; + + public SurenessLoadDataException(String message) { super(message); } } diff --git a/core/src/main/java/org/dromara/sureness/mgt/SurenessNoInitException.java b/core/src/main/java/org/dromara/sureness/mgt/SurenessNoInitException.java index b2b0e0d0..8997f14b 100644 --- a/core/src/main/java/org/dromara/sureness/mgt/SurenessNoInitException.java +++ b/core/src/main/java/org/dromara/sureness/mgt/SurenessNoInitException.java @@ -10,7 +10,9 @@ */ public class SurenessNoInitException extends ExtSurenessException { - public SurenessNoInitException(String message) { + private static final long serialVersionUID = -1978973168384683300L; + + public SurenessNoInitException(String message) { super(message); } } diff --git a/core/src/main/java/org/dromara/sureness/processor/exception/BaseSurenessException.java b/core/src/main/java/org/dromara/sureness/processor/exception/BaseSurenessException.java index cd7baa8c..2d313c21 100644 --- a/core/src/main/java/org/dromara/sureness/processor/exception/BaseSurenessException.java +++ b/core/src/main/java/org/dromara/sureness/processor/exception/BaseSurenessException.java @@ -7,7 +7,9 @@ */ public class BaseSurenessException extends RuntimeException { - public BaseSurenessException(String message) { + private static final long serialVersionUID = -4061441676174632518L; + + public BaseSurenessException(String message) { super(message); } diff --git a/core/src/main/java/org/dromara/sureness/processor/exception/DisabledAccountException.java b/core/src/main/java/org/dromara/sureness/processor/exception/DisabledAccountException.java index 9fd1015e..074fbe41 100644 --- a/core/src/main/java/org/dromara/sureness/processor/exception/DisabledAccountException.java +++ b/core/src/main/java/org/dromara/sureness/processor/exception/DisabledAccountException.java @@ -7,7 +7,9 @@ */ public class DisabledAccountException extends SurenessAuthenticationException { - public DisabledAccountException(String message) { + private static final long serialVersionUID = 8944393703712611088L; + + public DisabledAccountException(String message) { super(message); } } diff --git a/core/src/main/java/org/dromara/sureness/processor/exception/ExcessiveAttemptsException.java b/core/src/main/java/org/dromara/sureness/processor/exception/ExcessiveAttemptsException.java index 06bddcab..de486591 100644 --- a/core/src/main/java/org/dromara/sureness/processor/exception/ExcessiveAttemptsException.java +++ b/core/src/main/java/org/dromara/sureness/processor/exception/ExcessiveAttemptsException.java @@ -7,7 +7,9 @@ */ public class ExcessiveAttemptsException extends SurenessAuthenticationException { - public ExcessiveAttemptsException(String message) { + private static final long serialVersionUID = -6803340753339433865L; + + public ExcessiveAttemptsException(String message) { super(message); } } diff --git a/core/src/main/java/org/dromara/sureness/processor/exception/ExpiredCredentialsException.java b/core/src/main/java/org/dromara/sureness/processor/exception/ExpiredCredentialsException.java index 25d6bca5..d1303e31 100644 --- a/core/src/main/java/org/dromara/sureness/processor/exception/ExpiredCredentialsException.java +++ b/core/src/main/java/org/dromara/sureness/processor/exception/ExpiredCredentialsException.java @@ -7,7 +7,9 @@ */ public class ExpiredCredentialsException extends SurenessAuthenticationException { - public ExpiredCredentialsException(String message) { + private static final long serialVersionUID = -6757582855462476662L; + + public ExpiredCredentialsException(String message) { super(message); } } diff --git a/core/src/main/java/org/dromara/sureness/processor/exception/ExtSurenessException.java b/core/src/main/java/org/dromara/sureness/processor/exception/ExtSurenessException.java index c7d1270b..5479e1aa 100644 --- a/core/src/main/java/org/dromara/sureness/processor/exception/ExtSurenessException.java +++ b/core/src/main/java/org/dromara/sureness/processor/exception/ExtSurenessException.java @@ -8,7 +8,9 @@ */ public class ExtSurenessException extends RuntimeException { - public ExtSurenessException(String message) { + private static final long serialVersionUID = 8329942117536125620L; + + public ExtSurenessException(String message) { super(message); } } diff --git a/core/src/main/java/org/dromara/sureness/processor/exception/IncorrectCredentialsException.java b/core/src/main/java/org/dromara/sureness/processor/exception/IncorrectCredentialsException.java index a32d38cc..9a7942fc 100644 --- a/core/src/main/java/org/dromara/sureness/processor/exception/IncorrectCredentialsException.java +++ b/core/src/main/java/org/dromara/sureness/processor/exception/IncorrectCredentialsException.java @@ -7,7 +7,9 @@ */ public class IncorrectCredentialsException extends SurenessAuthenticationException { - public IncorrectCredentialsException(String message) { + private static final long serialVersionUID = -283801595997077954L; + + public IncorrectCredentialsException(String message) { super(message); } } diff --git a/core/src/main/java/org/dromara/sureness/processor/exception/NeedDigestInfoException.java b/core/src/main/java/org/dromara/sureness/processor/exception/NeedDigestInfoException.java index 95e2e7b0..c49c5fa8 100644 --- a/core/src/main/java/org/dromara/sureness/processor/exception/NeedDigestInfoException.java +++ b/core/src/main/java/org/dromara/sureness/processor/exception/NeedDigestInfoException.java @@ -8,7 +8,8 @@ */ public class NeedDigestInfoException extends SurenessAuthenticationException { - private final String authenticate; + private static final long serialVersionUID = 7651386288955053842L; + private final String authenticate; public NeedDigestInfoException(String message, String authenticate) { super(message); diff --git a/core/src/main/java/org/dromara/sureness/processor/exception/ProcessorNotFoundException.java b/core/src/main/java/org/dromara/sureness/processor/exception/ProcessorNotFoundException.java index 2be8c909..a1b63f40 100644 --- a/core/src/main/java/org/dromara/sureness/processor/exception/ProcessorNotFoundException.java +++ b/core/src/main/java/org/dromara/sureness/processor/exception/ProcessorNotFoundException.java @@ -7,7 +7,9 @@ */ public class ProcessorNotFoundException extends BaseSurenessException { - public ProcessorNotFoundException(String message) { + private static final long serialVersionUID = 306924477676292358L; + + public ProcessorNotFoundException(String message) { super(message); } } diff --git a/core/src/main/java/org/dromara/sureness/processor/exception/SurenessAuthenticationException.java b/core/src/main/java/org/dromara/sureness/processor/exception/SurenessAuthenticationException.java index c51377ab..6dbbdef5 100644 --- a/core/src/main/java/org/dromara/sureness/processor/exception/SurenessAuthenticationException.java +++ b/core/src/main/java/org/dromara/sureness/processor/exception/SurenessAuthenticationException.java @@ -8,7 +8,9 @@ */ public class SurenessAuthenticationException extends BaseSurenessException { - public SurenessAuthenticationException(String message) { + private static final long serialVersionUID = -2636197665321265226L; + + public SurenessAuthenticationException(String message) { super(message); } } diff --git a/core/src/main/java/org/dromara/sureness/processor/exception/SurenessAuthorizationException.java b/core/src/main/java/org/dromara/sureness/processor/exception/SurenessAuthorizationException.java index a4fdf647..22508702 100644 --- a/core/src/main/java/org/dromara/sureness/processor/exception/SurenessAuthorizationException.java +++ b/core/src/main/java/org/dromara/sureness/processor/exception/SurenessAuthorizationException.java @@ -8,7 +8,9 @@ */ public class SurenessAuthorizationException extends BaseSurenessException { - public SurenessAuthorizationException(String message) { + private static final long serialVersionUID = 619299333313434936L; + + public SurenessAuthorizationException(String message) { super(message); } } diff --git a/core/src/main/java/org/dromara/sureness/processor/exception/UnauthorizedException.java b/core/src/main/java/org/dromara/sureness/processor/exception/UnauthorizedException.java index 45a71811..2444490f 100644 --- a/core/src/main/java/org/dromara/sureness/processor/exception/UnauthorizedException.java +++ b/core/src/main/java/org/dromara/sureness/processor/exception/UnauthorizedException.java @@ -7,7 +7,9 @@ */ public class UnauthorizedException extends SurenessAuthorizationException { - public UnauthorizedException(String message) { + private static final long serialVersionUID = -7713907539505292238L; + + public UnauthorizedException(String message) { super(message); } } diff --git a/core/src/main/java/org/dromara/sureness/processor/exception/UnknownAccountException.java b/core/src/main/java/org/dromara/sureness/processor/exception/UnknownAccountException.java index d6e17c92..b2e0799f 100644 --- a/core/src/main/java/org/dromara/sureness/processor/exception/UnknownAccountException.java +++ b/core/src/main/java/org/dromara/sureness/processor/exception/UnknownAccountException.java @@ -7,7 +7,9 @@ */ public class UnknownAccountException extends SurenessAuthenticationException { - public UnknownAccountException(String message) { + private static final long serialVersionUID = -7424387213268192767L; + + public UnknownAccountException(String message) { super(message); } } diff --git a/core/src/main/java/org/dromara/sureness/processor/exception/UnsupportedSubjectException.java b/core/src/main/java/org/dromara/sureness/processor/exception/UnsupportedSubjectException.java index 12571637..98de7ea3 100644 --- a/core/src/main/java/org/dromara/sureness/processor/exception/UnsupportedSubjectException.java +++ b/core/src/main/java/org/dromara/sureness/processor/exception/UnsupportedSubjectException.java @@ -8,7 +8,9 @@ */ public class UnsupportedSubjectException extends SurenessAuthenticationException { - public UnsupportedSubjectException(String message) { + private static final long serialVersionUID = 5193468392686824045L; + + public UnsupportedSubjectException(String message) { super(message); } diff --git a/core/src/test/java/org/dromara/sureness/mgt/SurenessSecurityManagerTest.java b/core/src/test/java/org/dromara/sureness/mgt/SurenessSecurityManagerTest.java index e8c420ae..e4ae689f 100644 --- a/core/src/test/java/org/dromara/sureness/mgt/SurenessSecurityManagerTest.java +++ b/core/src/test/java/org/dromara/sureness/mgt/SurenessSecurityManagerTest.java @@ -1,6 +1,6 @@ package org.dromara.sureness.mgt; -import org.dromara.sureness.DefaultSurenessConfig; +import org.dromara.sureness.SurenessDefaultConfig; import org.dromara.sureness.mgt.SecurityManager; import org.dromara.sureness.mgt.SurenessSecurityManager; import org.dromara.sureness.processor.exception.IncorrectCredentialsException; @@ -44,7 +44,7 @@ class SurenessSecurityManagerTest { @BeforeAll static void setUp() { DocumentResourceAccess.setYamlName("sureness-sample.yml"); - new DefaultSurenessConfig(DefaultSurenessConfig.SUPPORT_SERVLET); + new SurenessDefaultConfig(SurenessDefaultConfig.SUPPORT_SERVLET); assertDoesNotThrow(SurenessSecurityManager::getInstance); securityManager = SurenessSecurityManager.getInstance(); assertNotNull(securityManager); diff --git a/sample-bootstrap/src/main/java/org/dromara/sureness/sample/bootstrap/config/SurenessConfiguration.java b/sample-bootstrap/src/main/java/org/dromara/sureness/sample/bootstrap/config/SurenessConfiguration.java index 4dc93a59..bc4f6f18 100644 --- a/sample-bootstrap/src/main/java/org/dromara/sureness/sample/bootstrap/config/SurenessConfiguration.java +++ b/sample-bootstrap/src/main/java/org/dromara/sureness/sample/bootstrap/config/SurenessConfiguration.java @@ -1,6 +1,6 @@ package org.dromara.sureness.sample.bootstrap.config; -import org.dromara.sureness.DefaultSurenessConfig; +import org.dromara.sureness.SurenessDefaultConfig; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -17,8 +17,8 @@ public class SurenessConfiguration { * @return default config bean */ @Bean - public DefaultSurenessConfig surenessConfig() { - return new DefaultSurenessConfig(); + public SurenessDefaultConfig surenessConfig() { + return new SurenessDefaultConfig(); } } diff --git a/samples/javalin-sureness/src/main/java/org/dromara/sureness/javalin/Application.java b/samples/javalin-sureness/src/main/java/org/dromara/sureness/javalin/Application.java index 7af4635f..6aecc050 100644 --- a/samples/javalin-sureness/src/main/java/org/dromara/sureness/javalin/Application.java +++ b/samples/javalin-sureness/src/main/java/org/dromara/sureness/javalin/Application.java @@ -2,7 +2,7 @@ import io.javalin.Javalin; -import org.dromara.sureness.DefaultSurenessConfig; +import org.dromara.sureness.SurenessDefaultConfig; import org.dromara.sureness.mgt.SurenessSecurityManager; import org.dromara.sureness.processor.exception.*; import org.dromara.sureness.subject.SubjectSum; @@ -27,7 +27,7 @@ public class Application { @SuppressWarnings("unchecked") public static void main(String[] args) { // init sureness default config - new DefaultSurenessConfig(); + new SurenessDefaultConfig(); // init javalin Javalin app = Javalin.create().start(8088); diff --git a/samples/jfinal-sureness/src/main/java/org/dromara/sureness/jfinal/Application.java b/samples/jfinal-sureness/src/main/java/org/dromara/sureness/jfinal/Application.java index 5710a491..ffbf869b 100644 --- a/samples/jfinal-sureness/src/main/java/org/dromara/sureness/jfinal/Application.java +++ b/samples/jfinal-sureness/src/main/java/org/dromara/sureness/jfinal/Application.java @@ -1,6 +1,6 @@ package org.dromara.sureness.jfinal; -import org.dromara.sureness.DefaultSurenessConfig; +import org.dromara.sureness.SurenessDefaultConfig; import com.jfinal.config.*; import com.jfinal.server.undertow.UndertowServer; @@ -20,7 +20,7 @@ public static void main(String[] args) { @Override public void configConstant(Constants me) { // init sureness config - new DefaultSurenessConfig(); + new SurenessDefaultConfig(); me.setDevMode(true); } diff --git a/samples/micro-profile-sureness/src/main/java/org/dromara/sureness/microprofile/DemoRestApplication.java b/samples/micro-profile-sureness/src/main/java/org/dromara/sureness/microprofile/DemoRestApplication.java index 92321de1..c21f88e3 100644 --- a/samples/micro-profile-sureness/src/main/java/org/dromara/sureness/microprofile/DemoRestApplication.java +++ b/samples/micro-profile-sureness/src/main/java/org/dromara/sureness/microprofile/DemoRestApplication.java @@ -3,7 +3,7 @@ import javax.ws.rs.ApplicationPath; import javax.ws.rs.core.Application; -import org.dromara.sureness.DefaultSurenessConfig; +import org.dromara.sureness.SurenessDefaultConfig; /** * @author Lenovo @@ -13,6 +13,6 @@ public class DemoRestApplication extends Application { public DemoRestApplication(){ super(); - new DefaultSurenessConfig(DefaultSurenessConfig.SUPPORT_JAX_RS); + new SurenessDefaultConfig(SurenessDefaultConfig.SUPPORT_JAX_RS); } } diff --git a/samples/quarkus-sureness/src/main/java/org/dromara/sureness/SurenessConfiguration.java b/samples/quarkus-sureness/src/main/java/org/dromara/sureness/SurenessConfiguration.java index 3fc50c60..67e4059a 100644 --- a/samples/quarkus-sureness/src/main/java/org/dromara/sureness/SurenessConfiguration.java +++ b/samples/quarkus-sureness/src/main/java/org/dromara/sureness/SurenessConfiguration.java @@ -5,7 +5,7 @@ import javax.enterprise.context.ApplicationScoped; -import org.dromara.sureness.DefaultSurenessConfig; +import org.dromara.sureness.SurenessDefaultConfig; /** * sureness config,Use DefaultSurenessConfig @@ -20,6 +20,6 @@ public class SurenessConfiguration { * init sureness default config */ public SurenessConfiguration() { - new DefaultSurenessConfig(DefaultSurenessConfig.SUPPORT_JAX_RS); + new SurenessDefaultConfig(SurenessDefaultConfig.SUPPORT_JAX_RS); } } diff --git a/samples/spring-gateway-sureness/src/main/java/gateway/sureness/SurenessConfiguration.java b/samples/spring-gateway-sureness/src/main/java/gateway/sureness/SurenessConfiguration.java index 6e9c1bbb..616536e8 100644 --- a/samples/spring-gateway-sureness/src/main/java/gateway/sureness/SurenessConfiguration.java +++ b/samples/spring-gateway-sureness/src/main/java/gateway/sureness/SurenessConfiguration.java @@ -1,7 +1,7 @@ package gateway.sureness; -import org.dromara.sureness.DefaultSurenessConfig; +import org.dromara.sureness.SurenessDefaultConfig; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -19,8 +19,8 @@ public class SurenessConfiguration { * @return default config bean */ @Bean - public DefaultSurenessConfig surenessConfig() { - return new DefaultSurenessConfig(DefaultSurenessConfig.SUPPORT_SPRING_REACTIVE); + public SurenessDefaultConfig surenessConfig() { + return new SurenessDefaultConfig(SurenessDefaultConfig.SUPPORT_SPRING_REACTIVE); } } diff --git a/samples/zuul-sureness/src/main/java/zuul/sureness/SurenessConfiguration.java b/samples/zuul-sureness/src/main/java/zuul/sureness/SurenessConfiguration.java index b11796c9..43bd3543 100644 --- a/samples/zuul-sureness/src/main/java/zuul/sureness/SurenessConfiguration.java +++ b/samples/zuul-sureness/src/main/java/zuul/sureness/SurenessConfiguration.java @@ -1,7 +1,7 @@ package zuul.sureness; -import org.dromara.sureness.DefaultSurenessConfig; +import org.dromara.sureness.SurenessDefaultConfig; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -19,8 +19,8 @@ public class SurenessConfiguration { * @return default config bean */ @Bean - public DefaultSurenessConfig surenessConfig() { - return new DefaultSurenessConfig(); + public SurenessDefaultConfig surenessConfig() { + return new SurenessDefaultConfig(); } }