Fixes FELIX-2812: The <Embed-Dependency> filter can fail if your matching against multiple "*" artifact ids.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1064938 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java
index d19d549..06cf109 100644
--- a/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java
+++ b/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java
@@ -115,16 +115,17 @@
StringBuilder tag = new StringBuilder();
tag.append( clause.getKey() );
- filter = new DependencyFilter( ( String ) clause.getKey() )
- {
- boolean matches( Artifact dependency )
+ if( !((String)clause.getKey()).matches("\\*~*") ) {
+ filter = new DependencyFilter( ( String ) clause.getKey() )
{
- return super.matches( dependency.getArtifactId() );
- }
- };
-
- // FILTER ON MAIN CLAUSE
- filter.filter( filteredDependencies );
+ boolean matches( Artifact dependency )
+ {
+ return super.matches( dependency.getArtifactId() );
+ }
+ };
+ // FILTER ON MAIN CLAUSE
+ filter.filter( filteredDependencies );
+ }
for ( Iterator attrIterator = ( ( Map ) clause.getValue() ).entrySet().iterator(); attrIterator.hasNext(); )
{