protected Package definePackage(String packageName,Manifest manifest,URL url) throws IllegalArgumentException {
  Attributes mainAttributes=manifest.getMainAttributes();
  String dirName=packageName.replace('.','/') + "/";
  Attributes packageAttributes=manifest.getAttributes(dirName);
  boolean noEntry=false;
  if (packageAttributes == null) {
    noEntry=true;
    packageAttributes=mainAttributes;
  }
  String specificationTitle=packageAttributes.getValue(Attributes.Name.SPECIFICATION_TITLE);
  if (specificationTitle == null && !noEntry) {
    specificationTitle=mainAttributes.getValue(Attributes.Name.SPECIFICATION_TITLE);
  }
  String specificationVersion=packageAttributes.getValue(Attributes.Name.SPECIFICATION_VERSION);
  if (specificationVersion == null && !noEntry) {
    specificationVersion=mainAttributes.getValue(Attributes.Name.SPECIFICATION_VERSION);
  }
  String specificationVendor=packageAttributes.getValue(Attributes.Name.SPECIFICATION_VENDOR);
  if (specificationVendor == null && !noEntry) {
    specificationVendor=mainAttributes.getValue(Attributes.Name.SPECIFICATION_VENDOR);
  }
  String implementationTitle=packageAttributes.getValue(Attributes.Name.IMPLEMENTATION_TITLE);
  if (implementationTitle == null && !noEntry) {
    implementationTitle=mainAttributes.getValue(Attributes.Name.IMPLEMENTATION_TITLE);
  }
  String implementationVersion=packageAttributes.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
  if (implementationVersion == null && !noEntry) {
    implementationVersion=mainAttributes.getValue(Attributes.Name.IMPLEMENTATION_VERSION);
  }
  String implementationVendor=packageAttributes.getValue(Attributes.Name.IMPLEMENTATION_VENDOR);
  if (implementationVendor == null && !noEntry) {
    implementationVendor=mainAttributes.getValue(Attributes.Name.IMPLEMENTATION_VENDOR);
  }
  return definePackage(packageName,specificationTitle,specificationVersion,specificationVendor,implementationTitle,implementationVersion,implementationVendor,isSealed(manifest,dirName) ? url : null);
}

protected Package definePackage ( String packageName , Manifest manifest , URL url ) throws IllegalArgumentException { Attributes mainAttributes = manifest . getMainAttributes ( ) ; String dirName = packageName . replace ( '.' , '/' ) + "/" ; Attributes packageAttributes = manifest . getAttributes ( dirName ) ; boolean noEntry = false ; if ( packageAttributes == null ) { noEntry = true ; packageAttributes = mainAttributes ; } String specificationTitle = packageAttributes . getValue ( Attributes . Name . SPECIFICATION_TITLE ) ; if ( specificationTitle == null && ! noEntry ) { specificationTitle = mainAttributes . getValue ( Attributes . Name . SPECIFICATION_TITLE ) ; } String specificationVersion = packageAttributes . getValue ( Attributes . Name . SPECIFICATION_VERSION ) ; if ( specificationVersion == null && ! noEntry ) { specificationVersion = mainAttributes . getValue ( Attributes . Name . SPECIFICATION_VERSION ) ; } String specificationVendor = packageAttributes . getValue ( Attributes . Name . SPECIFICATION_VENDOR ) ; if ( specificationVendor == null && ! noEntry ) { specificationVendor = mainAttributes . getValue ( Attributes . Name . SPECIFICATION_VENDOR ) ; } String implementationTitle = packageAttributes . getValue ( Attributes . Name . IMPLEMENTATION_TITLE ) ; if ( implementationTitle == null && ! noEntry ) { implementationTitle = mainAttributes . getValue ( Attributes . Name . IMPLEMENTATION_TITLE ) ; } String implementationVersion = packageAttributes . getValue ( Attributes . Name . IMPLEMENTATION_VERSION ) ; if ( implementationVersion == null && ! noEntry ) { implementationVersion = mainAttributes . getValue ( Attributes . Name . IMPLEMENTATION_VERSION ) ; } String implementationVendor = packageAttributes . getValue ( Attributes . Name . IMPLEMENTATION_VENDOR ) ; if ( implementationVendor == null && ! noEntry ) { implementationVendor = mainAttributes . getValue ( Attributes . Name . IMPLEMENTATION_VENDOR ) ; } return definePackage ( packageName , specificationTitle , specificationVersion , specificationVendor , implementationTitle , implementationVersion , implementationVendor , isSealed ( manifest , dirName ) ? url : null ) ; }
defines a new package using the information extracted from the specified manifest .
