* @param spec the package specification
* @return the new package
*/
private Package definePackage(final String name, final PackageSpec spec) {
final Module module = this.module;
final ModuleLogger log = Module.log;
log.trace("Attempting to define package %s in %s", name, module);
final Package pkg;
if (spec == null) {
pkg = definePackage(name, null, null, null, null, null, null, null);
} else {
pkg = definePackage(name, spec.getSpecTitle(), spec.getSpecVersion(), spec.getSpecVendor(), spec.getImplTitle(), spec.getImplVersion(), spec.getImplVendor(), spec.getSealBase());
final AssertionSetting setting = spec.getAssertionSetting();
if (setting != AssertionSetting.INHERIT) {
setPackageAssertionStatus(name, setting == AssertionSetting.ENABLED);
}
}
log.trace("Defined package %s in %s", name, module);
return pkg;
}