Skip to content

Commit 7cd5af3

Browse files
committed
Update check for listed license to check for ID existance
Signed-off-by: Gary O'Neall <gary@sourceauditor.com>
1 parent eb449df commit 7cd5af3

2 files changed

Lines changed: 1 addition & 2 deletions

File tree

src/main/java/org/spdx/spdxRdfStore/RdfSpdxDocumentModelManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ public Optional<Object> getPropertyValue(String id, String propertyName) throws
665665
Property property = model.createProperty(SpdxResourceFactory.propertyNameToUri(propertyName));
666666
NodeIterator iter = model.listObjectsOfProperty(idResource, property);
667667
if (!iter.hasNext()) {
668-
if (isListedLicenseOrException(idResource)) {
668+
if (isListedLicenseOrException(idResource) && !this.exists(id)) {
669669
// If there is no locally stored property for a listed license or exception
670670
// fetch it from listed licenses store
671671
return ListedLicenses.getListedLicenses().getLicenseModelStore()

src/test/java/org/spdx/library/model/license/SpdxListedLicenseTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import java.io.ByteArrayInputStream;
2121
import java.io.ByteArrayOutputStream;
2222
import java.io.IOException;
23-
import java.io.StringWriter;
2423
import java.nio.charset.StandardCharsets;
2524
import java.util.ArrayList;
2625
import java.util.Arrays;

0 commit comments

Comments
 (0)