Fix repository delete bug. (FELIX-2958)


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1124397 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryAdminImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryAdminImpl.java
index 0e172d2..0237aa4 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryAdminImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/impl/RepositoryAdminImpl.java
@@ -18,6 +18,7 @@
  */
 package org.apache.felix.bundlerepository.impl;
 
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.security.AccessController;
 import java.security.PrivilegedActionException;
@@ -143,8 +144,16 @@
     public synchronized boolean removeRepository(String uri)
     {
         initialize();
-
-        return m_repoMap.remove(uri) != null;
+        
+        try
+        {
+            URL url = new URL(uri);
+            return m_repoMap.remove(url.toExternalForm()) != null;
+        }
+        catch (MalformedURLException e)
+        {
+            return m_repoMap.remove(uri) != null;
+        }
     }
 
     public synchronized Repository[] listRepositories()