Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2009-09-10 21:12:25 +0000
committerDarin Wright2009-09-10 21:12:25 +0000
commitd019cb75c4a5a3ff01d6ade429cc010f8f55992c (patch)
tree71ec190619925ab4626482c5961eec74d7414bdd /org.eclipse.core.variables/src
parent32db0b837b1120edc41d8d3ea0ade84eb79262ea (diff)
downloadeclipse.platform.debug-d019cb75c4a5a3ff01d6ade429cc010f8f55992c.tar.gz
eclipse.platform.debug-d019cb75c4a5a3ff01d6ade429cc010f8f55992c.tar.xz
eclipse.platform.debug-d019cb75c4a5a3ff01d6ade429cc010f8f55992c.zip
Bug 263535 - resolution of ${eclipse_home} inconsistent with other vars like ${workspace_loc}
Diffstat (limited to 'org.eclipse.core.variables/src')
-rw-r--r--org.eclipse.core.variables/src/org/eclipse/core/internal/variables/EclipseHomeVariableResolver.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/EclipseHomeVariableResolver.java b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/EclipseHomeVariableResolver.java
index 17ca4a1a7..ac5e100d8 100644
--- a/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/EclipseHomeVariableResolver.java
+++ b/org.eclipse.core.variables/src/org/eclipse/core/internal/variables/EclipseHomeVariableResolver.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2006 IBM Corporation and others.
+ * Copyright (c) 2006, 2009 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
@@ -14,6 +14,8 @@ package org.eclipse.core.internal.variables;
import java.net.URL;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.variables.IDynamicVariable;
import org.eclipse.core.variables.IDynamicVariableResolver;
@@ -31,7 +33,17 @@ public class EclipseHomeVariableResolver implements IDynamicVariableResolver {
if (installLocation != null) {
URL url = installLocation.getURL();
if (url != null) {
- String file = url.getFile();
+
+ // Try to convert the URL to an OS string, to be consistent with
+ // how other variables, like ${workspace_loc} resolve. See
+ // ResourceResolver.translateToValue(). [bugzilla 263535]
+ String file = url.getFile();
+ IPath path = Path.fromOSString(file);
+ String osstr = path.toOSString();
+ if (osstr.length() != 0) {
+ return osstr;
+ }
+
if (file.length() != 0) {
return file;
}

Back to the top