Show all features if file does not exist - better than missing installed features to export
--- a/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/wizard/ExportWizard.java Wed Aug 25 20:02:15 2010 -0500
+++ b/core/com.nokia.carbide.discovery.ui/src/com/nokia/carbide/internal/discovery/ui/wizard/ExportWizard.java Wed Aug 25 20:53:08 2010 -0500
@@ -68,18 +68,15 @@
}
private Collection<String> getInitialFeatureIds() {
- // make sure it exists if not written already
+ Collection<FeatureInfo> installedFeatures = null;
File file = P2Utils.getInitialFeaturesFile();
- if (!file.exists()) {
- P2Utils.writeFeaturesToFile(file);
- }
-
- Collection<FeatureInfo> installedFeatures = null;
- try {
- ImportExportData data = Streamer.readFromXML(new FileInputStream(file));
- installedFeatures = data.getFeatureInfos();
- } catch (Exception e) {
- Activator.logError(Messages.ExportWizard_ReadInstalledFeaturesError + file, e);
+ if (file.exists()) {
+ try {
+ ImportExportData data = Streamer.readFromXML(new FileInputStream(file));
+ installedFeatures = data.getFeatureInfos();
+ } catch (Exception e) {
+ Activator.logError(Messages.ExportWizard_ReadInstalledFeaturesError + file, e);
+ }
}
Collection<String> featureIds = new ArrayList<String>();