/* (non-Javadoc)
@see com.ibm.jaggr.service.config.IConfig#getPackageURIs()
427936
@Override
	public Map<String, Location> getPackageLocations() {
		Map<String, Location> result = new LinkedHashMap<String, Location>();
		for (Entry<String, IPackage>entry : getPackages().entrySet()) {
			IPackage pkg = entry.getValue();
			result.put(pkg.getName(), pkg.getLocation());
		}
		return result;
	}
638313
@FFDCIgnore(URISyntaxException.class)
    public static String namespaceURIToPackage(String namespaceURI) {
        try {
            return nameSpaceURIToPackage(new URI(namespaceURI));
        } catch (URISyntaxException ex) {
            return null;
        }
    }
1145011
private Set<PackageRef> collectPackageDependencies() {
		Set<PackageRef> referencedPackages = new HashSet<PackageRef> ();
		for (TypeRef newReferencedType:importedReferencedTypes) {
			PackageRef packageRef = newReferencedType.getPackageRef();
			if (referencedPackages.contains(packageRef))			// package already known
				continue;
			referencedPackages.add(packageRef);
			System.out.println("Add package: " + packageRef.getFQN());
		}
		return referencedPackages;
	}
1272546
public List<String> findPackages() {
    List<String>	result;
    Iterator<String> packages;

    result   = new ArrayList<>();
    packages = m_Cache.packages();
    while (packages.hasNext())
      result.add(packages.next());
    Collections.sort(result, new StringCompare());

    return result;
  }
543679
public function getPackages()
    {
        if ($this->packages === null) {
            $this->packages = $this->composer->getRepositoryManager()->getLocalRepository()->getCanonicalPackages();
            $this->packages[] = $this->composer->getPackage();
        }

        return $this->packages;
    }
261218
public Content getPackageLink(PackageDoc pkg, Content label) {
        boolean included = pkg != null && pkg.isIncluded();
        if (! included) {
            for (PackageDoc p : configuration.packages) {
                if (p.equals(pkg)) {
                    included = true;
                    break;
                }
            }
        }
        if (included || pkg == null) {
            return getHyperLink(pathString(pkg, DocPaths.PACKAGE_SUMMARY),
                    label);
        } else {
            DocLink crossPkgLink = getCrossPackageLink(utils.getPackageName(pkg));
            if (crossPkgLink != null) {
                return getHyperLink(crossPkgLink, label);
            } else {
                return label;
            }
        }
    }
707460
private Set<PackageResourceReferenceWrapper> addFoundPackageResourceReferences(
		Set<PackageResourceReferenceWrapper> packageResourceReferences, final Class<?> iface)
	{
		final Set<PackageResourceReferenceWrapper> prr = PackageResourceReferences.getInstance()
			.getPackageResourceReferenceMap().get(iface);
		if ((packageResourceReferences != null) && !packageResourceReferences.isEmpty())
		{
			if ((prr != null) && !prr.isEmpty())
			{
				packageResourceReferences.addAll(prr);
			}
			else
			{

			}
		}
		else
		{
			if ((prr != null) && !prr.isEmpty())
			{
				packageResourceReferences = prr;
			}
		}
		return packageResourceReferences;
	}
693241
public List<JvmOperation> getJvmOperationsFromURIs(XtendTypeDeclaration container, String... operationUris) {
		// Collect the JvmOperation prior to any modification for ensuring that
		// URI are pointing the JvmOperations.
		final List<JvmOperation> operations = new ArrayList<>();
		final ResourceSet resourceSet = container.eResource().getResourceSet();
		for (final String operationUriAsString : operationUris) {
			final URI operationURI = URI.createURI(operationUriAsString);
			final EObject overridden = resourceSet.getEObject(operationURI, true);
			if (overridden instanceof JvmOperation) {
				final JvmOperation operation = (JvmOperation) overridden;
				if (this.annotationFinder.findAnnotation(operation, DefaultValueUse.class) == null) {
					operations.add(operation);
				}
			}
		}
		return operations;
	}
1261807
Package getPackage(IntermediateParseResults intermediateResults, String packageId) {
    Package aPackage = intermediateResults.getPackage(packageId);
    if (aPackage == null) {
      aPackage = dataService.findOneById(PackageMetadata.PACKAGE, packageId, Package.class);
    }
    return aPackage;
  }
291875
private static void getParameterizedTypePackageNames(ParameterizedType type,
      Map<String, Class<?>> packageNames) {
    for (Type argumentType : type.getActualTypeArguments()) {
      getTypePackageNames(argumentType, packageNames);
    }

    getTypePackageNames(type.getRawType(), packageNames);
    Type ownerType = type.getOwnerType();
    if (ownerType != null) {
      getTypePackageNames(ownerType, packageNames);
    }
  }
825123
public void getExportedPackages(Set<String> exportedPackages) {
		if (exportedPackages != null) {
			exportedPackages.add(getCodeElementExtractor().getBasePackage());
			exportedPackages.add(getCodeElementExtractor().getBuilderPackage());
			if (getCodeBuilderConfig().isISourceAppendableEnable()) {
				exportedPackages.add(getCodeElementExtractor().getAppenderPackage());
			}
		}
	}
437475
protected List<TemplatePackInfo> getBootstrapPacksInfo() {
        if (bootstrapPacksInfo == null) {
            bootstrapPacksInfo = getCelerioApplicationContext().getBean(ClasspathTemplatePackInfoLoader.class).resolveTopLevelPacks();
        }
        return bootstrapPacksInfo;
    }
143421
public static URL[] getClassPathJars(final Bundle bundle) {
		final List<URL> urls = new ArrayList<>();
		final String bundleClasspath = (String) bundle.getHeaders().get(
				"Bundle-ClassPath");
		if (bundleClasspath != null) {
			String[] segments = bundleClasspath.split(",");
			for (String segment : segments) {
				final URL url = bundle.getEntry(segment);
				if (url != null) {
					if (url.toExternalForm().endsWith("jar")) {
						LOG.debug("Using url: " + url);
						try {
							URL jarUrl = new URL("jar:" + url.toExternalForm()
									+ "!/");
							urls.add(jarUrl);
						} catch (MalformedURLException ignore) {
							LOG.debug(ignore.getMessage());
						}
					}
				}
			}
		}
		LOG.debug("Bundle-ClassPath URLs: " + urls);
		// adds the depending bundles to the "classloader" space
		urls.addAll(getLocationsOfBundlesInClassSpace(bundle));

		return urls.toArray(new URL[urls.size()]);
	}
872770
public static List<String> getSourcePaths() throws PackageManager.NameNotFoundException, IOException {
        ApplicationInfo applicationInfo = getPackageManager().getApplicationInfo(getPackageName(), 0);
        File sourceApk = new File(applicationInfo.sourceDir);
        File dexDir = new File(applicationInfo.dataDir, SECONDARY_FOLDER_NAME);
        File instantRunDir = new File(applicationInfo.dataDir, INSTANT_RUN_DEX_DIR_PATH); //default instant-run dir

        List<String> sourcePaths = new ArrayList<>();
        sourcePaths.add(applicationInfo.sourceDir); //add the default apk path

        if (instantRunDir.exists()) { //check if app using instant run
            for(final File dexFile : instantRunDir.listFiles()) { //add all sources from instan-run
                sourcePaths.add(dexFile.getAbsolutePath());
            }
        }

        //the prefix of extracted file, ie: test.classes
        String extractedFilePrefix = sourceApk.getName() + EXTRACTED_NAME_EXT;
        //the total dex numbers
        int totalDexNumber = getMultiDexPreferences().getInt(KEY_DEX_NUMBER, 1);

        for (int secondaryNumber = 2; secondaryNumber <= totalDexNumber; secondaryNumber++) {
            //for each dex file, ie: test.classes2.zip, test.classes3.zip...
            String fileName = extractedFilePrefix + secondaryNumber + EXTRACTED_SUFFIX;
            File extractedFile = new File(dexDir, fileName);
            if (extractedFile.isFile()) {
                sourcePaths.add(extractedFile.getAbsolutePath());
                //we ignore the verify zip part
            }
        }

        return sourcePaths;
    }
829306
public java.util.List<BundleTask> getBundleTasks() {
        if (bundleTasks == null) {
            bundleTasks = new com.amazonaws.internal.SdkInternalList<BundleTask>();
        }
        return bundleTasks;
    }
567922
public String getJavaPackage() {
		String javaPackage = getJavaGroupId(); 
		if (!isGroupIdSuffixedWithArtifactId()) {
			javaPackage += "." + getJavaArtifactId(); 
		}
		return javaPackage.toLowerCase();
	}
576720
public TypeRepository getTypeRepository() {
        if (typeRepository == null) {
            typeRepository = new DefaultTypeRepository(getPackageNames(), getExclusions(), getUrlClassLoader());
        }
        return typeRepository;
    }