This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/felix-dev.git
commit 94928ea9530068dfb118ff934fa9082543700df5 Author: jbonofre <[email protected]> AuthorDate: Tue Mar 23 14:13:08 2021 +0100 Revert "[FELIX-6269] Reformat header / capabilities clauses to ensure predictable builds" This reverts commit 76dba132d4abbab75f20dc5096649842c52e4810. --- .../apache/felix/bundleplugin/BundlePlugin.java | 29 ---------------------- 1 file changed, 29 deletions(-) diff --git a/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java index 136acb2..4d190f2 100644 --- a/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java +++ b/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java @@ -36,7 +36,6 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import java.util.Comparator; import java.util.Enumeration; import java.util.HashMap; import java.util.HashSet; @@ -1181,14 +1180,6 @@ public class BundlePlugin extends AbstractMojo bundleManifest.getMainAttributes().putValue( "Import-Package", result ); } - for ( String header : Arrays.asList( Constants.IMPORT_PACKAGE, Constants.DYNAMICIMPORT_PACKAGE, - Constants.EXPORT_PACKAGE, Constants.PRIVATE_PACKAGE, - Constants.PROVIDE_CAPABILITY, Constants.REQUIRE_CAPABILITY, - "Bundle-Blueprint", "Service-Component" ) ) - { - reformatClauses( bundleManifest.getMainAttributes(), header ); - } - jar.setManifest( bundleManifest ); } catch ( Exception e ) @@ -1209,26 +1200,6 @@ public class BundlePlugin extends AbstractMojo builder.setJar( jar ); } - protected static void reformatClauses( Attributes attributes, String name ) - { - String header = attributes.getValue( name ); - if ( header != null ) - { - Map<String, Map<String, String>> params = OSGiHeader.parseHeader( header, null ).toBasic(); - Map<String, Map<String, String>> sorted = new TreeMap<>(); - for ( Map.Entry<String, Map<String, String>> entry : params.entrySet() ) - { - String key = entry.getKey(); - Map<String, String> attrs = entry.getValue(); - Map<String, String> newAttrs = new TreeMap<>( - Comparator.<String, Boolean>comparing( s -> !s.endsWith( ":" ) ).thenComparing( s -> s ) ); - newAttrs.putAll( attrs ); - sorted.put( key, newAttrs ); - } - String nh = new Parameters( sorted ).toString(); - attributes.putValue( name, nh ); - } - } protected static void mergeManifest( Instructions instructions, Manifest... manifests ) throws IOException {
