diff options
author | Simon Kaegi | 2008-03-28 00:10:22 +0000 |
---|---|---|
committer | Simon Kaegi | 2008-03-28 00:10:22 +0000 |
commit | d6c73b8382695f3e6779edf663cc398c5b3712e5 (patch) | |
tree | f47b9283438f4828960730aa01dc54dd27182353 | |
parent | e0253163b5d782c0a7491ac8830fa7a17d649069 (diff) | |
download | rt.equinox.p2-d6c73b8382695f3e6779edf663cc398c5b3712e5.tar.gz rt.equinox.p2-d6c73b8382695f3e6779edf663cc398c5b3712e5.tar.xz rt.equinox.p2-d6c73b8382695f3e6779edf663cc398c5b3712e5.zip |
Bug 224492 RepositoryListener should add all ArtifactDescriptors in one callv20080327-2205
-rw-r--r-- | bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java | 15 |
1 files changed, 10 insertions, 5 deletions
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 dcecdf10b..2ffa581c0 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 @@ -293,11 +293,16 @@ public class RepositoryListener extends DirectoryChangeListener { } } - for (Iterator it = snapshot.keySet().iterator(); it.hasNext();) { - File file = (File) it.next(); - IArtifactDescriptor descriptor = generateArtifactDescriptor(file); - if (descriptor != null) - artifactRepository.addDescriptor(descriptor); + if (!snapshot.isEmpty()) { + List descriptorsToAdd = new ArrayList(); + for (Iterator it = snapshot.keySet().iterator(); it.hasNext();) { + File file = (File) it.next(); + IArtifactDescriptor descriptor = generateArtifactDescriptor(file); + if (descriptor != null) + descriptorsToAdd.add(descriptor); + } + if (!descriptorsToAdd.isEmpty()) + artifactRepository.addDescriptors((IArtifactDescriptor[]) descriptorsToAdd.toArray(new IArtifactDescriptor[descriptorsToAdd.size()])); } } |