Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/main/java/org/spdx/library/model/license/License.java
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,11 @@ public ModelUpdate updateSetDeprecated(Boolean deprecated) throws InvalidSPDXAna
}

@Override
public boolean equivalent(ModelObject compare) throws InvalidSPDXAnalysisException {
public boolean equivalent(ModelObject compare, boolean ignoreExternalReferences) throws InvalidSPDXAnalysisException {
if (compare instanceof License) {
return LicenseCompareHelper.isLicenseTextEquivalent(this.getLicenseText(), ((License)compare).getLicenseText());
} else {
return super.equivalent(compare);
return super.equivalent(compare, ignoreExternalReferences);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.spdx.library.InvalidSPDXAnalysisException;
import org.spdx.library.ModelCopyManager;
import org.spdx.library.SpdxConstants;
import org.spdx.library.model.ModelObject;
import org.spdx.licenseTemplate.LicenseTemplateRuleException;
import org.spdx.licenseTemplate.SpdxLicenseTemplateHelper;
import org.spdx.storage.IModelStore;
Expand Down Expand Up @@ -119,5 +120,14 @@ public String getExceptionTextHtml() throws InvalidSPDXAnalysisException {
}
}
}

@Override
public boolean equivalent(ModelObject compare, boolean ignoreRelatedElements) throws InvalidSPDXAnalysisException {
if (compare instanceof ListedLicenseException) {
return this.getId().equals(((ListedLicenseException)compare).getId()); // for listed license, the license ID is the only thing that matters
} else {
return super.equivalent(compare, ignoreRelatedElements);
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ public String getType() {
}

@Override
public boolean equivalent(ModelObject compare) throws InvalidSPDXAnalysisException {
public boolean equivalent(ModelObject compare, boolean ignoreRelatedElements) throws InvalidSPDXAnalysisException {
if (compare instanceof SpdxListedLicense) {
return this.getLicenseId().equals(((SpdxListedLicense)compare).getLicenseId()); // for listed license, the license ID is the only thing that matters
} else {
return super.equivalent(compare);
return super.equivalent(compare, ignoreRelatedElements);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,4 +207,9 @@ public void testExternalLicenseRef() throws InvalidSPDXAnalysisException {
assertTrue(result instanceof ExternalExtractedLicenseInfo);
assertEquals(externalExtractedId, ((ExternalExtractedLicenseInfo)result).getId());
}

public void regressionMitWith() throws InvalidSPDXAnalysisException, InvalidLicenseStringException {
AnyLicenseInfo result = LicenseInfoFactory.parseSPDXLicenseString("MIT WITH Autoconf-exception-2.0");
assertEquals("MIT WITH Autoconf-exception-2.0",result.toString());
}
}