Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Kaegi2008-03-27 20:10:22 -0400
committerSimon Kaegi2008-03-27 20:10:22 -0400
commitd6c73b8382695f3e6779edf663cc398c5b3712e5 (patch)
treef47b9283438f4828960730aa01dc54dd27182353 /bundles/org.eclipse.equinox.p2.directorywatcher
parente0253163b5d782c0a7491ac8830fa7a17d649069 (diff)
downloadrt.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
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.directorywatcher')
-rw-r--r--bundles/org.eclipse.equinox.p2.directorywatcher/src/org/eclipse/equinox/internal/provisional/p2/directorywatcher/RepositoryListener.java15
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()]));
}
}

Back to the top