Bug 568162 - Show command line results are not formatted

Change-Id: Ie9064363ad2f58ef02cdec66d26a0fabee8b1fdd
Signed-off-by: Vikas Chandra <Vikas.Chandra@in.ibm.com>
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractVMRunner.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractVMRunner.java
index 5ce14ef..7b56ea1 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractVMRunner.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/AbstractVMRunner.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2000, 2019 IBM Corporation and others.
+ * Copyright (c) 2000, 2020 IBM Corporation and others.
  *
  * This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License 2.0
@@ -130,12 +130,18 @@
 	 * @return a single space-delimited string
 	 */
 	protected String getCmdLineAsString(String[] cmdLine) {
-		StringBuilder buff= new StringBuilder();
-		for (int i = 0, numStrings= cmdLine.length; i < numStrings; i++) {
+		StringBuilder buff = new StringBuilder();
+		for (int i = 0; i < cmdLine.length; i++) {
 			buff.append(cmdLine[i]);
-			buff.append(' ');
+			if (i != cmdLine.length - 1) {
+				if (cmdLine[i + 1].startsWith("-")) { //$NON-NLS-1$
+					buff.append("\n"); //$NON-NLS-1$
+				} else {
+					buff.append(' ');
+				}
+			}
 		}
-		return buff.toString().trim();
+		return buff.toString();
 	}
 
 	/**