From 15aa27467f64b7e9c70687cc58bf17b31c766160 Mon Sep 17 00:00:00 2001 From: DJ Houghton Date: Mon, 22 Feb 2010 20:10:37 +0000 Subject: Bug 303269 - [repository] The method signatures on IMetadataRepository should take collections --- .../provisional/p2/directorywatcher/RepositoryListener.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'bundles/org.eclipse.equinox.p2.directorywatcher') 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 3d7c91ba8..035b59409 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2009 IBM Corporation and others. + * Copyright (c) 2007, 2010 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -212,7 +212,7 @@ public class RepositoryListener extends DirectoryChangeListener { final Collection changes = iusToChange.getIUs(null, null); // first remove any IUs that have changed or that are associated with removed files if (!removedFiles.isEmpty() || !changes.isEmpty()) { - metadataRepository.removeInstallableUnits(changes.toArray(new IInstallableUnit[changes.size()]), null); + metadataRepository.removeInstallableUnits(changes); // create a query that will identify all ius related to removed files. // It's safe to compare a String with a File since the auto coercion will @@ -220,13 +220,13 @@ public class RepositoryListener extends DirectoryChangeListener { IMatchQuery removeQuery = new ExpressionQuery(IInstallableUnit.class, // "$1.exists(x | properties[$0] == x)", FILE_NAME, removedFiles); //$NON-NLS-1$ IQueryResult toRemove = metadataRepository.query(removeQuery, null); - metadataRepository.removeInstallableUnits(toRemove.toArray(IInstallableUnit.class), null); + metadataRepository.removeInstallableUnits(toRemove.toSet()); } // Then add all the new IUs as well as the new copies of the ones that have changed Collection additions = iusToAdd.getIUs(null, null); additions.addAll(changes); if (!additions.isEmpty()) - metadataRepository.addInstallableUnits(additions.toArray(new IInstallableUnit[additions.size()])); + metadataRepository.addInstallableUnits(additions); } /** -- cgit v1.2.3