Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlyn Normington2012-12-12 04:37:57 -0500
committerGlyn Normington2012-12-12 04:37:57 -0500
commite0ec8899a6da4dacb45bad3bb4ceb999fbf5d6eb (patch)
tree4e52f57508301689843e4b4aa38f076fd876dfdc
parent45e5b57120132408f4caae75a244f1192eb00bf8 (diff)
downloadorg.eclipse.virgo.kernel-e0ec8899a6da4dacb45bad3bb4ceb999fbf5d6eb.tar.gz
org.eclipse.virgo.kernel-e0ec8899a6da4dacb45bad3bb4ceb999fbf5d6eb.tar.xz
org.eclipse.virgo.kernel-e0ec8899a6da4dacb45bad3bb4ceb999fbf5d6eb.zip
Revert "328630: ensure canonical URIs are used as map keys"
-rw-r--r--org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/model/internal/StandardRuntimeArtifactModel.java23
1 files changed, 10 insertions, 13 deletions
diff --git a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/model/internal/StandardRuntimeArtifactModel.java b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/model/internal/StandardRuntimeArtifactModel.java
index 57d15303..5b13168b 100644
--- a/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/model/internal/StandardRuntimeArtifactModel.java
+++ b/org.eclipse.virgo.kernel.deployer/src/main/java/org/eclipse/virgo/kernel/deployer/model/internal/StandardRuntimeArtifactModel.java
@@ -69,31 +69,28 @@ final class StandardRuntimeArtifactModel implements RuntimeArtifactModel, GCRoot
*/
public DeploymentIdentity add(@NonNull URI location, @NonNull InstallArtifact installArtifact) throws DuplicateFileNameException,
DuplicateLocationException, DuplicateDeploymentIdentityException, DeploymentException {
-
- URI canonicalLocation = getCanonicalFileLocation(location);
-
synchronized (this.monitor) {
// Check the precondition and throw an exception if it is violated.
- checkLocation(canonicalLocation, installArtifact);
+ checkLocation(location, installArtifact);
- String fileName = getFileName(canonicalLocation);
- checkFileName(canonicalLocation, installArtifact, fileName);
+ String fileName = getFileName(location);
+ checkFileName(location, installArtifact, fileName);
DeploymentIdentity deploymentIdentity = getDeploymentIdentity(installArtifact);
- checkDeploymentIdentity(canonicalLocation, installArtifact, deploymentIdentity);
+ checkDeploymentIdentity(location, installArtifact, deploymentIdentity);
// The precondition is true, so update the state. The invariants are preserved.
- updateState(canonicalLocation, installArtifact, fileName, deploymentIdentity);
+ updateState(location, installArtifact, fileName, deploymentIdentity);
return deploymentIdentity;
}
}
- private void checkLocation(URI canonicalLocation, InstallArtifact installArtifact) throws DuplicateLocationException {
- if (this.artifactByUri.containsKey(canonicalLocation)) {
- InstallArtifact clashingArtifact = getArtifactByUri(canonicalLocation);
- throw new DuplicateLocationException(getClashMessage(canonicalLocation, installArtifact, clashingArtifact));
+ private void checkLocation(URI location, InstallArtifact installArtifact) throws DuplicateLocationException {
+ if (this.artifactByUri.containsKey(getCanonicalFileLocation(location))) {
+ InstallArtifact clashingArtifact = getArtifactByUri(location);
+ throw new DuplicateLocationException(getClashMessage(location, installArtifact, clashingArtifact));
}
}
@@ -213,7 +210,7 @@ final class StandardRuntimeArtifactModel implements RuntimeArtifactModel, GCRoot
if (SCHEME_FILE.equals(uri.getScheme())) {
File file = new File(uri);
try {
- return file.getCanonicalFile().toURI();
+ return new URI(file.getCanonicalPath());
} catch (Exception e) {
return uri;
}

Back to the top