code: public static PackageDescriptor forName(String packageName,
                                              ClassLoader classLoader) {
          
          PackageDescriptor pd = new PackageDescriptor(packageName);
          if (classLoader == null) {
              classLoader = ClassLoader.getSystemClassLoader();
          }
          
          if (packageName == null || packageName.trim().length() == 0) {
              return pd;
          }
          
          String packageInfoClassName = packageName;
  
          if (!packageInfoClassName.endsWith(".")) {
              packageInfoClassName = packageInfoClassName + ".";
          }
          
          packageInfoClassName = packageInfoClassName + "PackageInfo";
  
  
          Class<?> packageInfoClass = null;
          
          try {
              if (classLoader != null) {
                  packageInfoClass = 
                      classLoader.loadClass(packageInfoClassName);
              }
              else {
                  packageInfoClass = Class.forName(packageInfoClassName);
              }
          }
          catch (Throwable t) {
          }
  
          if (packageInfoClass != null) {
              try {
                  initFromPackageInfo(pd, packageInfoClass);
              }
              catch (Throwable t) {
              }
          }
          else {
  
              Package pkg = null;
              
              if (classLoader != null) {
                  // Get around getPackage's protected access
                  PackageLoader packageLoader = 
                      new PackageLoader(classLoader);
                  
                  pkg = packageLoader.getPackage(packageName);
              }
              
              if (pkg == null) {
                  pkg = Package.getPackage(packageName);
              }                        
  
              if (pkg != null) {
                  initFromPackage(pd, pkg);
              }
          }
  
          return pd;
      }
docs: Creates a PackageDescriptor for the named package using the
  specified ClassLoader to load the PackageInfo or Package.