This commit was manufactured by cvs2svn to create tag
'eclipseCon_2007_demo'.

Sprout from master 2006-10-17 12:35:19 UTC Pascal Rapicault <prapicau> 'clean up imports'
Cherrypick from demo_fixes 2007-03-03 06:04:58 UTC Pascal Rapicault <prapicau> 'missing the generation of a new line causing confusion on reading':
    bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/core/configurationManipulator/ConfigurationEditor.java
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/core/configurationManipulator/ConfigurationEditor.java b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/core/configurationManipulator/ConfigurationEditor.java
index e12d6ca..b301142 100644
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/core/configurationManipulator/ConfigurationEditor.java
+++ b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/core/configurationManipulator/ConfigurationEditor.java
@@ -148,7 +148,7 @@
 		//		} else if ("org.eclipse.platform".equals(bundle.getSymbolicName())) {
 		//			// todo this is hard-coded for now. We need to get the location of the primary
 		//			// feature's plug-in but the bundle info doesn't tell us if we have a plug-in or a feature.
-		//			String location = System.getProperty("cic.eclipse.repoLocation");
+		//			String location = System.getProperty("eclipse.repoLocation");
 		//			if (location != null) {
 		//				location = "file:/" + location + "/plugins/org.eclipse.platform_3.1.0.jar";
 		//				setSplashPath(location);
@@ -196,11 +196,10 @@
 					writer.write(vmLocation);
 					writer.newLine();
 				}
-				if (configurationTorun != null) {
 					writer.write("-configuration");
 					writer.newLine();
-					writer.write(getConfigurationFile().getAbsolutePath());
-				}
+					writer.write(configurationLocation.getAbsolutePath());
+					writer.newLine();
 				if (vmArgs != null && vmArgs.size() != 0) {
 					writer.write("-vmargs");
 					writer.newLine();
@@ -354,8 +353,13 @@
 			int startLevel = toWrite.getStartLevel();
 			int expected = toWrite.expectedState();
 			bundleList.append(location);
-			if (startLevel != BundleInfo.NO_LEVEL)
-				bundleList.append('@').append(startLevel).append(expected == Bundle.ACTIVE ? ":start" : "");
+			boolean separatorWritten = false;
+			if (startLevel != BundleInfo.NO_LEVEL) {
+				separatorWritten = true;
+				bundleList.append('@').append(startLevel);
+			}
+			if (expected == Bundle.ACTIVE)
+				bundleList.append(separatorWritten ? ":start" : "@start");
 			bundleList.append(',');
 			bundleListExtraData.append(toWrite.getLocation()).append(',').append(toWrite.getSymbolicName()).append(',').append(toWrite.getVersion()).append(',');
 		}
@@ -517,14 +521,22 @@
 				return;
 			reader = new BufferedReader(new FileReader(exeFile));
 			String line;
+			List cumulator = programArgs;
 			while ((line = reader.readLine()) != null) {
 				if (line.equals("-vm")) {
 					vmLocation = reader.readLine();
 					continue;
 				}
-				if (line.equals("-vmargs"))
+				if (line.equals("-vmargs")) {
+					cumulator = vmArgs;
 					continue;
-				vmArgs.add(line);
+				}
+				if (line.equals("-configuration")) {
+					reader.readLine();
+					continue;
+				}
+					
+				cumulator.add(line);
 			}
 
 		} catch (FileNotFoundException e) {
@@ -640,7 +652,10 @@
 		launcherName = name;
 	}
 
+	//TODO This will not support the change of program args (for example --launcher.library foo.dll)
 	public void addProgramArgument(String arg) {
+		if (programArgs.contains(arg))
+			return;
 		programArgs.add(arg);
 	}
 
@@ -662,6 +677,27 @@
 		return (BundleInfo[]) bundles.toArray(new BundleInfo[bundles.size()]);
 	}
 	
+	public BundleInfo getBundle(String symbolicName, String version) {
+		for (Iterator iterator = bundles.iterator(); iterator.hasNext();) {
+			BundleInfo b = (BundleInfo) iterator.next();
+			if ((version == null && b.getSymbolicName().equals(symbolicName)) || (b.getSymbolicName().equals(symbolicName) && b.getVersion().equals(version)))
+				return b;
+		}
+		return null;
+	}
+	
+	public BundleInfo[] getBundle(String location) {
+		ArrayList collected = new ArrayList(1);
+		for (Iterator iterator = bundles.iterator(); iterator.hasNext();) {
+			BundleInfo b = (BundleInfo) iterator.next();
+			if (b.getLocation().equals(location))
+				collected.add(b);
+		}
+		if (collected.size() == 0)
+			return new BundleInfo[0];
+		return (BundleInfo[]) collected.toArray(new BundleInfo[collected.size()]);
+	}
+	
 	public BundleInfo[] resolve() {
 		return null;
 	}