bug 283147 - [publisher] Mismatch between PDE and p2 interpretation of icon paths in .product file
diff --git a/bundles/org.eclipse.equinox.p2.publisher/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.publisher/META-INF/MANIFEST.MF
index 88dc4db..db348c3 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.publisher/META-INF/MANIFEST.MF
@@ -26,6 +26,7 @@
  org.eclipse.equinox.internal.provisional.p2.metadata.repository,
  org.eclipse.equinox.internal.provisional.p2.query,
  org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository,
+ org.eclipse.osgi.service.datalocation;version="1.2.0",
  org.eclipse.osgi.service.environment;version="1.1.0",
  org.eclipse.osgi.service.pluginconversion;version="1.0.0",
  org.eclipse.osgi.service.resolver;version="1.2.0",
diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java
index ab3984e..5089d0c 100644
--- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java
+++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java
@@ -13,13 +13,16 @@
 
 package org.eclipse.equinox.internal.p2.publisher.eclipse;
 
-import org.eclipse.equinox.internal.provisional.p2.core.VersionedName;
-
 import java.io.*;
 import java.util.*;
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
+import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
+import org.eclipse.equinox.internal.p2.core.helpers.URLUtil;
+import org.eclipse.equinox.internal.p2.publisher.Activator;
 import org.eclipse.equinox.internal.provisional.frameworkadmin.BundleInfo;
+import org.eclipse.equinox.internal.provisional.p2.core.VersionedName;
+import org.eclipse.osgi.service.datalocation.Location;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
 import org.xml.sax.helpers.DefaultHandler;
@@ -703,14 +706,26 @@
 	private void addIcon(String os, String value) {
 		if (value == null)
 			return;
+
+		File iconFile = new File(value);
+		if (!iconFile.isFile()) {
+			//workspace
+			Location instanceLocation = (Location) ServiceHelper.getService(Activator.getContext(), Location.class.getName(), Location.INSTANCE_FILTER);
+			if (instanceLocation != null && instanceLocation.getURL() != null) {
+				File workspace = URLUtil.toFile(instanceLocation.getURL());
+				if (workspace != null)
+					iconFile = new File(workspace, value);
+			}
+		}
+		if (!iconFile.isFile())
+			iconFile = new File(location.getParentFile(), value);
+
 		Collection list = (Collection) icons.get(os);
 		if (list == null) {
 			list = new ArrayList(6);
 			icons.put(os, list);
 		}
-		if (!new File(value).isAbsolute())
-			value = new File(location.getParentFile(), value).getAbsolutePath();
-		list.add(value);
+		list.add(iconFile.getAbsolutePath());
 	}
 
 	private void processSolaris(Attributes attributes) {