diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/executor/support/BlockingQueueTypeEnum.java b/hippo4j-common/src/main/java/cn/hippo4j/common/executor/support/BlockingQueueTypeEnum.java index 30bb3920..31ab11da 100644 --- a/hippo4j-common/src/main/java/cn/hippo4j/common/executor/support/BlockingQueueTypeEnum.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/executor/support/BlockingQueueTypeEnum.java @@ -18,7 +18,6 @@ package cn.hippo4j.common.executor.support; import cn.hippo4j.common.spi.DynamicThreadPoolServiceLoader; -import cn.hippo4j.common.web.exception.NotSupportedException; import lombok.Getter; import java.util.Collection; @@ -35,8 +34,6 @@ import java.util.concurrent.PriorityBlockingQueue; import java.util.concurrent.SynchronousQueue; import java.util.function.Predicate; -import static cn.hippo4j.common.web.exception.ErrorCodeEnum.SERVICE_ERROR; - /** * Blocking queue type enum. */ @@ -145,7 +142,7 @@ public enum BlockingQueueTypeEnum { * @return a BlockingQueue view of the specified T */ BlockingQueue of(Integer capacity) { - throw new NotSupportedException("该队列必须有界", SERVICE_ERROR); + throw new NotSupportedException("该队列必须有界"); } /** @@ -157,7 +154,7 @@ public enum BlockingQueueTypeEnum { * @throws NotSupportedException */ BlockingQueue of() { - throw new NotSupportedException("该队列不支持有界", SERVICE_ERROR); + throw new NotSupportedException("该队列不支持有界"); } /** diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/executor/support/NotSupportedException.java b/hippo4j-common/src/main/java/cn/hippo4j/common/executor/support/NotSupportedException.java new file mode 100644 index 00000000..9a9e8105 --- /dev/null +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/executor/support/NotSupportedException.java @@ -0,0 +1,20 @@ +package cn.hippo4j.common.executor.support; + +import cn.hippo4j.common.web.exception.AbstractException; + +/** + * This exception is thrown when a context implementation does not support the operation being invoked. + */ +public class NotSupportedException extends AbstractException { + + /** + * Constructs a new not supported exception with the specified detail message and + * cause. + * + * @param message the detail message (which is saved for later retrieval + * by the {@link #getMessage()} method). + */ + public NotSupportedException(String message) { + super(message, null, null); + } +} diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/web/exception/NotSupportedException.java b/hippo4j-common/src/main/java/cn/hippo4j/common/web/exception/NotSupportedException.java deleted file mode 100644 index 261b5b45..00000000 --- a/hippo4j-common/src/main/java/cn/hippo4j/common/web/exception/NotSupportedException.java +++ /dev/null @@ -1,12 +0,0 @@ -package cn.hippo4j.common.web.exception; - -/** - * This exception is thrown when a context implementation does not support the operation being invoked. - */ -public class NotSupportedException extends AbstractException { - - public NotSupportedException(String message, ErrorCode errorCode) { - super(message, null, errorCode); - } - -}