felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r476515 - /incubator/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalRepositoryImpl.java
Date Sat, 18 Nov 2006 12:57:26 GMT
Author: rickhall
Date: Sat Nov 18 04:57:25 2006
New Revision: 476515

URL: http://svn.apache.org/viewvc?view=rev&rev=476515
Log:
Applied patch (FELIX-173) to properly deal with optional imports of locally
installed bundles.

Modified:
    incubator/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalRepositoryImpl.java

Modified: incubator/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalRepositoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalRepositoryImpl.java?view=diff&rev=476515&r1=476514&r2=476515
==============================================================================
--- incubator/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalRepositoryImpl.java
(original)
+++ incubator/felix/trunk/bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalRepositoryImpl.java
Sat Nov 18 04:57:25 2006
@@ -245,36 +245,34 @@
 
                 for (int impIdx = 0; impIdx < imports.length; impIdx++)
                 {
+                    RequirementImpl req = new RequirementImpl();
+                    req.setMultiple("false");
+                    req.setOptional(Boolean.toString(imports[impIdx].isOptional()));
+                    req.setName("package");
+                    req.addText("Import package " + imports[impIdx].toString());
+                    
                     String low = imports[impIdx].isLowInclusive()
-                        ? "(version>=" + imports[impIdx].getVersion() + ")"
-                        : "(!(version<=" + imports[impIdx].getVersion() + ")";
+                                ? "(version>=" + imports[impIdx].getVersion() + ")"
+                                : "(!(version<=" + imports[impIdx].getVersion() + ")";
 
                     if (imports[impIdx].getVersionHigh() != null)
                     {
                         String high = imports[impIdx].isHighInclusive()
                             ? "(version<=" + imports[impIdx].getVersionHigh() + ")"
                             : "(!(version>=" + imports[impIdx].getVersionHigh() + ")";
-                        RequirementImpl req = new RequirementImpl();
-                        req.setMultiple("false");
-                        req.setName("package");
-                        req.addText("Import package " + imports[impIdx].toString());
                         req.setFilter("(&(package="
                             + imports[impIdx].getName() + ")"
                             + low + high + ")");
-                        addRequire(req);
                     }
                     else
                     {
-                        RequirementImpl req = new RequirementImpl();
-                        req.setMultiple("false");
-                        req.setName("package");
-                        req.addText("Import package " + imports[impIdx].toString());
                         req.setFilter(
                             "(&(package="
                             + imports[impIdx].getName() + ")"
                             + low + ")");
-                        addRequire(req);
                     }
+                    
+                    addRequire(req);
                 }
             }
         }



Mime
View raw message