Return true if the given package has constant fields to document.

@param pkg   the package being checked.
@return true if the given package has constant fields to document.
548438
private boolean hasConstantField(PackageDoc pkg) {
        ClassDoc[] classes;
        if (pkg.name().length() > 0) {
            classes = pkg.allClasses();
        } else {
            classes = configuration.classDocCatalog.allClasses(
                DocletConstants.DEFAULT_PACKAGE_NAME);
        }
        boolean found = false;
        for (int j = 0; j < classes.length; j++){
            if (classes[j].isIncluded() && hasConstantField(classes[j])) {
                found = true;
            }
        }
        return found;
    }
1070618
private String parsePackageName(String pkgname) {
        int index = -1;
        for (int j = 0; j < MAX_CONSTANT_VALUE_INDEX_LENGTH; j++) {
            index = pkgname.indexOf(".", index + 1);
        }
        if (index != -1) {
            pkgname = pkgname.substring(0, index);
        }
        return pkgname;
    }
665257
public static String getPackageName(Class< ? > clazz,
                                        Package pkg) {
        String pkgName = "";
        if ( pkg == null ) {
            int index = clazz.getName().lastIndexOf( '.' );
            if ( index != -1 ) pkgName = clazz.getName().substring( 0,
                                                                    index );
        } else {
            pkgName = pkg.getName();
        }
        return pkgName;

    }
1286983
private boolean hasPrintedPackageIndex(String pkgname) {
        String[] list = printedPackageHeaders.toArray(new String[] {});
        for (int i = 0; i < list.length; i++) {
            if (pkgname.startsWith(list[i])) {
                return true;
            }
        }
        return false;
    }
1134729
@SuppressWarnings("unused")
    public boolean isAssetOutput(String path) {
        for (String pkg : getPackageNames()) {
            if (path.startsWith(pkg) || path.startsWith(pkg.replace('.', '/')))
                return true;
        }
        return false;
    }
1189625
@Override
	public boolean hasNextCase() {
		for (ConstraintWrap wrap : summands) {
			if (wrap.constraint.hasNextCase()) {
				return true;
			}
		}
		return false;
	}
951173
public boolean isIncluded() {
        if (isIncluded) {
            return true;
        }
        if (env.shouldDocument(tsym)) {
            // Class is nameable from top-level and
            // the class and all enclosing classes
            // pass the modifier filter.
            if (containingPackage().isIncluded()) {
                return isIncluded=true;
            }
            ClassDoc outer = containingClass();
            if (outer != null && outer.isIncluded()) {
                return isIncluded=true;
            }
        }
        return false;
    }
86329
def is_build_linked(source, pkg):
        
        for line in source.split("\n"):
            if re.search(r"(api|compile)\s+project\(['\"]:{}['\"]\)".format(pkg),
                         line):
                return True
        return False
368808
function hasConfigSetting(pkg, setting) {
  return pkg.config && pkg.config[appName] && pkg.config[appName][setting];
}
490765
private static void initFromPackage(PackageDescriptor pd,
                                        Package pkg) {

        pd.setExists(true);

        String specificationTitle = pkg.getSpecificationTitle();
        String specificationVersion = pkg.getSpecificationVersion(); 
        String specificationVendor = pkg.getSpecificationVendor();

        String implementationTitle = pkg.getImplementationTitle();
        String implementationVersion = pkg.getImplementationVersion(); 
        String implementationVendor = pkg.getImplementationVendor();

        if (implementationTitle == null) {
            implementationTitle = specificationTitle;
        }

        if (implementationVersion == null) {
            implementationVersion = specificationVersion;
        }

        if (implementationVendor == null) {
            implementationVendor = specificationVendor;
        }


        pd.setSpecificationTitle(specificationTitle);
        pd.setSpecificationVersion(specificationVersion);
        pd.setSpecificationVendor(specificationVendor);

        pd.setImplementationTitle(implementationTitle);
        pd.setImplementationVersion(implementationVersion);
        pd.setImplementationVendor(implementationVendor);

        pd.setProduct(implementationTitle);
        pd.setProductVersion(implementationVersion);
    }
1170453
function checkPkg(pkgDir, scopes) {
  var errors;
  try {
    var config = {packageDir: pkgDir};
    if (scopes) {
      config.scopeList = scopes;
    }
    var checked = checkDeps.sync(config);
    if (checked.error.length) {
      errors = checked.error;
    }
  } finally {
    // eslint-disable-next-line no-unsafe-finally
    return errors;
  }
}
120637
public static boolean isPackageValid(final Class type) {
        boolean res = false;
        if (type != null) {
            final Package packaj = type.getPackage();
            res = !(packaj == null || packaj.getName().startsWith("java"));
        }
        return res;
    }
291317
private boolean validateAppSignatureForPackage(Context context, String packageName) {

        PackageInfo packageInfo;
        try {
            packageInfo = context.getPackageManager().getPackageInfo(packageName, PackageManager.GET_SIGNATURES);
        } catch (NameNotFoundException e) {
            return false;
        }

        for (Signature signature : packageInfo.signatures) {
            if (signature.toCharsString().equals(FB_APP_SIGNATURE)) {
                return true;
            }
        }
        return false;
    }
968599
public function isForPackage(PackageInterface $package)
    {
        if ($this->getForPackage() !== $package->getName()) {
            return false;
        }
        $fpv = $this->getForPackageVersion();
        if ($fpv !== null) {
            $pv = new Constraint('=', $package->getVersion());
            if (!$fpv->matches($pv)) {
                return false;
            }
        }

        return true;
    }
599836
private boolean checkPathAndPackage(Path dir, JCTree pkgName) {
        Iterator<String> pathIter = new ParentIterator(dir);
        Iterator<String> pkgIter = new EnclosingPkgIterator(pkgName);
        while (pathIter.hasNext() && pkgIter.hasNext()) {
            if (!pathIter.next().equals(pkgIter.next()))
                return false;
        }
        return !pkgIter.hasNext(); /*&& !pathIter.hasNext() See JDK-8059598 */
    }
96515
@PublicAPI(usage = ACCESS)
    public static Set<Location> ofPackage(String pkg) {
        ImmutableSet.Builder<Location> result = ImmutableSet.builder();
        for (Location location : getLocationsOf(asResourceName(pkg))) {
            result.add(location);
        }
        return result.build();
    }
256769
public String parsePackageName(PackageElement p) {
        String pkgname = p.isUnnamed() ? "" : getPackageName(p);
        int index = -1;
        for (int j = 0; j < MAX_CONSTANT_VALUE_INDEX_LENGTH; j++) {
            index = pkgname.indexOf(".", index + 1);
        }
        if (index != -1) {
            pkgname = pkgname.substring(0, index);
        }
        return pkgname;
    }