felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mccu...@apache.org
Subject svn commit: r1189503 - in /felix/trunk/bundleplugin/src: main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java test/java/org/apache/felix/bundleplugin/BundlePluginTest.java
Date Wed, 26 Oct 2011 22:11:22 GMT
Author: mcculls
Date: Wed Oct 26 22:11:22 2011
New Revision: 1189503

URL: http://svn.apache.org/viewvc?rev=1189503&view=rev
Log:
Retain negative operator

Modified:
    felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java
    felix/trunk/bundleplugin/src/test/java/org/apache/felix/bundleplugin/BundlePluginTest.java

Modified: felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java?rev=1189503&r1=1189502&r2=1189503&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java
(original)
+++ felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/AbstractDependencyFilter.java
Wed Oct 26 22:11:22 2011
@@ -39,7 +39,7 @@ import aQute.libg.header.OSGiHeader;
  */
 public abstract class AbstractDependencyFilter
 {
-    private final Pattern MISSING_KEY_PATTERN = Pattern.compile( "^[a-zA-Z]+=" );
+    private static final Pattern MISSING_KEY_PATTERN = Pattern.compile( "^(!)?([a-zA-Z]+=)"
);
 
     /**
      * Dependency artifacts.
@@ -106,12 +106,7 @@ public abstract class AbstractDependency
 
     protected final void processInstructions( String header ) throws MojoExecutionException
     {
-        if ( MISSING_KEY_PATTERN.matcher( header ).lookingAt() )
-        {
-            header = "*;" + header;
-        }
-
-        Map instructions = OSGiHeader.parseHeader( header );
+        Map instructions = OSGiHeader.parseHeader( MISSING_KEY_PATTERN.matcher( header ).replaceFirst(
"$1*;$2" ) );
 
         DependencyFilter filter;
         for ( Iterator clauseIterator = instructions.entrySet().iterator(); clauseIterator.hasNext();
)

Modified: felix/trunk/bundleplugin/src/test/java/org/apache/felix/bundleplugin/BundlePluginTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/test/java/org/apache/felix/bundleplugin/BundlePluginTest.java?rev=1189503&r1=1189502&r2=1189503&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/test/java/org/apache/felix/bundleplugin/BundlePluginTest.java
(original)
+++ felix/trunk/bundleplugin/src/test/java/org/apache/felix/bundleplugin/BundlePluginTest.java
Wed Oct 26 22:11:22 2011
@@ -274,7 +274,12 @@ public class BundlePluginTest extends Ab
     }
 
 
-    public void testEmbedDependencyMissingKey() throws Exception
+    public void testEmbedDependencyNegativeClauses() throws Exception
+    {
+    }
+
+
+    public void testEmbedDependencyMissingPositiveKey() throws Exception
     {
         ArtifactStubFactory artifactFactory = new ArtifactStubFactory( plugin.getOutputDirectory(),
true );
 
@@ -303,7 +308,7 @@ public class BundlePluginTest extends Ab
     }
 
 
-    public void testEmbedDependencyNegativeClauses() throws Exception
+    public void testEmbedDependencyMissingNegativeKey() throws Exception
     {
     }
 }



Mime
View raw message