/** * Provide any macro substitutions and versions for exported packages. */ void augmentExports() { for (String packageName : exports.keySet()) { setProperty(CURRENT_PACKAGE, packageName); try { Map<String, String> attributes = exports.get(packageName); Map<String, String> exporterAttributes = classpathExports.get(packageName); if (exporterAttributes == null) continue; for (Map.Entry<String, String> entry : exporterAttributes.entrySet()) { String key = entry.getKey(); if (key.equalsIgnoreCase(SPECIFICATION_VERSION)) key = VERSION_ATTRIBUTE; if (!key.endsWith(":") && !attributes.containsKey(key)) { attributes.put(key, entry.getValue()); } } fixupAttributes(attributes); removeAttributes(attributes); } finally { unsetProperty(CURRENT_PACKAGE); } } }
/** * Find some more information about imports in manifest and other places. */ void augmentImports() { for (String packageName : imports.keySet()) { setProperty(CURRENT_PACKAGE, packageName); try { Map<String, String> importAttributes = imports.get(packageName); Map<String, String> exporterAttributes = classpathExports.get(packageName); if (exporterAttributes == null) exporterAttributes = exports.get(packageName); if (exporterAttributes != null) { augmentVersion(importAttributes, exporterAttributes); augmentMandatory(importAttributes, exporterAttributes); if (exporterAttributes.containsKey(IMPORT_DIRECTIVE)) importAttributes.put(IMPORT_DIRECTIVE, exporterAttributes.get(IMPORT_DIRECTIVE)); } fixupAttributes(importAttributes); removeAttributes(importAttributes); } finally { unsetProperty(CURRENT_PACKAGE); } } }