Skip to content

Commit 08f143b

Browse files
committed
Don't call getValue when getting namespace
Fixes #177 Signed-off-by: Gary O'Neall <gary@sourceauditor.com>
1 parent 4e31b1b commit 08f143b

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/main/java/org/spdx/library/model/ExternalDocumentRef.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public ExternalDocumentRef setChecksum(Checksum checksum) throws InvalidSPDXAnal
183183
* @return the spdxDocumentNamespace or empty string if no namespace
184184
*/
185185
public String getSpdxDocumentNamespace() throws InvalidSPDXAnalysisException {
186-
Optional<Object> docNamespace = getObjectPropertyValue(SpdxConstants.PROP_EXTERNAL_SPDX_DOCUMENT);
186+
Optional<Object> docNamespace = getModelStore().getValue(getDocumentUri(), getId(), SpdxConstants.PROP_EXTERNAL_SPDX_DOCUMENT);
187187
if (!docNamespace.isPresent()) {
188188
logger.warn("SPDX document namespace not found");
189189
return "";

src/main/java/org/spdx/library/model/ExternalSpdxElement.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ public static ExternalSpdxElement uriToExternalSpdxElement(String uri,
196196

197197
public static String externalDocumentIdToNamespace(String externalDocumentId,
198198
IModelStore stModelStore, String stDocumentUri, ModelCopyManager copyManager) throws InvalidSPDXAnalysisException {
199-
Optional<Object> retval = getObjectPropertyValue(stModelStore, stDocumentUri,
200-
externalDocumentId, SpdxConstants.PROP_EXTERNAL_SPDX_DOCUMENT, copyManager);
199+
200+
Optional<Object> retval = stModelStore.getValue(stDocumentUri, externalDocumentId, SpdxConstants.PROP_EXTERNAL_SPDX_DOCUMENT);
201201
if (!retval.isPresent()) {
202202
throw new InvalidSPDXAnalysisException("No external document reference exists for document ID "+externalDocumentId);
203203
}

0 commit comments

Comments
 (0)