Fix non-pattern package prefix check in CandidateComponentsIndex

Prior to this commit, the non-pattern package prefix check used
packageName.startsWith(basePackage) which incorrectly treats
"com.example2.foo" as a subpackage of "com.example".

Closes gh-35601

Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>
This commit is contained in:
NeatGuyCoding
2025-10-11 11:37:00 +08:00
committed by Sam Brannen
parent 51d6e8beb0
commit 113b9d131c
@@ -150,7 +150,7 @@ public class CandidateComponentsIndex {
return pathMatcher.match(basePackage, packageName);
}
else {
return packageName.startsWith(basePackage);
return packageName.equals(basePackage) || packageName.startsWith(basePackage + ".");
}
}