Skip to content

Commit 0d9c2d9

Browse files
committed
Add more specific exception type
1 parent e8c120d commit 0d9c2d9

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/main/java/org/spdx/storage/IModelStore.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
import javax.annotation.Nullable;
2727

28+
import org.apache.commons.lang3.NotImplementedException;
2829
import org.spdx.core.InvalidSPDXAnalysisException;
2930
import org.spdx.core.TypedValue;
3031

@@ -235,13 +236,13 @@ default Optional<String> getCaseSensisitiveId(String nameSpace, String caseInsen
235236
for (Method method:methods) {
236237
if (method.getName().equals("getCaseSensitiveId")) {
237238
if (method.isDefault()) {
238-
throw new RuntimeException("No implementation for getCaseSensitiveId in a ModelStore implementation " + this.getClass());
239+
throw new NotImplementedException("No implementation for getCaseSensitiveId in a ModelStore implementation " + this.getClass());
239240
} else {
240241
return getCaseSensitiveId(nameSpace, caseInsensisitiveId);
241242
}
242243
}
243244
}
244-
throw new RuntimeException("Could not find implementation for getCaseSensitiveId in a ModelStore implementation " + this.getClass());
245+
throw new NotImplementedException("Could not find implementation for getCaseSensitiveId in a ModelStore implementation " + this.getClass());
245246
}
246247

247248
/**
@@ -256,13 +257,13 @@ default Optional<String> getCaseSensitiveId(String nameSpace, String caseInsensi
256257
for (Method method:methods) {
257258
if (method.getName().equals("getCaseSensisitiveId")) {
258259
if (method.isDefault()) {
259-
throw new RuntimeException("No implementation for getCaseSensitiveId in a ModelStore implementation " + this.getClass());
260+
throw new NotImplementedException("No implementation for getCaseSensitiveId in a ModelStore implementation " + this.getClass());
260261
} else {
261262
return getCaseSensisitiveId(nameSpace, caseInsensitiveId);
262263
}
263264
}
264265
}
265-
throw new RuntimeException("Could not find implementation for getCaseSensitiveId in a ModelStore implementation " + this.getClass());
266+
throw new NotImplementedException("Could not find implementation for getCaseSensitiveId in a ModelStore implementation " + this.getClass());
266267
}
267268

268269
/**

0 commit comments

Comments
 (0)