Returns all of the <tt>Packages</tt> defined by this class loader and
its ancestors.

@return  The array of <tt>Package</tt> objects defined by this
<tt>ClassLoader</tt>

@since  1.2
171511
protected Package[] getPackages() {
        Map<String, Package> map;
        synchronized (packages) {
            map = new HashMap<>(packages);
        }
        return map.values().toArray(new Package[map.size()]);
    }
1221137
synchronized public Set getClassesForPackage( String pack ) {
        insureInitialized();
        Set set = new HashSet();
        Collection c = (Collection)packageMap.get( pack );
        if ( c != null )
            set.addAll( c );

        if ( compPaths != null )
            for (int i=0; i<compPaths.size(); i++) {
                c = ((BshClassPath)compPaths.get(i)).getClassesForPackage(
                    pack );
                if ( c != null )
                    set.addAll( c );
            }
        return set;
    }
1183768
public static List<String> getAllClasses() throws PackageManager.NameNotFoundException, IOException {
        List<String> classNames = new ArrayList<>();
        for (String path : getSourcePaths()) {
            try {
                DexFile dexfile;
                if (path.endsWith(EXTRACTED_SUFFIX)) {
                    //NOT use new DexFile(path), because it will throw "permission error in /data/dalvik-cache"
                    dexfile = DexFile.loadDex(path, path + ".tmp", 0);
                } else {
                    dexfile = new DexFile(path);
                }
                Enumeration<String> dexEntries = dexfile.entries();
                while (dexEntries.hasMoreElements()) {
                    classNames.add(dexEntries.nextElement());
                }
            } catch (IOException e) {
                throw new IOException("Error at loading dex file '" + path + "'");
            }
        }
        return classNames;
    }
64597
@SuppressWarnings("squid:S2259") // potential multi-threading NPE
  public Package getRootPackage() {
    Package aPackage = this;
    while (aPackage.getParent() != null) {
      aPackage = aPackage.getParent();
    }
    return aPackage;
  }
373178
@SuppressWarnings("all")
    synchronized public static <T> Set<Class<? extends T>> getNonAbstractSubClasses(Class<T> parentClass, String... packageNames) {
        return getNonAbstractSubClassInfoSet(parentClass, packageNames).stream().map(classInfo -> {
            try {
                //Here we must use parentClass's classloader to make sure we are always using the same classloader.
                return (Class<? extends T>) parentClass.getClassLoader().loadClass(classInfo.getName());
            } catch (ClassNotFoundException e) {
                SystemOutLogger.SINGLETON.error("Failed to load class " + classInfo.getName(), e, "");
                System.exit(Constant.SYSTEM_EXIT_CODE_FOR_SYS_INIT_ERROR);
                //dead code
                return null;
            }
        }).collect(Collectors.toSet());
    }
772608
public static List<Package> getAllPackages(String packageName) throws CachingException {
        List<Package> allPackages = new ArrayList<>();
        for (Package packageVO : getPackageList()) {
            if (packageVO.getName().equals(packageName)) {
                allPackages.add(packageVO);
            }
        }
        return allPackages;
    }
53839
synchronized public static <T> Set<ClassInfo> getNonAbstractSubClassInfoSet(Class<T> parentClass, String... packageNames) {
        if (packageNames == null || packageNames.length == 0) {
            packageNames = defaultPackages();
        }
        try (ScanResult scanResult =
                     new ClassGraph()
                             .enableAllInfo()
                             .whitelistPackages(packageNames)
                             .scan()) {
            ClassInfoList classInfos = parentClass.isInterface() ?
                    scanResult.getClassesImplementing(parentClass.getName()) :
                    scanResult.getSubclasses(parentClass.getName());
            return classInfos
                    .stream()
                    .filter(classInfo -> !classInfo.isAbstract())
                    .collect(Collectors.toSet());
        }
    }
3690
@Override
    public List<String> getPackages() {
        List<String> list = new ArrayList<>();

        Consumer<JsonArray> reader = array -> {
            if ((array != null && !array.isEmpty())) {
                for (int i = 0; i < array.size(); i++) {
                    list.add(array.getString(i));
                }
            }
        };

        JsonArray resources = config.getJsonArray(CONFIG_RESOURCES, null);
        JsonArray packages = config.getJsonArray(CONFIG_PACKAGES, null);

        reader.accept(resources);
        reader.accept(packages);

        return list;
    }
22434
public SortedSet<TypeElement> allUnnamedClasses() {
        for (PackageElement pkg : allClasses.keySet()) {
            if (pkg.isUnnamed()) {
                return allClasses.get(pkg);
            }
        }
        return new TreeSet<>(comparator);
    }
25003
private function loadPackageDescriptors()
    {
        $descriptors = [];
        try {
            /** @var JsonFile $autoload */
            $autoload = $this->extFs->get('vendor/autoload.json');
        } catch (FileNotFoundException $e) {
            return $descriptors;
        }

        // Get extensions we're managing via the autoloader
        foreach ((array) $autoload->parse() as $name => $loader) {
            $descriptors[$name] = PackageDescriptor::create($loader);
        }

        return $descriptors;
    }
1062630
public static List<Class<?>> scanPackage(String... packages) throws IOException, ClassNotFoundException {
        List<Class<?>> list = new ArrayList<>();
        for (String pkg : packages) {
            list.addAll(getClasses(pkg));
        }
        return list;
    }
183667
public SortedMap<String, Class<?>> getClassesMap(Package... packages) {
        SortedMap<String, Class<?>> answer = new TreeMap<String, Class<?>>();
        Map<String, ClassResource> urlSet = new HashMap<String, ClassResource>();
        for (Package aPackage : packages) {
            addPackageResources(aPackage, urlSet, classLoaders);
        }
        for (ClassResource classResource : urlSet.values()) {
            Set<Class<?>> classes = getClassesForPackage(classResource, null, null);
            for (Class<?> aClass : classes) {
                answer.put(aClass.getName(), aClass);
            }
        }
        return answer;
    }
623025
public SortedMap<String, Class<?>> getAllClassesMap() {
        Package[] packages = Package.getPackages();
        return getClassesMap(packages);
    }
691447
function getAllPackages () {
  const packages = [
    // main package
    {
      entry: config.entry,
      jsName: 'index',
      cssName: 'style',
      globName: config.fullname,
      amdName: config.name,
    },
  ]

  return Promise.all([
    packagesFromPath(utils.resolve('src/component'), utils.resolve('src/component')),
    packagesFromPath(utils.resolve('src/mixin'), srcPath),
    packagesFromPath(utils.resolve('src/ol-ext'), srcPath),
    packagesFromPath(utils.resolve('src/rx-ext'), srcPath),
    packagesFromPath(utils.resolve('src/util'), srcPath),
  ]).then(otherPackages => {
    return packages.concat(otherPackages.reduce((all, packages) => all.concat(packages), []))
  })
}
547894
public Class[] getLoadedClasses() {
        synchronized (classCache) {
            final Collection<Class> values = classCache.values();
            return values.toArray(new Class[values.size()]);
        }
    }
1284961
public static String[] getAllClassPathNotInJar() {
        String[] allClassPath = getAllClassPaths();
        List<String> allClassPathNotInJar = new ArrayList<String>();
        for (String classPath : allClassPath) {
            if (classPath.endsWith("jar")) {
                continue;
            }
            allClassPathNotInJar.add(classPath);
        }
        return allClassPathNotInJar.toArray(new String[allClassPathNotInJar.size()]);
    }
1017741
public Collection<String> scanPackages() {
        return scanJar(p -> Files.isDirectory(p) && !isIgnored(p.toAbsolutePath()));
    }