summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault (Ericsson)2013-02-27 13:30:58 (EST)
committerPascal Rapicault2013-02-27 13:30:58 (EST)
commit323b7bcd64040dd1471bbc60dbe358af3136eeb1 (patch)
tree0fcc7bca683655130582689aece757e57b1f4f71
parent790e216bde5d1d518611396c540216b2fcbac8ec (diff)
downloadrt.equinox.p2-323b7bcd64040dd1471bbc60dbe358af3136eeb1.zip
rt.equinox.p2-323b7bcd64040dd1471bbc60dbe358af3136eeb1.tar.gz
rt.equinox.p2-323b7bcd64040dd1471bbc60dbe358af3136eeb1.tar.bz2
Handle the case where the .eclipseproduct is missing
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreviousConfigurationFinder.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreviousConfigurationFinder.java b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreviousConfigurationFinder.java
index 9fd244b..fadfe41 100644
--- a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreviousConfigurationFinder.java
+++ b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreviousConfigurationFinder.java
@@ -133,6 +133,8 @@ public class PreviousConfigurationFinder {
public IProfile findPreviousInstalls(File searchRoot, File installFolder) {
List<ConfigurationDescriptor> potentialConfigurations = readPreviousConfigurations(searchRoot);
ConfigurationDescriptor runningConfiguration = getConfigdataFromProductFile(installFolder);
+ if (runningConfiguration == null)
+ return null;
ConfigurationDescriptor match = findMostRelevantConfigurationFromInstallHashDir(potentialConfigurations, runningConfiguration);
if (match == null)
match = findMostRelevantConfigurationFromProductId(potentialConfigurations, runningConfiguration);
@@ -143,6 +145,9 @@ public class PreviousConfigurationFinder {
private ConfigurationDescriptor getConfigdataFromProductFile(File installFolder) {
Object[] productFileInfo = loadEclipseProductFile(installFolder);
+ //Contrarily to the runtime, when the .eclipseproduct can't be found, we don't fallback to org.eclipse.platform.
+ if (productFileInfo.length == 0)
+ return null;
return new ConfigurationDescriptor((String) productFileInfo[0], (Identifier) productFileInfo[1], getInstallDirHash(installFolder), Platform.getOS() + '_' + Platform.getWS() + '_' + Platform.getOSArch(), null);
}