Source:
Map<String, String> getRawHeaders() { synchronized (genMonitor) { if (rawHeaders == null) { BundleFile bFile = getBundleFile(); if (this.contentType != null && this.contentType == Type.CONNECT) { if (bFile instanceof BundleFileWrapperChain) { BundleFileWrapperChain chain = ((BundleFileWrapperChain) bFile); while (chain.getNext() != null) { chain = chain.getNext(); } bFile = chain.getBundleFile(); } if (bFile instanceof ConnectBundleFile) { rawHeaders = ((ConnectBundleFile) bFile).getConnectHeaders(); } } if (rawHeaders == null) { BundleEntry manifest = bFile.getEntry(OSGI_BUNDLE_MANIFEST); if (manifest == null) { rawHeaders = Collections.emptyMap(); } else { try { Map<String, String> merged = ManifestElement.parseBundleManifest(manifest.getInputStream(), new CaseInsensitiveDictionaryMap<String, String>()); if (Boolean.parseBoolean(merged.get(MULTI_RELEASE_HEADER))) { for (int i = getStorage().getRuntimeVersion().getMajor(); i > 8; i--) { String versionManifest = "META-INF/versions/" + i + "/OSGI-INF/MANIFEST.MF"; BundleEntry versionEntry = getBundleFile().getEntry(versionManifest); if (versionEntry != null) { Map<String, String> versioned = ManifestElement.parseBundleManifest(versionEntry.getInputStream(), new CaseInsensitiveDictionaryMap<String, String>()); String versionedImport = versioned.get(Constants.IMPORT_PACKAGE); String versionedRequireCap = versioned.get(Constants.REQUIRE_CAPABILITY); if (versionedImport != null) { merged.put(Constants.IMPORT_PACKAGE, versionedImport); } if (versionedRequireCap != null) { merged.put(Constants.REQUIRE_CAPABILITY, versionedRequireCap); } break; } } } rawHeaders = Collections.unmodifiableMap(merged); } catch (Exception e) { if (e instanceof RuntimeException) { throw (RuntimeException) e; } throw new RuntimeException("Error occurred getting the bundle manifest.", e); } } } } return rawHeaders; } }

Target:
Map<String, String> getRawHeaders() { synchronized (genMonitor) { if (rawHeaders == null) { BundleFile bFile = getBundleFile(); if (this.contentType == Type.CONNECT) { if (bFile instanceof BundleFileWrapperChain) { bFile = ((BundleFileWrapperChain) bFile).getWrappedType(ConnectBundleFile.class); } rawHeaders = ((ConnectBundleFile) bFile).getConnectHeaders(); if (rawHeaders != null) { return rawHeaders; } } BundleEntry manifest = bFile.getEntry(OSGI_BUNDLE_MANIFEST); if (manifest == null) { rawHeaders = Collections.emptyMap(); } else { try { Map<String, String> merged = ManifestElement.parseBundleManifest(manifest.getInputStream(), new CaseInsensitiveDictionaryMap<String, String>()); if (Boolean.parseBoolean(merged.get(MULTI_RELEASE_HEADER))) { for (int i = getStorage().getRuntimeVersion().getMajor(); i > 8; i--) { String versionManifest = "META-INF/versions/" + i + "/OSGI-INF/MANIFEST.MF"; BundleEntry versionEntry = getBundleFile().getEntry(versionManifest); if (versionEntry != null) { Map<String, String> versioned = ManifestElement.parseBundleManifest(versionEntry.getInputStream(), new CaseInsensitiveDictionaryMap<String, String>()); String versionedImport = versioned.get(Constants.IMPORT_PACKAGE); String versionedRequireCap = versioned.get(Constants.REQUIRE_CAPABILITY); if (versionedImport != null) { merged.put(Constants.IMPORT_PACKAGE, versionedImport); } if (versionedRequireCap != null) { merged.put(Constants.REQUIRE_CAPABILITY, versionedRequireCap); } break; } } } rawHeaders = Collections.unmodifiableMap(merged); } catch (Exception e) { if (e instanceof RuntimeException) { throw (RuntimeException) e; } throw new RuntimeException("Error occurred getting the bundle manifest.", e); } } } return rawHeaders; } }