Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2008-05-02 20:11:02 +0000
committerJohn Arthorne2008-05-02 20:11:02 +0000
commit916c73918efe81aaadaee71f47d7a97da06a49a8 (patch)
tree18f533d52a007989831d8d563e61da4049ebfa83
parent0b6f8d377e8d797cd6792f81de51949a9d98f9a2 (diff)
downloadrt.equinox.p2-916c73918efe81aaadaee71f47d7a97da06a49a8.tar.gz
rt.equinox.p2-916c73918efe81aaadaee71f47d7a97da06a49a8.tar.xz
rt.equinox.p2-916c73918efe81aaadaee71f47d7a97da06a49a8.zip
Bug 228903 Repository manager creation should always add the repository
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/mirror/MirrorApplication.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRepositoryManager.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepositoryManager.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/rollback/FormerState.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/MetadataCache.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/provisional/p2/engine/CertificateChecker.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryManager.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepositoryManager.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/FoldersRepositoryTest.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/JarURLRepositoryTest.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/NativeTouchpoint.java1
19 files changed, 23 insertions, 46 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/mirror/MirrorApplication.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/mirror/MirrorApplication.java
index a4faf8b08..83f775200 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/mirror/MirrorApplication.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/mirror/MirrorApplication.java
@@ -68,9 +68,7 @@ public class MirrorApplication implements IApplication {
// the given repo location is not an existing repo so we have to create something
// TODO for now create a Simple repo by default.
String repositoryName = destinationLocation + " - artifacts"; //$NON-NLS-1$
- IArtifactRepository repository = manager.createRepository(destinationLocation, repositoryName, IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, null);
- manager.addRepository(repository.getLocation());
- return repository;
+ return manager.createRepository(destinationLocation, repositoryName, IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, null);
}
public void stop() {
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRepositoryManager.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRepositoryManager.java
index 661764292..18ef76119 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRepositoryManager.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/ArtifactRepositoryManager.java
@@ -15,7 +15,6 @@ import java.net.URL;
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.preferences.ConfigurationScope;
-import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository;
import org.eclipse.equinox.internal.p2.core.helpers.*;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
@@ -210,6 +209,7 @@ public class ArtifactRepositoryManager extends AbstractRepositoryManager impleme
if (result == null)
fail(location, ProvisionException.REPOSITORY_FAILED_READ);
clearNotFound(result.getLocation());
+ addRepository(result);
return result;
}
@@ -563,8 +563,7 @@ public class ArtifactRepositoryManager extends AbstractRepositoryManager impleme
try {
Map properties = new HashMap(1);
properties.put(IRepository.PROP_SYSTEM, Boolean.TRUE.toString());
- SimpleArtifactRepository cache = (SimpleArtifactRepository) createRepository(location.getArtifactRepositoryURL(), "download cache", TYPE_SIMPLE_REPOSITORY, properties); //$NON-NLS-1$
- addRepository(cache);
+ createRepository(location.getArtifactRepositoryURL(), "download cache", TYPE_SIMPLE_REPOSITORY, properties); //$NON-NLS-1$
} catch (ProvisionException e) {
LogHelper.log(e);
}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepositoryManager.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepositoryManager.java
index e08eac88d..a0c9c5774 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepositoryManager.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/provisional/p2/artifact/repository/IArtifactRepositoryManager.java
@@ -108,9 +108,9 @@ public interface IArtifactRepositoryManager {
* Creates and returns a new empty artifact repository of the given type at
* the given location.
* <p>
- * The resulting repository is <b>not</b> added to the list of repositories tracked by
- * the repository manager. Clients must make a subsequent call to {@link #addRepository(URL)}
- * if they want the repository manager to remember the repository for subsequent
+ * The resulting repository is added to the list of repositories tracked by
+ * the repository manager. Clients must make a subsequent call to {@link #removeRepository(URL)}
+ * if they do not want the repository manager to remember the repository for subsequent
* load attempts.
* </p>
*
diff --git a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java
index cce76cfe3..2b6eba61b 100644
--- a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java
+++ b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java
@@ -45,9 +45,7 @@ public class ProvisioningHelper {
// for convenience create and add a repository here
String repositoryName = location + " - metadata"; //$NON-NLS-1$
try {
- IMetadataRepository repository = manager.createRepository(location, repositoryName, IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, null);
- manager.addRepository(repository.getLocation());
- return repository;
+ return manager.createRepository(location, repositoryName, IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, null);
} catch (ProvisionException e) {
return null;
}
@@ -84,9 +82,7 @@ public class ProvisioningHelper {
// could not load a repo at that location so create one as a convenience
String repositoryName = location + " - artifacts"; //$NON-NLS-1$
try {
- IArtifactRepository repository = manager.createRepository(location, repositoryName, IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, null);
- manager.addRepository(repository.getLocation());
- return repository;
+ return manager.createRepository(location, repositoryName, IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, null);
} catch (ProvisionException e) {
return null;
}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/rollback/FormerState.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/rollback/FormerState.java
index b9dfa80a9..f0ad33f4d 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/rollback/FormerState.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/rollback/FormerState.java
@@ -104,9 +104,7 @@ public class FormerState {
try {
Map properties = new HashMap(1);
properties.put(IRepository.PROP_SYSTEM, Boolean.TRUE.toString());
- IMetadataRepository repository = manager.createRepository(location, "Agent rollback repository", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties); //$NON-NLS-1$
- manager.addRepository(repository.getLocation());
- return repository;
+ return manager.createRepository(location, "Agent rollback repository", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties); //$NON-NLS-1$
} catch (ProvisionException e) {
LogHelper.log(e);
}
diff --git a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
index ec5ac9299..a8c05ef55 100644
--- a/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
+++ b/bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java
@@ -147,9 +147,7 @@ public class RepositoryListener extends DirectoryChangeListener {
properties.put(IRepository.PROP_SYSTEM, Boolean.TRUE.toString());
name = "artifact listener " + repositoryName; //$NON-NLS-1$
}
- IArtifactRepository repository = manager.createRepository(stateDirURL, name, IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
- manager.addRepository(repository.getLocation());
- return repository;
+ return manager.createRepository(stateDirURL, name, IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
} catch (ProvisionException e) {
LogHelper.log(e);
throw new IllegalStateException(NLS.bind(Messages.failed_create_artifact_repo, stateDirURL));
@@ -179,9 +177,7 @@ public class RepositoryListener extends DirectoryChangeListener {
properties.put(IRepository.PROP_SYSTEM, Boolean.TRUE.toString());
name = "metadata listener " + repositoryName; //$NON-NLS-1$
}
- IMetadataRepository repository = manager.createRepository(stateDirURL, name, IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
- manager.addRepository(stateDirURL);
- return repository;
+ return manager.createRepository(stateDirURL, name, IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
} catch (ProvisionException e) {
LogHelper.log(e);
throw new IllegalStateException(NLS.bind(Messages.failed_create_metadata_repo, stateDirURL));
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/MetadataCache.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/MetadataCache.java
index 59106f2cb..0b5b52a45 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/MetadataCache.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/MetadataCache.java
@@ -50,9 +50,7 @@ public class MetadataCache {
try {
Map properties = new HashMap(1);
properties.put(IRepository.PROP_SYSTEM, Boolean.TRUE.toString());
- IMetadataRepository repository = manager.createRepository(location, REPOSITORY_NAME, IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
- manager.addRepository(repository.getLocation());
- return repository;
+ return manager.createRepository(location, REPOSITORY_NAME, IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
} catch (ProvisionException e) {
LogHelper.log(e);
throw new IllegalStateException(Messages.failed_creating_metadata_cache);
diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/provisional/p2/engine/CertificateChecker.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/provisional/p2/engine/CertificateChecker.java
index 6286020dc..46c5f034a 100644
--- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/provisional/p2/engine/CertificateChecker.java
+++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/provisional/p2/engine/CertificateChecker.java
@@ -47,7 +47,7 @@ public class CertificateChecker {
ArrayList untrusted = new ArrayList();
ArrayList untrustedChain = new ArrayList();
IStatus status = Status.OK_STATUS;
- if (artifacts.size() == 0)
+ if (artifacts.size() == 0 || serviceUI == null)
return status;
Iterator artifact = artifacts.iterator();
TrustEngine trustEngine = (TrustEngine) trustEngineTracker.getService();
diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java
index 06d75ac78..7b1872407 100644
--- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java
+++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java
@@ -63,7 +63,7 @@ public class ExtensionLocationMetadataRepositoryFactory implements IMetadataRepo
IMetadataRepository repository = new SimpleMetadataRepositoryFactory().load(repoLocation, null);
return new ExtensionLocationMetadataRepository(location, repository, monitor);
} catch (ProvisionException e) {
- return create(location, "Extension location repository: " + location.toExternalForm(), ExtensionLocationMetadataRepository.TYPE, null);
+ return create(location, location.toExternalForm(), ExtensionLocationMetadataRepository.TYPE, null);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java
index 5508df639..014612410 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.generator/src/org/eclipse/equinox/internal/p2/metadata/generator/EclipseGeneratorApplication.java
@@ -112,6 +112,7 @@ public class EclipseGeneratorApplication implements IApplication {
IArtifactRepository result = null;
try {
result = manager.createRepository(location, repositoryName, IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
+ manager.removeRepository(location);
provider.setArtifactRepository(result);
// TODO is this needed?
if (artifactRepoName != null)
@@ -166,7 +167,6 @@ public class EclipseGeneratorApplication implements IApplication {
IMetadataRepositoryManager manager = (IMetadataRepositoryManager) ServiceHelper.getService(Activator.context, IMetadataRepositoryManager.class.getName());
try {
IMetadataRepository result = manager.createRepository(location, repositoryName, IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
- manager.addRepository(result.getLocation());
// TODO is this needed?
if (metadataRepoName != null)
result.setName(metadataRepoName);
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryManager.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryManager.java
index cf451c625..565d30c96 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryManager.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/MetadataRepositoryManager.java
@@ -225,6 +225,7 @@ public class MetadataRepositoryManager implements IMetadataRepositoryManager, Pr
if (result == null)
fail(location, ProvisionException.REPOSITORY_FAILED_READ);
clearNotFound(location);
+ addRepository(result);
return result;
}
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepositoryManager.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepositoryManager.java
index 199a3fcc9..d83f6896e 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepositoryManager.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/provisional/p2/metadata/repository/IMetadataRepositoryManager.java
@@ -78,9 +78,9 @@ public interface IMetadataRepositoryManager extends IQueryable {
* Creates and returns a new empty metadata repository of the given type at
* the given location.
* <p>
- * The resulting repository is <b>not</b> added to the list of repositories tracked by
- * the repository manager. Clients must make a subsequent call to {@link #addRepository(URL)}
- * if they want the repository manager to remember the repository for subsequent
+ * The resulting repository is added to the list of repositories tracked by
+ * the repository manager. Clients must make a subsequent call to {@link #removeRepository(URL)}
+ * if they do not want the repository manager to remember the repository for subsequent
* load attempts.
* </p>
*
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java
index cac1b94a2..d0490dc50 100644
--- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java
+++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java
@@ -16,6 +16,7 @@ import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.core.helpers.*;
import org.eclipse.equinox.internal.p2.extensionlocation.*;
+import org.eclipse.equinox.internal.p2.metadata.repository.MetadataRepositoryManager;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
@@ -59,7 +60,8 @@ public class Activator implements BundleActivator {
throw new IllegalStateException("MetadataRepositoryManager not registered."); //$NON-NLS-1$
ExtensionLocationMetadataRepositoryFactory factory = new ExtensionLocationMetadataRepositoryFactory();
IMetadataRepository repository = factory.create(location, name, ExtensionLocationMetadataRepository.TYPE, properties);
- manager.addRepository(location);
+ //we need to add the concrete repository to the repository manager, or its properties will not be correct
+ ((MetadataRepositoryManager) manager).addRepository(repository);
return repository;
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/FoldersRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/FoldersRepositoryTest.java
index 0f5bbb293..92173a4f0 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/FoldersRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/FoldersRepositoryTest.java
@@ -54,7 +54,6 @@ public class FoldersRepositoryTest extends TestCase {
manager.removeRepository(testRepo.toURL());
IArtifactRepository repo = manager.createRepository(testRepo.toURL(), "testRepo", IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, null);
- manager.addRepository(repo.getLocation());
File pluginsFolder = new File(testRepo, "plugins");
pluginsFolder.mkdir();
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/JarURLRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/JarURLRepositoryTest.java
index a07bf93e2..e6672ab2d 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/JarURLRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/JarURLRepositoryTest.java
@@ -67,7 +67,6 @@ public class JarURLRepositoryTest extends TestCase {
testRepo.mkdir();
provider.setFlavor("jartest");
IMetadataRepository repository = manager.createRepository(testRepo.toURL(), "testRepo", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, null);
- manager.addRepository(repository.getLocation());
provider.setMetadataRepository(repository);
new Generator(provider).generate();
FileUtils.zip(new File[] {testRepo}, new File(tempDir, "testRepo.jar"));
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java
index e6da11932..965ca63c2 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/LocalMetadataRepositoryTest.java
@@ -54,7 +54,6 @@ public class LocalMetadataRepositoryTest extends AbstractProvisioningTest {
Map properties = new HashMap();
properties.put(IRepository.PROP_COMPRESSED, "true");
IMetadataRepository repo = manager.createRepository(repoLocation.toURL(), "TestRepo", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
- manager.addRepository(repo.getLocation());
EclipseInstallGeneratorInfoProvider provider = new EclipseInstallGeneratorInfoProvider();
provider.setMetadataRepository(repo);
provider.initialize(repoLocation);
@@ -99,7 +98,6 @@ public class LocalMetadataRepositoryTest extends AbstractProvisioningTest {
public void testSetProperty() throws MalformedURLException, ProvisionException {
IMetadataRepositoryManager manager = getMetadataRepositoryManager();
IMetadataRepository repo = manager.createRepository(repoLocation.toURL(), "TestRepo", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, null);
- manager.addRepository(repo.getLocation());
Map properties = repo.getProperties();
assertTrue("1.0", !properties.containsKey(TEST_KEY));
repo.setProperty(TEST_KEY, TEST_VALUE);
@@ -125,7 +123,6 @@ public class LocalMetadataRepositoryTest extends AbstractProvisioningTest {
Map properties = new HashMap();
properties.put(IRepository.PROP_COMPRESSED, "false");
IMetadataRepository repo = manager.createRepository(repoLocation.toURL(), "TestRepo", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
- manager.addRepository(repo.getLocation());
EclipseInstallGeneratorInfoProvider provider = new EclipseInstallGeneratorInfoProvider();
provider.setMetadataRepository(repo);
provider.initialize(repoLocation);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java
index c4121ccfc..1ab9f3c3e 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/MetadataRepositoryManagerTest.java
@@ -72,7 +72,6 @@ public class MetadataRepositoryManagerTest extends AbstractProvisioningTest {
//create a new repository
File repoLocation = getTempLocation();
IMetadataRepository testRepo = manager.createRepository(repoLocation.toURL(), "MetadataRepositoryManagerTest", IMetadataRepositoryManager.TYPE_SIMPLE_REPOSITORY, null);
- manager.addRepository(testRepo.getLocation());
int newNonSystemCount = manager.getKnownRepositories(IMetadataRepositoryManager.REPOSITORIES_NON_SYSTEM).length;
int newSystemCount = manager.getKnownRepositories(IMetadataRepositoryManager.REPOSITORIES_SYSTEM).length;
int newAllCount = manager.getKnownRepositories(IMetadataRepositoryManager.REPOSITORIES_ALL).length;
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java
index ad26cd233..055da181e 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/Util.java
@@ -76,11 +76,7 @@ public class Util {
String repositoryName = Messages.BundlePool;
Map properties = new HashMap(1);
properties.put(IRepository.PROP_SYSTEM, Boolean.TRUE.toString());
- IArtifactRepository bundlePool = manager.createRepository(location, repositoryName, REPOSITORY_TYPE, properties);
- manager.addRepository(bundlePool.getLocation());
- //re-load the repository to ensure we have the same instance as other callers
- bundlePool = manager.loadRepository(bundlePool.getLocation(), null);
- return (IFileArtifactRepository) bundlePool;
+ return (IFileArtifactRepository) manager.createRepository(location, repositoryName, REPOSITORY_TYPE, properties);
} catch (ProvisionException e) {
LogHelper.log(e);
throw new IllegalArgumentException(NLS.bind(Messages.bundle_pool_not_writeable, location));
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/NativeTouchpoint.java b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/NativeTouchpoint.java
index 801ef6d47..2d8e0760f 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/NativeTouchpoint.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.natives/src/org/eclipse/equinox/internal/p2/touchpoint/natives/NativeTouchpoint.java
@@ -177,7 +177,6 @@ public class NativeTouchpoint extends Touchpoint {
Map properties = new HashMap(1);
properties.put(IRepository.PROP_SYSTEM, Boolean.TRUE.toString());
repository = manager.createRepository(location, repositoryName, IArtifactRepositoryManager.TYPE_SIMPLE_REPOSITORY, properties);
- manager.addRepository(repository.getLocation());
}
IFileArtifactRepository downloadCache = (IFileArtifactRepository) repository.getAdapter(IFileArtifactRepository.class);

Back to the top