Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesper Moller2013-11-18 20:06:38 +0000
committerMike Rennie2013-11-18 20:06:38 +0000
commit0acd137393dc20152e3ab74ce7b7f198366bdfd6 (patch)
tree5dd6608c4eee09784937e52bbf8a724a041c11a6
parent65216f72e00d3e25e9e042231474837d7ceb76b5 (diff)
downloadeclipse.jdt.debug-0acd137393dc20152e3ab74ce7b7f198366bdfd6.tar.gz
eclipse.jdt.debug-0acd137393dc20152e3ab74ce7b7f198366bdfd6.tar.xz
eclipse.jdt.debug-0acd137393dc20152e3ab74ce7b7f198366bdfd6.zip
Bug 421938 - [1.8] ExecutionEnvironmentDescription#getVMArguments does
not preserve VM arguments Change-Id: Ia12c21263e0290e9dae3086db351a0f4b4176867 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 b0a3b0435..7e6d0a038 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 3b4027c23..fc4903bf3 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 cae3a70ad..0503e6dec 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 bb33d17d5..c69fc04f9 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();

Back to the top