private Collection<ISigilBundle> findProviders(final IPackageImport pi, int options,
boolean findFirst)
{
ArrayList<ISigilBundle> found = new ArrayList<ISigilBundle>();
ILicensePolicy policy = findPolicy(pi);
String name = pi.getPackageName();
VersionRange versions = pi.getVersions();
// find exact match(es)
for (ISigilBundle bundle : getBundles())
{
if (policy.accept(bundle))
{
for (IPackageExport exp : bundle.getBundleInfo().getExports())
{
if (name.equals(exp.getPackageName())
&& versions.contains(exp.getVersion()))
{
found.add(bundle);
if (findFirst)
return found;
}
}
}
}
if (!found.isEmpty())
return found;
// find best fuzzy match
ISigilBundle fuzzyMatch = null;
int fuzzyLen = 0;
for (ISigilBundle bundle : getWildBundles())
{
if (policy.accept(bundle))
{
for (IPackageExport exp : bundle.getBundleInfo().getExports())
{
String export = exp.getPackageName();
if (export.endsWith("*"))