Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIan Bull2011-12-05 18:11:46 -0500
committerIan Bull2011-12-05 18:11:46 -0500
commit3ab674b9e4971c53b190f7d77f17c75ee13df4a0 (patch)
treeedcb669d66d66879828409112c758555cc20f1b5 /bundles/org.eclipse.equinox.p2.artifact.repository
parent82aeb8dee11f4114494fe3dd0ca1097312d2dfd5 (diff)
downloadrt.equinox.p2-3ab674b9e4971c53b190f7d77f17c75ee13df4a0.tar.gz
rt.equinox.p2-3ab674b9e4971c53b190f7d77f17c75ee13df4a0.tar.xz
rt.equinox.p2-3ab674b9e4971c53b190f7d77f17c75ee13df4a0.zip
Revert "Fix 351944 to avoid unnecessary loading artifact repository when doing query, getting artifact descriptors via artifact key."v20111205-2311
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.java16
1 files changed, 4 insertions, 12 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 79970410d..b365b0376 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
@@ -84,11 +84,6 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
* Does this instance of the repository currently hold a lock
*/
private boolean holdsLock = false;
- /**
- * Does this instance of the repository can be locked.
- * It will be initialized when initializing the location for repository
- */
- private Boolean canLock = null;
private long cacheTimestamp = 0l;
@@ -332,8 +327,7 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
boolean lockAcquired = false;
try {
- canLock = new Boolean(canLock());
- if (canLock.booleanValue()) {
+ if (canLock()) {
lockAcquired = lockAndLoad(true, new NullProgressMonitor());
if (!lockAcquired)
throw new IllegalStateException("Cannot acquire the lock for " + location); //$NON-NLS-1$
@@ -979,8 +973,6 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
desc.setRepository(this);
if (updateTimestamp)
updateTimestamp();
- if (canLock == null)
- canLock = new Boolean(canLock());
}
private String getBlobStoreName(String defaultValue) {
@@ -1433,11 +1425,11 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
}
/**
- * Returns true if this instance of SimpleArtifactRepository holds the lock or
- * this repository can't be locked at all due to permission, false otherwise.
+ * Returns true if this instance of SimpleArtifactRepository holds the lock,
+ * false otherwise.
*/
private boolean holdsLock() {
- return (canLock != null && !canLock.booleanValue()) || holdsLock;
+ return holdsLock;
}
/**URIUtil.toURI(location.toURI()

Back to the top