Checks if the package is always OK.

@param packageName
Name of the package to check.

@return If the package is always allowed <code>true</code> else <code>false</code>.
960014
public final boolean isAlwaysAllowed(final String packageName) {
        if (packageName.equals("java.lang")) {
            return true;
        }
        return Utils.findAllowedByName(getAlwaysAllowed(), packageName) != 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(""));
    }
608760
public static boolean isMdwPackage(String packageName) {
        return packageName.startsWith("com.centurylink.mdw.") &&
                !packageName.startsWith("com.centurylink.mdw.demo") &&
                !packageName.startsWith("com.centurylink.mdw.oracle") &&
                !packageName.startsWith("com.centurylink.mdw.ibmmq") &&
                !packageName.startsWith("com.centurylink.mdw.tibco") &&
                !packageName.startsWith("com.centurylink.mdw.tests.ibmmq") &&
                !packageName.startsWith("com.centurylink.mdw.tests.tibco") &&
                !packageName.startsWith("com.centurylink.mdw.internal") &&
                !packageName.startsWith("com.centurylink.mdw.ignore") &&
                !packageName.startsWith("com.centurylink.mdw.node.node_modules") &&
                !packageName.startsWith("com.centurylink.mdw.authCTL") &&
                !packageName.startsWith("com.centurylink.mdw.emp") &&
                !packageName.startsWith("com.centurylink.mdw.statusmgr") &&
                !packageName.startsWith("com.centurylink.mdw.tests.statusmgr");
    }
467041
public void process(String packageNames) {

		if (packageNames == null) {
			processPackage("", true);
			return;
		}

		String[] pkgs = packageNames.split(",");
		for (int i = 0; i < pkgs.length; i++) {

			String pkg = pkgs[i].trim().replace('.', '/');

			boolean recurse = false;
			if (pkg.endsWith("**")) {
				recurse = true;
				pkg = pkg.substring(0, pkg.length() - 2);
			} else if (pkg.endsWith("*")) {
				recurse = true;
				pkg = pkg.substring(0, pkg.length() - 1);
			}
			
			pkg = trimSlash(pkg);

			processPackage(pkg, recurse);
		}
	}
1019018
protected boolean has(String extensionName) {
		List<Extensions> extensions = getExtensions(extensionName);
		return extensions != null && !extensions.isEmpty();
	}
711192
def packageExists(self, package):
		
		url = "%s/packages" % self.base_url
		params = {"pattern": package}
		response = requests.get(url, params=params)
		if response.status_code != requests.codes.ok:
			return False

		return True
1363073
protected boolean isInvalidResourceName(String resourceName) {

        if (resourceName == null) {
            return true;
        }
        try {

            m_cms.readResource(resourceName);
            return false;
        } catch (CmsException e) {
            //Ok, resource not valid..
        }
        return true;
    }
499508
public static boolean classAllowed(String className) {
        for (String name: BLACK_LIST) {
            if (className.startsWith(name)) {
                return false;
            }
        }
        return true;
    }
856109
public static boolean isValidClassName(String s) {
        if (s.length() < 1) return false;
        if (s.equals("package-info")) return true;
        if (surrogatesSupported) {
            int cp = s.codePointAt(0);
            if (!Character.isJavaIdentifierStart(cp))
                return false;
            for (int j = Character.charCount(cp); j < s.length(); j += Character.charCount(cp)) {
                cp = s.codePointAt(j);
                if (!Character.isJavaIdentifierPart(cp))
                    return false;
            }
        } else {
            if (!Character.isJavaIdentifierStart(s.charAt(0)))
                return false;
            for (int j = 1; j < s.length(); j++)
                if (!Character.isJavaIdentifierPart(s.charAt(j)))
                    return false;
        }
        return true;
    }
14802
protected boolean isApplicationClass(String className) {
        for (String packageName : packagesToFilter) {
            if (className.startsWith(packageName)) return false;
        }
        return true;
    }
1321979
protected Package getPackage(String name) {
        Package pkg;
        synchronized (packages) {
            pkg = packages.get(name);
        }
        return pkg;
    }
29142
private boolean specificMatching(String className) {

    for (int i = 0; i < processPackages.length; i++) {
      if (className.startsWith(processPackages[i])) {
        // a positive match
        return false;
      }
    }
    // we can ignore this class
    return true;
  }
956766
public static boolean isIgnorableBinName(String className) {
        return (className.startsWith("[", 0)
                || className.startsWith(JAVA_BIN, 0)
                || className.startsWith(JAVAX_BIN, 0)
                || className.startsWith(JDK_BIN, 0)
                || className.startsWith(SUN_BIN, 0)
                || className.startsWith(COM_SUN_BIN, 0)
                || className.startsWith(ORG_XML_SAX_BIN, 0)
                || className.startsWith(ORG_IETF_JGSS_BIN, 0)
                || className.startsWith(ORG_OMG_BIN, 0)
                || className.startsWith(ORG_W3C_BIN, 0)
                || className.startsWith(XTS_BIN, 0)
                || className.startsWith(ORG_MOCKITO_BIN, 0)
                || className.startsWith(ORG_JACOCO_AGENT_BIN, 0));
    }
530937
protected boolean filter(String name) {

        if (name == null)
            return false;

        // Looking up the package
        String packageName = null;
        int pos = name.lastIndexOf('.');
        if (pos != -1)
            packageName = name.substring(0, pos);
        else
            return false;

        for (int i = 0; i < packageTriggers.length; i++) {
            if (packageName.startsWith(packageTriggers[i]))
                return true;
        }

        return false;

    }
1205306
public boolean isExternal(ProgramElementDoc doc) {
        if (packageToItemMap == null) {
            return false;
        }
        return packageToItemMap.get(doc.containingPackage().name()) != null;
    }
21117
public boolean isIBMPackage(String packageName) {
        if (packageName != null) {
            BundlePackages p = populatePackageLists();
            // If we still can't get our list of packages (for example, in unit tests), let everything pass
            if (p != null) {
                if (p.containsPrivatePackage(packageName)) {
                    return true;
                } else if (p.containsExportedPackage(packageName)) {
                    // Add an extra check - if this is an exported package, it could be spec or third-party, not IBM
                    SharedPackageInspector inspector = st.getService();
                    if (inspector != null) {
                        PackageType exported = inspector.getExportedPackageType(packageName);
                        // If it's spec, third party, or stable it's not internal - otherwise, it is
                        if ( exported == null )
                            return true;
                        if ( exported.isSpecApi() || exported.isThirdPartyApi() || exported.isStableApi() ) 
                            return false;
                        
                        return true;
                    }

                    // If we couldn't get hold of the service, assume it was internal if our bundles export it
                    return true;
                }

            }
        }
        return false;
    }
419144
private static boolean isInternal(String clsName) {
        boolean internal = false;
        for (String internalPackage : internalPackages) {
            if (clsName.startsWith(internalPackage)) {
                internal = true;
                break;
            }
        }

        if (internal) {
            for (String externalPackage : externalPackages) {
                if (clsName.startsWith(externalPackage)) {
                    internal = false;
                    break;
                }
            }
        }

        return internal;
    }