Skip to content
Permalink
Browse files
Merge pull request #58 from Fenrock/felix6337
[FELIX-6337] Maven Bundle Plugin generates incorrect Provide-Capability
  • Loading branch information
jbonofre committed Mar 23, 2021
2 parents 9417fc7 + 4c9f671 commit 6f12db3a559a3608e013cd5db9132a200155d98c
Showing 1 changed file with 26 additions and 12 deletions.
@@ -1214,19 +1214,33 @@ 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() )
Parameters parameters = OSGiHeader.parseHeader(header, null);
Parameters sorted = new Parameters();
for ( Entry<String, Attrs> entry : parameters.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 );
{
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 );
}
}
}

0 comments on commit 6f12db3

Please sign in to comment.