From c175012f59059664c78d6a1d98cbffbf4dd2b089 Mon Sep 17 00:00:00 2001 From: Gary O'Neall Date: Thu, 30 Jan 2025 12:47:16 -0800 Subject: [PATCH] Rename DefaultStoreNotInitialized Exception --- .../java/org/spdx/core/DefaultModelStore.java | 18 ++++----- .../spdx/core/DefaultStoreNotInitialized.java | 38 ------------------- .../DefaultStoreNotInitializedException.java | 38 +++++++++++++++++++ 3 files changed, 47 insertions(+), 47 deletions(-) delete mode 100644 src/main/java/org/spdx/core/DefaultStoreNotInitialized.java create mode 100644 src/main/java/org/spdx/core/DefaultStoreNotInitializedException.java diff --git a/src/main/java/org/spdx/core/DefaultModelStore.java b/src/main/java/org/spdx/core/DefaultModelStore.java index c03e04d..dd29d11 100644 --- a/src/main/java/org/spdx/core/DefaultModelStore.java +++ b/src/main/java/org/spdx/core/DefaultModelStore.java @@ -58,13 +58,13 @@ public static boolean isInitialized() { /** * @return the default model store - * @throws DefaultStoreNotInitialized if the initialize(...) was not called prior + * @throws DefaultStoreNotInitializedException if the initialize(...) was not called prior */ - public static IModelStore getDefaultModelStore() throws DefaultStoreNotInitialized { + public static IModelStore getDefaultModelStore() throws DefaultStoreNotInitializedException { lock.readLock().lock(); try { if (Objects.isNull(defaultStore)) { - throw new DefaultStoreNotInitialized(NOT_INITIALIZED_MSG); + throw new DefaultStoreNotInitializedException(NOT_INITIALIZED_MSG); } return defaultStore; } finally { @@ -74,13 +74,13 @@ public static IModelStore getDefaultModelStore() throws DefaultStoreNotInitializ /** * @return the default SPDX 2.X document URi - * @throws DefaultStoreNotInitialized if the initialize(...) was not called prior + * @throws DefaultStoreNotInitializedException if the initialize(...) was not called prior */ - public static String getDefaultDocumentUri() throws DefaultStoreNotInitialized { + public static String getDefaultDocumentUri() throws DefaultStoreNotInitializedException { lock.readLock().lock(); try { if (Objects.isNull(defaultDocumentUri)) { - throw new DefaultStoreNotInitialized(NOT_INITIALIZED_MSG); + throw new DefaultStoreNotInitializedException(NOT_INITIALIZED_MSG); } return defaultDocumentUri; } finally { @@ -111,13 +111,13 @@ public static void initialize(IModelStore newModelStore, String newDefaultDocume /** * @return the default copy manager - * @throws DefaultStoreNotInitialized if the initialize(...) was not called prior + * @throws DefaultStoreNotInitializedException if the initialize(...) was not called prior */ - public static IModelCopyManager getDefaultCopyManager() throws DefaultStoreNotInitialized { + public static IModelCopyManager getDefaultCopyManager() throws DefaultStoreNotInitializedException { lock.readLock().lock(); try { if (Objects.isNull(defaultCopyManager)) { - throw new DefaultStoreNotInitialized(NOT_INITIALIZED_MSG); + throw new DefaultStoreNotInitializedException(NOT_INITIALIZED_MSG); } return defaultCopyManager; } finally { diff --git a/src/main/java/org/spdx/core/DefaultStoreNotInitialized.java b/src/main/java/org/spdx/core/DefaultStoreNotInitialized.java deleted file mode 100644 index 37fc28d..0000000 --- a/src/main/java/org/spdx/core/DefaultStoreNotInitialized.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - * SPDX-License-Identifier: Apache-2.0 - * Copyright (c) 2024 Source Auditor Inc. - */ -package org.spdx.core; - -/** - * Exception where the default store is used before it has been initialized - * - * @author Gary O'Neall - * - */ -@SuppressWarnings("unused") -public class DefaultStoreNotInitialized extends InvalidSPDXAnalysisException { - - private static final long serialVersionUID = 1L; - - public DefaultStoreNotInitialized() { - } - - public DefaultStoreNotInitialized(String arg0) { - super(arg0); - } - - public DefaultStoreNotInitialized(Throwable arg0) { - super(arg0); - } - - public DefaultStoreNotInitialized(String arg0, Throwable arg1) { - super(arg0, arg1); - } - - public DefaultStoreNotInitialized(String arg0, Throwable arg1, boolean arg2, - boolean arg3) { - super(arg0, arg1, arg2, arg3); - } - -} diff --git a/src/main/java/org/spdx/core/DefaultStoreNotInitializedException.java b/src/main/java/org/spdx/core/DefaultStoreNotInitializedException.java new file mode 100644 index 0000000..bf888db --- /dev/null +++ b/src/main/java/org/spdx/core/DefaultStoreNotInitializedException.java @@ -0,0 +1,38 @@ +/** + * SPDX-License-Identifier: Apache-2.0 + * Copyright (c) 2024 Source Auditor Inc. + */ +package org.spdx.core; + +/** + * Exception where the default store is used before it has been initialized + * + * @author Gary O'Neall + * + */ +@SuppressWarnings("unused") +public class DefaultStoreNotInitializedException extends InvalidSPDXAnalysisException { + + private static final long serialVersionUID = 1L; + + public DefaultStoreNotInitializedException() { + } + + public DefaultStoreNotInitializedException(String arg0) { + super(arg0); + } + + public DefaultStoreNotInitializedException(Throwable arg0) { + super(arg0); + } + + public DefaultStoreNotInitializedException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + + public DefaultStoreNotInitializedException(String arg0, Throwable arg1, boolean arg2, + boolean arg3) { + super(arg0, arg1, arg2, arg3); + } + +}