File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -524,7 +524,10 @@ class SpdxLicenseWithExceptionExpression(
524524
525525 override fun equals (other : Any? ) =
526526 when (other) {
527- is SpdxLicenseWithExceptionExpression -> license == other.license && exception == other.exception
527+ is SpdxLicenseWithExceptionExpression -> {
528+ license == other.license && exception.equals(other.exception, ignoreCase = true )
529+ }
530+
528531 else -> false
529532 }
530533
@@ -581,7 +584,10 @@ class SpdxLicenseIdExpression(
581584
582585 override fun equals (other : Any? ) =
583586 when (other) {
584- is SpdxLicenseIdExpression -> id == other.id && orLaterVersion == other.orLaterVersion
587+ is SpdxLicenseIdExpression -> {
588+ id.equals(other.id, ignoreCase = true ) && orLaterVersion == other.orLaterVersion
589+ }
590+
585591 else -> false
586592 }
587593
@@ -622,7 +628,7 @@ data class SpdxLicenseReferenceExpression(
622628
623629 override fun equals (other : Any? ) =
624630 when (other) {
625- is SpdxLicenseReferenceExpression -> id == other.id
631+ is SpdxLicenseReferenceExpression -> id.equals( other.id, ignoreCase = true )
626632 else -> false
627633 }
628634
Original file line number Diff line number Diff line change @@ -557,6 +557,11 @@ class SpdxExpressionTest : WordSpec({
557557 " a" .toSpdx() shouldNotBe " a AND b" .toSpdx()
558558 " a" .toSpdx() shouldNotBe " a+" .toSpdx()
559559 }
560+
561+ " compare expressions case-insensitively" {
562+ " CDDL-1.1 OR GPL-2.0-only WITH Classpath-Exception-2.0" .toSpdx() shouldBe
563+ " Cddl-1.1 OR Gpl-2.0-only WITH Classpath-exception-2.0" .toSpdx()
564+ }
560565 }
561566
562567 " hashCode()" should {
You can’t perform that action at this time.
0 commit comments