Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2010-03-04 16:10:48 -0500
committerAndrew Niefer2010-03-04 16:10:48 -0500
commit4ff2fd945f959af5312a0f0aaa78f5c5ba4fe87b (patch)
treee9c2b4a1209631936faffe1cf04f29057efeb493 /bundles/org.eclipse.equinox.p2.artifact.repository
parenta0634aa6bca820ebed6bfc8cec14ad6dc0b2623e (diff)
downloadrt.equinox.p2-4ff2fd945f959af5312a0f0aaa78f5c5ba4fe87b.tar.gz
rt.equinox.p2-4ff2fd945f959af5312a0f0aaa78f5c5ba4fe87b.tar.xz
rt.equinox.p2-4ff2fd945f959af5312a0f0aaa78f5c5ba4fe87b.zip
bug 256434 - synchronize artifact queries
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.artifact.repository')
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java11
1 files changed, 6 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
index d21d87c89..91faff8f4 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
@@ -43,7 +43,7 @@ import org.eclipse.equinox.p2.repository.artifact.spi.AbstractArtifactRepository
import org.eclipse.equinox.p2.repository.artifact.spi.ArtifactDescriptor;
import org.eclipse.osgi.util.NLS;
-public class SimpleArtifactRepository extends AbstractArtifactRepository implements IArtifactRepository, IFileArtifactRepository, IIndexProvider<IArtifactKey> {
+public class SimpleArtifactRepository extends AbstractArtifactRepository implements IFileArtifactRepository, IIndexProvider<IArtifactKey> {
/**
* A boolean property controlling whether mirroring is enabled.
*/
@@ -735,7 +735,7 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
// Determine writing location
URI newLocation = createLocation(newDescriptor);
if (newLocation == null)
- throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, "No location for " + newDescriptor));
+ throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, NLS.bind(Messages.no_location, newDescriptor)));
String file = URIUtil.toFile(newLocation).getAbsolutePath();
// TODO at this point we have to assume that the repository is file-based. Eventually
@@ -992,11 +992,12 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
}
public IQueryable<IArtifactDescriptor> descriptorQueryable() {
- final Collection<List<IArtifactDescriptor>> descs = artifactMap.values();
return new IQueryable<IArtifactDescriptor>() {
-
public IQueryResult<IArtifactDescriptor> query(IQuery<IArtifactDescriptor> query, IProgressMonitor monitor) {
- return query.perform(new CompoundIterator<IArtifactDescriptor>(descs.iterator()));
+ synchronized (SimpleArtifactRepository.this) {
+ Collection<List<IArtifactDescriptor>> descs = SimpleArtifactRepository.this.artifactMap.values();
+ return query.perform(new CompoundIterator<IArtifactDescriptor>(descs.iterator()));
+ }
}
};
}

Back to the top