### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core.tests.compiler Index: src/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java,v retrieving revision 1.19 diff -u -r1.19 LocalVMLauncher.java --- src/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java 6 Mar 2007 04:42:13 -0000 1.19 +++ src/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java 24 May 2007 10:46:45 -0000 @@ -7,6 +7,8 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Nina Rinskaya + * Fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=172820. *******************************************************************************/ package org.eclipse.jdt.core.tests.runtime; @@ -69,6 +71,9 @@ if ("IBM J9SE VM".equals(vmName)) { return new SideCarJ9VMLauncher(); } + if ("DRLVM".equals(vmName)) { + return new DRLVMLauncher(); + } return new SideCarVMLauncher(); } /** Index: src/org/eclipse/jdt/core/tests/util/Util.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/util/Util.java,v retrieving revision 1.55 diff -u -r1.55 Util.java --- src/org/eclipse/jdt/core/tests/util/Util.java 27 Apr 2007 15:57:14 -0000 1.55 +++ src/org/eclipse/jdt/core/tests/util/Util.java 24 May 2007 10:46:45 -0000 @@ -7,6 +7,8 @@ * * Contributors: * IBM Corporation - initial API and implementation + * Nina Rinskaya + * Fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=172820. *******************************************************************************/ package org.eclipse.jdt.core.tests.util; @@ -653,6 +655,18 @@ toNativePath(jreDir + "/lib/jclMax/classes.zip") }; } + if ("DRLVM".equals(vmName)) { + FilenameFilter jarFilter = new FilenameFilter() { + public boolean accept(File dir, String name) { + return name.endsWith(".jar") & !name.endsWith("-src.jar"); + } + }; + String[] jars = new File(jreDir + "/lib/boot/").list(jarFilter); + for (int i = 0; i < jars.length; i++) { + jars[i] = toNativePath(jreDir + "/lib/boot/" + jars[i]); + } + return jars; + } ArrayList paths = new ArrayList(); String[] jarsNames = new String[] { "/lib/vm.jar", Index: src/org/eclipse/jdt/core/tests/runtime/DRLVMLauncher.java =================================================================== RCS file: src/org/eclipse/jdt/core/tests/runtime/DRLVMLauncher.java diff -N src/org/eclipse/jdt/core/tests/runtime/DRLVMLauncher.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/jdt/core/tests/runtime/DRLVMLauncher.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,142 @@ +/******************************************************************************* + * Copyright (c) 2000, 2007 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 + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API + * Nina Rinskaya + * Fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=172820. + *******************************************************************************/ +package org.eclipse.jdt.core.tests.runtime; + +import java.io.File; +import java.util.Vector; + +/** + * This is a new vm launcher to support Apache Harmony + * (http://harmony.apache.org) settings + */ +public class DRLVMLauncher extends StandardVMLauncher { + +/** + * @see LocalVMLauncher#getCommandLine + */ +public String[] getCommandLine() { + Vector commandLine= new Vector(); + + // VM binary + String vmLocation = this.vmPath + + (this.vmPath.endsWith(File.separator) ? "" : File.separator) + + "bin" + + File.separator + + "javaw"; + final String osName = System.getProperty("os.name"); + if (osName.indexOf("win32") == -1 && !new File(vmLocation).exists()) { + vmLocation = vmLocation.substring(0, vmLocation.length()-1); + } + commandLine.addElement(vmLocation); + + // VM arguments + if (this.vmArguments != null) { + for (int i = 0; i < this.vmArguments.length; i++) { + commandLine.addElement(this.vmArguments[i]); + } + } + + // boot classpath + commandLine.addElement("-Xbootclasspath/a:" + buildBootClassPath()); + + // debug mode + if (this.debugPort != -1) { + commandLine.addElement("-Xdebug"); + commandLine.addElement("-Xnoagent"); + // commandLine.addElement("-Djava.compiler=NONE"); + commandLine.addElement( + "-Xrunjdwp:transport=dt_socket,address=" + + this.debugPort + + ",server=y,suspend=n"); + } + + // regular classpath + commandLine.addElement("-classpath"); + commandLine.addElement(buildClassPath()); + + // code snippet runner class + if (this.evalPort != -1) { + commandLine.addElement(CODE_SNIPPET_RUNNER_CLASS_NAME); + } + + // code snippet runner arguments + if (this.evalPort != -1) { + commandLine.addElement(EVALPORT_ARG); + commandLine.addElement(Integer.toString(this.evalPort)); + if (TARGET_HAS_FILE_SYSTEM) { + commandLine.addElement(CODESNIPPET_CLASSPATH_ARG); + commandLine.addElement(this.evalTargetPath + File.separator + REGULAR_CLASSPATH_DIRECTORY); + commandLine.addElement(CODESNIPPET_BOOTPATH_ARG); + commandLine.addElement(this.evalTargetPath + File.separator + BOOT_CLASSPATH_DIRECTORY); + } + } + + // program class + if (this.programClass != null) { + commandLine.addElement(this.programClass); + } + + // program arguments + if (this.programArguments != null) { + for (int i=0;i