Skip to content

Commit

Permalink
Rename DefaultStoreNotInitialized Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
goneall committed Jan 30, 2025
1 parent 12e7f6a commit c175012
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 47 deletions.
18 changes: 9 additions & 9 deletions src/main/java/org/spdx/core/DefaultModelStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ public static boolean isInitialized() {

/**
* @return the default model store
* @throws DefaultStoreNotInitialized if the <code>initialize(...)</code> was not called prior
* @throws DefaultStoreNotInitializedException if the <code>initialize(...)</code> 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 {
Expand All @@ -74,13 +74,13 @@ public static IModelStore getDefaultModelStore() throws DefaultStoreNotInitializ

/**
* @return the default SPDX 2.X document URi
* @throws DefaultStoreNotInitialized if the <code>initialize(...)</code> was not called prior
* @throws DefaultStoreNotInitializedException if the <code>initialize(...)</code> 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 {
Expand Down Expand Up @@ -111,13 +111,13 @@ public static void initialize(IModelStore newModelStore, String newDefaultDocume

/**
* @return the default copy manager
* @throws DefaultStoreNotInitialized if the <code>initialize(...)</code> was not called prior
* @throws DefaultStoreNotInitializedException if the <code>initialize(...)</code> 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 {
Expand Down
38 changes: 0 additions & 38 deletions src/main/java/org/spdx/core/DefaultStoreNotInitialized.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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);
}

}

0 comments on commit c175012

Please sign in to comment.