Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 68301 Details for
Bug 172820
Hard-coded class libraries names in org/eclipse/jdt/core/tests/util/Util.java
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Updated patch with DRLVMLauncher class
patch_eclipse172820 (text/plain), 8.31 KB, created by
Nina Rinskaya
on 2007-05-23 05:33:09 EDT
(
hide
)
Description:
Updated patch with DRLVMLauncher class
Filename:
MIME Type:
Creator:
Nina Rinskaya
Created:
2007-05-23 05:33:09 EDT
Size:
8.31 KB
patch
obsolete
>diff -ruN eut_old_eclipse172820/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java eut_new_eclipse172820/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java >--- eut_old_eclipse172820/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 2007-05-16 19:22:46.000000000 +0700 >+++ eut_new_eclipse172820/org/eclipse/jdt/core/tests/compiler/regression/BatchCompilerTest.java 2007-05-16 16:12:59.000000000 +0700 >@@ -11,6 +11,7 @@ > package org.eclipse.jdt.core.tests.compiler.regression; > > import java.io.File; >+import java.io.FilenameFilter; > import java.io.FileNotFoundException; > import java.io.FileOutputStream; > import java.io.IOException; >@@ -43,11 +44,30 @@ > public static Test suite() { > return buildUniqueComplianceTestSuite(testClass(), COMPLIANCE_1_5); > } >- >+ private String getHYClasses() { >+ String jre = System.getProperty("java.home"); >+ FilenameFilter jarFilter = new FilenameFilter() { >+ public boolean accept(File dir, String name) { >+ return (name.endsWith(".jar") && !name.endsWith("-src.jar")); >+ } >+ }; >+ String libraryClasses = ""; >+ String path_separator = System.getProperty("path.separator"); >+ String[] jars = new File(jre + "/lib/boot/").list(jarFilter); >+ for (int i = 0; i < jars.length; i++) { >+ libraryClasses = libraryClasses + jre + "/lib/boot/" + jars[i] + path_separator; >+ } >+ return libraryClasses; >+ } >+ > private String getLibraryClasses() { > if (Util.isMacOS()) { > return JRE_HOME_DIR + "/../Classes/classes.jar"; > } >+ final String vmName = System.getProperty("java.vm.name"); >+ if ("DRLVM".equals(vmName)) { >+ return getHYClasses(); >+ } > return JRE_HOME_DIR + "/lib/rt.jar"; > } > >diff -ruN eut_old_eclipse172820/org/eclipse/jdt/core/tests/runtime/DRLVMLauncher.java eut_new_eclipse172820/org/eclipse/jdt/core/tests/runtime/DRLVMLauncher.java >--- eut_old_eclipse172820/org/eclipse/jdt/core/tests/runtime/DRLVMLauncher.java 1970-01-01 07:00:00.000000000 +0700 >+++ eut_new_eclipse172820/org/eclipse/jdt/core/tests/runtime/DRLVMLauncher.java 2007-05-22 13:20:37.275347890 +0700 >@@ -0,0 +1,146 @@ >+/******************************************************************************* >+ * Copyright (c) 2000, 2006 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 and implementation >+ *******************************************************************************/ >+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) { >+ vmLocation += ".exe"; >+ } >+ if (!new File(vmLocation).exists()) { >+ vmLocation = >+ this.vmPath + >+ (this.vmPath.endsWith(File.separator) ? "" : File.separator) + >+ "bin" + >+ File.separator + >+ "java"; >+ } >+ 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<this.programArguments.length;i++) { >+ commandLine.addElement(this.programArguments[i]); >+ } >+ } >+ >+ String[] result; >+ if (this.batchFileName!= null) { >+ // Write to batch file if specified >+ writeBatchFile(this.batchFileName, commandLine); >+ result = new String[] {this.batchFileName}; >+ } else { >+ result = new String[commandLine.size()]; >+ commandLine.copyInto(result); >+ } >+ >+ // check for spaces in result >+ for (int i = 0; i < result.length; i++) { >+ String argument = result[i]; >+ if (argument.indexOf(' ') != -1) { >+ result[i] = "\"" + argument + "\""; >+ } >+ } >+ >+ return result; >+} >+ >+/** >+ * Builds the actual boot class path that is going to be passed to the VM. >+ */ >+protected String buildBootClassPath() { >+ StringBuffer bootPathString = new StringBuffer(); >+ char pathSeparator = File.pathSeparatorChar; >+ >+ if (this.bootPath != null) { >+ // Add boot class path given by client >+ int length = this.bootPath.length; >+ for (int i = 0; i < length; i++){ >+ bootPathString.append(this.bootPath[i]); >+ bootPathString.append(pathSeparator); >+ } >+ } >+ >+ // Add boot class path directory if needed >+ if (this.evalTargetPath != null && TARGET_HAS_FILE_SYSTEM) { >+ bootPathString.append(this.evalTargetPath); >+ bootPathString.append(File.separatorChar); >+ bootPathString.append(BOOT_CLASSPATH_DIRECTORY); >+ } >+ >+ return bootPathString.toString(); >+} >+} >diff -ruN eut_old_eclipse172820/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java eut_new_eclipse172820/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java >--- eut_old_eclipse172820/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java 2007-05-16 19:22:46.000000000 +0700 >+++ eut_new_eclipse172820/org/eclipse/jdt/core/tests/runtime/LocalVMLauncher.java 2007-05-21 21:11:01.145092882 +0700 >@@ -66,6 +66,10 @@ > if ("IBM J9SE VM".equals(vmName)) { > return new SideCarJ9VMLauncher(); > } >+ // DRLVM works ok when launching in the same way as SideCarVM >+ if ("DRLVM".equals(vmName)) { >+ return new DRLVMLauncher(); >+ } > return new SideCarVMLauncher(); > } > /** >diff -ruN eut_old_eclipse172820/org/eclipse/jdt/core/tests/util/Util.java eut_new_eclipse172820/org/eclipse/jdt/core/tests/util/Util.java >--- eut_old_eclipse172820/org/eclipse/jdt/core/tests/util/Util.java 2007-05-16 19:22:46.000000000 +0700 >+++ eut_new_eclipse172820/org/eclipse/jdt/core/tests/util/Util.java 2007-05-16 16:12:59.000000000 +0700 >@@ -12,6 +12,7 @@ > > import java.io.File; > import java.io.FileInputStream; >+import java.io.FilenameFilter; > import java.io.FileNotFoundException; > import java.io.FileOutputStream; > import java.io.IOException; >@@ -505,6 +506,18 @@ > toNativePath(jreDir + "/lib/rt.jar") > }; > } >+ 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; >+ } > return new String[] { > toNativePath(jreDir + "/lib/core.jar"), > toNativePath(jreDir + "/lib/security.jar"),
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 172820
:
67967
|
68111
|
68301
|
68528
|
68539
|
68579
|
73085