You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by jb...@apache.org on 2021/03/23 13:27:35 UTC

[felix-dev] 01/03: Revert "[FELIX-6337] Maven Bundle Plugin generates incorrect Provide-Capability"

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 b0b577bc85bdc620f7c2c53ec4bda58e32e86b8b
Author: jbonofre <jb...@apache.org>
AuthorDate: Tue Mar 23 14:11:05 2021 +0100

    Revert "[FELIX-6337] Maven Bundle Plugin generates incorrect Provide-Capability"
    
    This reverts commit 4c9f671710b65b94432d3626fd4045a32f0ac083.
---
 .../apache/felix/bundleplugin/BundlePlugin.java    | 38 +++++++---------------
 1 file changed, 12 insertions(+), 26 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 55eae79..136acb2 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
@@ -1214,33 +1214,19 @@ public class BundlePlugin extends AbstractMojo
         String header = attributes.getValue( name );
         if ( header != null )
         {
-            Parameters parameters = OSGiHeader.parseHeader(header, null);
-            Parameters sorted = new Parameters();
-            for ( Entry<String, Attrs> entry : parameters.entrySet() )
+            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 );
-                    Attrs sortedAttrs = new Attrs();
-                    newAttrs.forEach( (k, v) ->
-                    {
-                        if ( v.contains( "," ) )
-                        {
-                            sortedAttrs.putTyped( k, v.split( "," ) );
-                        }
-                        else
-                        {
-                            sortedAttrs.putTyped( k, v );
-                        }
-                    });
-                    sorted.put( key, sortedAttrs );
-                }
-                String nh = sorted.toString();
-                attributes.putValue( name, nh );
-            }
+                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 );
         }
     }