You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ro...@apache.org on 2022/07/05 13:02:24 UTC
[felix-dev] branch master updated: [FELIX-6491] Extend List of niceManifest headers
This is an automated email from the ASF dual-hosted git repository.
rotty3000 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/felix-dev.git
The following commit(s) were added to refs/heads/master by this push:
new 3b1696bc38 [FELIX-6491] Extend List of niceManifest headers
3b1696bc38 is described below
commit 3b1696bc3858b23aa25d5abb54be23044835a12f
Author: Hannes Wellmann <we...@gmx.net>
AuthorDate: Mon Sep 6 12:27:58 2021 +0200
[FELIX-6491] Extend List of niceManifest headers
---
.../org/apache/felix/bundleplugin/ManifestWriter.java | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/ManifestWriter.java b/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/ManifestWriter.java
index 1866831ad3..9fc7268d5b 100644
--- a/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/ManifestWriter.java
+++ b/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/ManifestWriter.java
@@ -20,6 +20,7 @@ package org.apache.felix.bundleplugin;
import java.io.IOException;
import java.io.OutputStream;
+import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Map;
@@ -56,11 +57,11 @@ public class ManifestWriter {
* <p>
* As a bonus, we can now sort the manifest!
*/
- static byte[] CONTINUE = new byte[] {
+ private static final byte[] CONTINUE = new byte[] {
'\r', '\n', ' '
};
- static Set<String> NICE_HEADERS = new HashSet<>(
+ private static final Set<String> NICE_HEADERS = new HashSet<>(
Arrays.asList(
Constants.IMPORT_PACKAGE,
Constants.DYNAMICIMPORT_PACKAGE,
@@ -68,7 +69,10 @@ public class ManifestWriter {
Constants.REQUIRE_CAPABILITY,
Constants.EXPORT_PACKAGE,
Constants.EXPORT_SERVICE,
- Constants.PROVIDE_CAPABILITY
+ Constants.PROVIDE_CAPABILITY,
+ Constants.REQUIRE_BUNDLE,
+ Constants.BUNDLE_CLASSPATH,
+ DependencyEmbedder.EMBEDDED_ARTIFACTS
)
);
@@ -140,7 +144,7 @@ public class ManifestWriter {
* when something fails
*/
private static int write(OutputStream out, int i, String s) throws IOException {
- byte[] bytes = s.getBytes("UTF8");
+ byte[] bytes = s.getBytes(StandardCharsets.UTF_8);
return write(out, i, bytes);
}
@@ -189,9 +193,7 @@ public class ManifestWriter {
map.put(entry.getKey().toString(), entry.getValue().toString());
}
- map.remove("Manifest-Version"); // get rid of
- // manifest
- // version
+ map.remove("Manifest-Version"); // get rid of manifest version
for (Map.Entry<String,String> entry : map.entrySet()) {
writeEntry(out, entry.getKey(), entry.getValue(), nice);
}