Bug 516156 - 36 tests fail in pde.build.tests after ant update
URL.getPath() returns paths starting with backslash like
"\C:\shared_hudson\". Looks like ant 1.10.1 does not like this anymore,
so we should generate properties with valid absolute paths.
Change-Id: Iba981d83ce6a28e33ff8b49cc6ac65a229944ddf
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
diff --git a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/properties/PDEProperties.java b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/properties/PDEProperties.java
index 7ebc21e..c04f4e1 100644
--- a/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/properties/PDEProperties.java
+++ b/org.eclipse.pde.build/src/org/eclipse/pde/internal/build/properties/PDEProperties.java
@@ -10,7 +10,9 @@
*****************************************/
package org.eclipse.pde.internal.build.properties;
+import java.io.File;
import java.io.IOException;
+import java.net.URISyntaxException;
import java.net.URL;
import java.util.HashMap;
import java.util.Map;
@@ -48,7 +50,12 @@
if (foundEntry == null) {
BundleHelper.getDefault().getLog().log(new Status(IStatus.ERROR, IPDEBuildConstants.PI_PDEBUILD, IPDEBuildConstants.WARNING_PLUGIN_ALTERED, NLS.bind(Messages.exception_missing_pdebuild_folder, antPropertyName), null));
} else {
- result = FileLocator.toFileURL(foundEntry).getPath();
+ try {
+ result = new File(FileLocator.toFileURL(foundEntry).toURI()).getAbsolutePath();
+ } catch (URISyntaxException e) {
+ BundleHelper.getDefault().getLog().log(new Status(IStatus.ERROR, IPDEBuildConstants.PI_PDEBUILD, IPDEBuildConstants.EXCEPTION_MALFORMED_URL, e.getMessage(), e));
+ return null;
+ }
cache.put(searchedEntry, result);
}
}