Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import java.util.Optional;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.regex.Pattern;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -43,6 +44,8 @@
public class ListedLicenses {

static final Logger logger = LoggerFactory.getLogger(ListedLicenses.class.getName());

static final Pattern PATCH_VERSION_PATTERN = Pattern.compile(".+\\..+\\..+");

boolean onlyUseLocalLicenses;
private IListedLicenseStore licenseModelStore;
Expand Down Expand Up @@ -199,7 +202,11 @@ public List<String> getSpdxListedLicenseIds() {
* If no license list is loaded, returns {@link org.spdx.storage.listedlicense.SpdxListedLicenseModelStore#DEFAULT_LICENSE_LIST_VERSION}.
*/
public String getLicenseListVersion() {
return this.licenseModelStore.getLicenseListVersion();
String retval = this.licenseModelStore.getLicenseListVersion();
if (PATCH_VERSION_PATTERN.matcher(retval).matches()) {
retval = retval.substring(0, retval.lastIndexOf('.'));
}
return retval;
}

/**
Expand Down