From 82734d4b10a2f5f3f4c2da18725d0cb931a88dc5 Mon Sep 17 00:00:00 2001 From: Konrad Malawski Date: Mon, 17 Nov 2025 16:39:35 +0900 Subject: [PATCH] fix mistake in how filtering applied to wrap java --- .../SwiftJavaTool/Commands/WrapJavaCommand.swift | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Sources/SwiftJavaTool/Commands/WrapJavaCommand.swift b/Sources/SwiftJavaTool/Commands/WrapJavaCommand.swift index 0e70ad00..51315102 100644 --- a/Sources/SwiftJavaTool/Commands/WrapJavaCommand.swift +++ b/Sources/SwiftJavaTool/Commands/WrapJavaCommand.swift @@ -267,9 +267,19 @@ extension SwiftJava.WrapJavaCommand { private func shouldImportJavaClass(_ javaClassName: String, config: Configuration) -> Bool { // If we have an inclusive filter, import only types from it - for include in config.filterInclude ?? [] { - guard javaClassName.starts(with: include) else { - log.info("Skip Java type: \(javaClassName) (does not match include filter: \(include))") + if let includes = config.filterInclude, !includes.isEmpty { + let anyIncludeFilterMatched = includes.contains { include in + if javaClassName.starts(with: include) { + // TODO: lower to trace level + log.info("Skip Java type: \(javaClassName) (does not match any include filter)") + return true + } + + return false + } + + guard anyIncludeFilterMatched else { + log.info("Skip Java type: \(javaClassName) (does not match any include filter)") return false } }