aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesper Moller2013-11-18 15:41:09 (EST)
committerMike Rennie2013-11-18 15:41:09 (EST)
commit7ab58506f3c661028b9b1fb32f4df925fb6035d6 (patch)
treeb1d889f2d934a925f06ce7ede10070b823c38db7
parent1b356d207df789dad0f5c2d8aaf4f35811557239 (diff)
downloadeclipse.jdt.debug-7ab58506f3c661028b9b1fb32f4df925fb6035d6.zip
eclipse.jdt.debug-7ab58506f3c661028b9b1fb32f4df925fb6035d6.tar.gz
eclipse.jdt.debug-7ab58506f3c661028b9b1fb32f4df925fb6035d6.tar.bz2
Bug 421938 - [1.8] ExecutionEnvironmentDescription#getVMArguments doesI20131203-0800I20131126-0800I20131119-0800
not preserve VM arguments Change-Id: I45a2ff488a97eb60456ce54d292e74d4e1badae6 Signed-off-by: Jesper Moller <jesper@selskabet.org>
-rw-r--r--org.eclipse.jdt.debug.tests/testfiles/test-jre/bin/test-foundation11-win32.ee6
-rw-r--r--org.eclipse.jdt.debug.tests/testfiles/test-jre/bin/test-foundation11.ee6
-rw-r--r--org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/EEDefinitionTests.java8
-rw-r--r--org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/environments/ExecutionEnvironmentDescription.java6
4 files changed, 17 insertions, 9 deletions
diff --git a/org.eclipse.jdt.debug.tests/testfiles/test-jre/bin/test-foundation11-win32.ee b/org.eclipse.jdt.debug.tests/testfiles/test-jre/bin/test-foundation11-win32.ee
index b0a3b04..7e6d0a0 100644
--- a/org.eclipse.jdt.debug.tests/testfiles/test-jre/bin/test-foundation11-win32.ee
+++ b/org.eclipse.jdt.debug.tests/testfiles/test-jre/bin/test-foundation11-win32.ee
@@ -1,5 +1,5 @@
##################################################################################
-# Copyright (c) 2007, 2008 IBM Corporation and others.
+# Copyright (c) 2007, 2013 IBM Corporation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
#
# Contributors:
# IBM Corporation - initial API and implementation
+# Jesper S Moller - Bug 421938: [1.8] ExecutionEnvironmentDescription#getVMArguments does not preserve VM arguments
##################################################################################
# Test ".ee" file for testing installed JRE definition
@@ -40,4 +41,5 @@
-Djava.home=..
# all args should get passed through to command line
--XspecialArg2=456 \ No newline at end of file
+-XspecialArg2=456
+-XspecialArg3=789
diff --git a/org.eclipse.jdt.debug.tests/testfiles/test-jre/bin/test-foundation11.ee b/org.eclipse.jdt.debug.tests/testfiles/test-jre/bin/test-foundation11.ee
index 3b4027c..fc4903b 100644
--- a/org.eclipse.jdt.debug.tests/testfiles/test-jre/bin/test-foundation11.ee
+++ b/org.eclipse.jdt.debug.tests/testfiles/test-jre/bin/test-foundation11.ee
@@ -1,5 +1,5 @@
##################################################################################
-# Copyright (c) 2007, 2008 IBM Corporation and others.
+# Copyright (c) 2007, 2013 IBM Corporation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
#
# Contributors:
# IBM Corporation - initial API and implementation
+# Jesper S Moller - Bug 421938: [1.8] ExecutionEnvironmentDescription#getVMArguments does not preserve VM arguments
##################################################################################
# Test ".ee" file for testing installed JRE definition
@@ -40,4 +41,5 @@
-Djava.home=..
# all args should get passed through to command line
--XspecialArg2=456 \ No newline at end of file
+-XspecialArg2=456
+-XspecialArg3=789 \ No newline at end of file
diff --git a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/EEDefinitionTests.java b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/EEDefinitionTests.java
index cae3a70..0503e6d 100644
--- a/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/EEDefinitionTests.java
+++ b/org.eclipse.jdt.debug.tests/tests/org/eclipse/jdt/debug/tests/core/EEDefinitionTests.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Jesper S Moller - Bug 421938: [1.8] ExecutionEnvironmentDescription#getVMArguments does not preserve VM arguments
*******************************************************************************/
package org.eclipse.jdt.debug.tests.core;
@@ -199,13 +200,14 @@ public class EEDefinitionTests extends AbstractDebugTest {
String defaultVMArguments = description.getVMArguments();
String[] expected = new String[] {
"-XspecialArg:123",
- "-XspecialArg2=456"
+ "-XspecialArg2=456",
+ "-XspecialArg3=789"
};
int prev = -1;
for (int i = 0; i < expected.length; i++) {
int next = defaultVMArguments.indexOf(expected[i]);
- assertTrue("Missing argument: " + expected[i], next >= 0);
- assertTrue("Wrong argument order: " + expected[i], next > prev);
+ assertTrue("Missing argument: " + expected[i] + ": was: " + defaultVMArguments, next >= 0);
+ assertTrue("Wrong argument order: " + expected[i] + ": " + defaultVMArguments, next > prev);
prev = next;
}
}
diff --git a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/environments/ExecutionEnvironmentDescription.java b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/environments/ExecutionEnvironmentDescription.java
index bb33d17..c69fc04 100644
--- a/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/environments/ExecutionEnvironmentDescription.java
+++ b/org.eclipse.jdt.launching/launching/org/eclipse/jdt/launching/environments/ExecutionEnvironmentDescription.java
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Jesper S Moller - Bug 421938: [1.8] ExecutionEnvironmentDescription#getVMArguments does not preserve VM arguments
*******************************************************************************/
package org.eclipse.jdt.launching.environments;
@@ -20,6 +21,7 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
+import java.util.LinkedHashMap;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
@@ -365,7 +367,7 @@ public final class ExecutionEnvironmentDescription {
* @exception CoreException if unable to read the file
*/
private void initProperties(File eeFile) throws CoreException {
- Map<String, String> properties = new HashMap<String, String>();
+ Map<String, String> properties = new LinkedHashMap<String, String>();
String eeHome = eeFile.getParentFile().getAbsolutePath();
BufferedReader bufferedReader = null;
try {
@@ -410,7 +412,7 @@ public final class ExecutionEnvironmentDescription {
// resolve things with ${ee.home} in them
fProperties = properties; // needs to be done to resolve
Iterator<Entry<String, String>> entries = properties.entrySet().iterator();
- Map<String, String> resolved = new HashMap<String, String>(properties.size());
+ Map<String, String> resolved = new LinkedHashMap<String, String>(properties.size());
while (entries.hasNext()) {
Entry<String, String> entry = entries.next();
String key = entry.getKey();