package aQute.bnd.build;
import static aQute.bnd.classindex.ClassIndexerAnalyzer.BND_HASHES;
import java.io.File;
import java.io.IOException;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
import org.osgi.framework.namespace.PackageNamespace;
import org.osgi.resource.Capability;
import org.osgi.resource.Requirement;
import org.osgi.resource.Resource;
import org.osgi.service.repository.Repository;
import aQute.bnd.build.Workspace.ResourceRepositoryStrategy;
import aQute.bnd.classindex.ClassIndexerAnalyzer;
import aQute.bnd.exceptions.Exceptions;
import aQute.bnd.osgi.BundleId;
import aQute.bnd.osgi.Descriptors;
import aQute.bnd.osgi.resource.RequirementBuilder;
import aQute.bnd.osgi.resource.ResourceUtils;
import aQute.bnd.result.Result;
import aQute.bnd.version.Version;
import aQute.lib.collections.MultiMap;
import aQute.lib.hierarchy.Hierarchy;
import aQute.lib.hierarchy.NamedNode;
import aQute.lib.zip.JarIndex;
class WorkspaceClassIndex implements AutoCloseable {
final Workspace workspace;
WorkspaceClassIndex(Workspace workspace) {
this.workspace = workspace;
}
/**
* Search for the bundles that export the given partialFqn. A partialFqn is
* either a package name, package prefix or a full FQN class name.
*
* The result is a map that has the full class name (FQN) as the key and a
* list of bundle ids as value.
*
* This method uses a heuristic to split the FQN into its package and class
* portion - the first element that starts with a capital letter is taken to
* be the top-level class - everything after that is nested classes,
* everything before that is the package hierarchy. This method is pretty
* good for most cases, but not perfect. If your calling context has a more
* reliable way to split the FQN into the package and class name portions,
* you will get more accurate results by using the
* {@link #search(String, String)} method.
*
* @param partialFqn package and/or class name
* @return a multimap of fqn|pack->bundleid
* @see #search(String, String)
*/
Result