commit | f1ba38660e7f373277285f501f277c56d4c48791 | [log] [tgz] |
---|---|---|
author | Richard S. Hall <rickhall@apache.org> | Wed May 18 19:43:32 2011 +0000 |
committer | Richard S. Hall <rickhall@apache.org> | Wed May 18 19:43:32 2011 +0000 |
tree | 8dbb9ceb287f2c03cac69497309468980176a799 | |
parent | 4a1ddbaf7be00f064ef747346608bb5061d81f1f [diff] |
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()