felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r826986 - in /felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal: DirectoryWatcher.java Util.java
Date Tue, 20 Oct 2009 07:50:59 GMT
Author: gnodet
Date: Tue Oct 20 07:50:59 2009
New Revision: 826986

URL: http://svn.apache.org/viewvc?rev=826986&view=rev
Log:
FELIX-1776: the Util.getBundleKey method should just use the bundle id

Modified:
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
    felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java?rev=826986&r1=826985&r2=826986&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
Tue Oct 20 07:50:59 2009
@@ -259,12 +259,15 @@
             boolean exists = file.exists();
             Artifact artifact = (Artifact) currentManagedArtifacts.get(file);
             // File has been deleted
-            if (!exists && artifact != null)
+            if (!exists)
             {
-                deleteJaredDirectory(artifact);
-                deleteTransformedFile(artifact);
-                deleted.add(artifact);
+                if (artifact != null) {
+                    deleteJaredDirectory(artifact);
+                    deleteTransformedFile(artifact);
+                    deleted.add(artifact);
+                }
             }
+            // File exists
             else
             {
                 File jar  = file;
@@ -295,7 +298,7 @@
                     }
                 }
                 // File has been modified
-                if (exists && artifact != null)
+                if (artifact != null)
                 {
                     artifact.setChecksum(scanner.getChecksum(file));
                     // If there's no listener, this is because this artifact has been installed
before
@@ -338,7 +341,7 @@
                     }
                 }
                 // File has been added
-                if (exists && artifact == null)
+                else
                 {
                     // Find the listener
                     ArtifactListener listener = findListener(jar, listeners);

Modified: felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java
URL: http://svn.apache.org/viewvc/felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java?rev=826986&r1=826985&r2=826986&view=diff
==============================================================================
--- felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java
(original)
+++ felix/trunk/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java
Tue Oct 20 07:50:59 2009
@@ -39,9 +39,7 @@
 
 import org.osgi.framework.Bundle;
 import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
 import org.osgi.framework.ServiceReference;
-import org.osgi.framework.Version;
 import org.osgi.service.log.LogService;
 
 public class Util
@@ -451,11 +449,7 @@
 
     private static String getBundleKey(Bundle b)
     {
-        StringBuffer sb = new StringBuffer();
-        sb.append(b.getSymbolicName()).append("_");
-        String version = (String) b.getHeaders().get(Constants.BUNDLE_VERSION);
-        sb.append(version != null ? version : Version.emptyVersion.toString());
-        return sb.toString();
+        return Long.toString(b.getBundleId());
     }
 
 }



Mime
View raw message