FELIX-1776: the Util.getBundleKey method should just use the bundle id

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@826986 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java b/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
index 4ba5619..b7c82e9 100644
--- a/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
+++ b/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
@@ -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);
diff --git a/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java b/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java
index bfa03c0..6bbdad4 100644
--- a/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java
+++ b/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/Util.java
@@ -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());
     }
 
 }