Skip to content

Commit 88b49e1

Browse files
authored
shouldImport wrongly handled include filters (#594)
We don't want to pass if all filters match but if any of them match
1 parent cbe9d06 commit 88b49e1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Sources/SwiftJavaTool/ExcludedJDKTypes.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ extension SwiftJava {
2424
return false
2525
}
2626

27-
for include in commonOptions.filterInclude {
28-
guard javaCanonicalName.hasPrefix(include) else {
29-
// Skip classes which don't match our expected prefix
27+
if !commonOptions.filterInclude.isEmpty {
28+
let anyIncludeMatches = commonOptions.filterInclude.contains(where: { javaCanonicalName.hasPrefix($0) })
29+
guard anyIncludeMatches else {
3030
return false
3131
}
3232
}

0 commit comments

Comments
 (0)