Set<SystemPackage> exportPackages = null;
final Manifest manifest = jarFile.getManifest();
if (manifest != null) {
final Map<String, String> contents = convertAttributesToMap(manifest.getMainAttributes());
try {
final BundleManifest bundleManifest = new StandardBundleManifest(new DummyParserLogger(), contents);
if (bundleManifest.getBundleName() != null) {
final List<ExportedPackage> exportedPackages = bundleManifest.getExportPackage().getExportedPackages();
exportPackages = new LinkedHashSet<SystemPackage>(exportedPackages.size());
for (final ExportedPackage exportedPackage : exportedPackages) {
final SystemPackage exportPackage = new SystemPackage(exportedPackage.getPackageName(),
exportedPackage.getVersion().toString());
exportPackages.add(exportPackage);