Find an entry in the allowed list by package name.

@param packageName
Name to find.

@return Package or <code>null</code> if no entry with the given name was found.
496638
public final Package<DependsOn> findAllowedByName(final String packageName) {
        final List<Package<DependsOn>> list = getAllowed();
        for (final Package<DependsOn> pkg : list) {
            if (pkg.getName().equals(packageName)) {
                return pkg;
            }
        }
        return null;
    }
1321979
protected Package getPackage(String name) {
        Package pkg;
        synchronized (packages) {
            pkg = packages.get(name);
        }
        return pkg;
    }
1340909
static String getParentPackageName(final String packageOrClassName) {
        if (packageOrClassName.isEmpty()) {
            return null;
        }
        final int lastDotIdx = packageOrClassName.lastIndexOf('.');
        return lastDotIdx < 0 ? "" : packageOrClassName.substring(0, lastDotIdx);
    }
1075321
protected final String getPackageMessage(String packageName, String key) {
    Option<TextBundle> bundle = registry.load(locale, packageName + ".package");
    return bundle.isDefined() ? bundle.get().getText(key) : null;
  }
1009933
public ClassFile find(String className) {
        for (PathEntry pe : list) {
            ClassFile cf = pe.find(className);
            if (cf != null) {
                return cf;
            }
        }
        return null;
    }
626665
public void addAllowedPackage(String packageName) {
        if (packageName.endsWith(".")) {
            packageName = packageName.substring(0, packageName.length() - 1);
        }

        String packageRegex = START + dotsToRegex(packageName) + SEP + JAVA_IDENTIFIER_PART + "+.class$";
        LOG.debug("Package regex: {}", packageRegex);
        patternList.add(Pattern.compile(packageRegex).matcher(""));
    }
609548
public IndexEntry findEntryByFileName(String fileName) {
    for (IndexEntry e: entries) {
      if (fileName.equals(e.fileName)) {
        return e;
      }
    }
    return null;
  }
970876
function findPackage(filename) {
    if (!ctr)
        return;
    filename = filename || require.main.filename;
    var parsed = path_1.parse(filename);
    var curPath = path_1.join(parsed.dir, 'package.json');
    if (!fs_1.existsSync(curPath)) {
        ctr--;
        return findPackage(parsed.dir);
    }
    else {
        return chek_1.tryRequire(curPath, {});
    }
}
1209104
@Override
    public boolean isPackageInstaller(final String packageName) {
        Logger.d("sPackageInstaller: packageName = ", packageName);

        final PackageManager packageManager = context.getPackageManager();
        final String installerPackageName = packageManager.getInstallerPackageName(packageName);

        Logger.d("installerPackageName = ", installerPackageName);

        return NOKIA_INSTALLER.equals(installerPackageName);
    }
220781
public static Set<Class<?>> scanPackageBySuper(String packageName, final Class<?> superClass) {
		return ClassScaner.scanPackageBySuper(packageName, superClass);
	}
947471
public function get($name)
    {
        if (!isset($this->packages[$name])) {
            return null;
        }

        return $this->packages[$name];
    }
474617
public static Predicate<Class<?>> inPackage(final String packageNamePrefix) {
        return clazz -> clazz.getPackage().getName().startsWith(packageNamePrefix);
    }
905941
public SortedSet<String> findClassNames(String search, Integer limit) {
        Map<Package, ClassLoader[]> packageMap = Packages.getPackageMap(getClassLoaders(), ignorePackages);
        return findClassNamesInPackages(search, limit, packageMap);
    }
1368572
protected function getPackage($packageName)
    {
        try {
            $package = $this->packagist->get($packageName);
            $this->getOutput()->writeln(sprintf(
                'Package to install: <info>%s</info> (%s)',
                $package->getName(),
                $package->getDescription()
            ));
            $this->requirePackage($package);
        } catch (ClientErrorResponseException $e) {
            $this->searchPackage($packageName);
        }
    }
17760
@Nullable
    public SoftwareSystem getSoftwareSystemWithName(@Nonnull String name) {
        if (name == null || name.trim().length() == 0) {
            throw new IllegalArgumentException("A software system name must be specified.");
        }

        for (SoftwareSystem softwareSystem : getSoftwareSystems()) {
            if (softwareSystem.getName().equals(name)) {
                return softwareSystem;
            }
        }

        return null;
    }
960014
public final boolean isAlwaysAllowed(final String packageName) {
        if (packageName.equals("java.lang")) {
            return true;
        }
        return Utils.findAllowedByName(getAlwaysAllowed(), packageName) != null;
    }
721934
private static String tryGetForbiddenPackageName(String classAndMethod) {

        for (String pkg : suppressedPackages) {
            if (classAndMethod.startsWith(pkg)) {
                return pkg;
            }
        }
        return null;
    }