Skip to content

Commit 0773d1a

Browse files
committed
remove commons-lang3 usage
1 parent 712059a commit 0773d1a

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

src/main/java/org/spdx/utility/compare/LicenseCompareHelper.java

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import java.util.Arrays;
3434
import java.util.Collection;
3535

36-
import org.apache.commons.lang3.ArrayUtils;
3736
import org.slf4j.Logger;
3837
import org.slf4j.LoggerFactory;
3938
import org.spdx.library.InvalidSPDXAnalysisException;
@@ -784,6 +783,18 @@ public static String[] matchingStandardLicenseIds(String licenseText) throws Inv
784783
return matchingIds.toArray(new String[matchingIds.size()]);
785784
}
786785

786+
private static <T> boolean contains(
787+
T[] array,
788+
T value
789+
) {
790+
for (T t : array) {
791+
if (Objects.equals(t, value)) {
792+
return true;
793+
}
794+
}
795+
return false;
796+
}
797+
787798
/**
788799
* Detect if a license pass black lists
789800
* @param license license
@@ -816,7 +827,7 @@ public static boolean isLicensePassBlackList(
816827
}
817828
return false;
818829
} else {
819-
return !ArrayUtils.contains(blackList, license.toString());
830+
return !contains(blackList, license.toString());
820831
}
821832
}
822833

@@ -852,7 +863,7 @@ public static boolean isLicensePassWhiteList(
852863
}
853864
return false;
854865
} else {
855-
return ArrayUtils.contains(whiteList, license.toString());
866+
return contains(whiteList, license.toString());
856867
}
857868
}
858869

0 commit comments

Comments
 (0)