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 73117 Details for
Bug 195509
Need to improve classpath resolution for Apache Harmony 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]
Proposed fix
patch_195509.txt (text/plain), 4.28 KB, created by
Olivier Thomann
on 2007-07-05 10:12:16 EDT
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
Olivier Thomann
Created:
2007-07-05 10:12:16 EDT
Size:
4.28 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core.tests.compiler >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.56 >diff -u -r1.56 Util.java >--- src/org/eclipse/jdt/core/tests/util/Util.java 24 May 2007 14:31:35 -0000 1.56 >+++ src/org/eclipse/jdt/core/tests/util/Util.java 5 Jul 2007 14:06:10 -0000 >@@ -639,47 +639,68 @@ > * Example of use: [org.eclipse.jdt.core.tests.util.Util.getJavaClassLib()] > */ > public static String[] getJavaClassLibs() { >- String jreDir = getJREDirectory(); >- final String osName = System.getProperty("os.name"); >- if (jreDir == null) { >- return new String[] {}; >- } >- if (osName.startsWith("Mac")) { >- return new String[] { >- toNativePath(jreDir + "/../Classes/classes.jar") >- }; >- } >- final String vmName = System.getProperty("java.vm.name"); >- if ("J9".equals(vmName)) { >- return new String[] { >- 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"); >+ // check bootclasspath properties for Sun, JRockit and Harmony VMs >+ String bootclasspathProperty = System.getProperty("sun.boot.class.path"); //$NON-NLS-1$ >+ if ((bootclasspathProperty == null) || (bootclasspathProperty.length() == 0)) { >+ // IBM J9 VMs >+ bootclasspathProperty = System.getProperty("vm.boot.class.path"); //$NON-NLS-1$ >+ if ((bootclasspathProperty == null) || (bootclasspathProperty.length() == 0)) { >+ // Harmony using IBM VME >+ bootclasspathProperty = System.getProperty("org.apache.harmony.boot.class.path"); //$NON-NLS-1$ >+ } >+ } >+ String[] jars = null; >+ if ((bootclasspathProperty != null) && (bootclasspathProperty.length() != 0)) { >+ StringTokenizer tokenizer = new StringTokenizer(bootclasspathProperty, File.pathSeparator); >+ jars = new String[tokenizer.countTokens()]; >+ int i = 0; >+ while (tokenizer.hasMoreTokens()) { >+ jars[i] = toNativePath(tokenizer.nextToken()); >+ i++; >+ } >+ } else { >+ String jreDir = getJREDirectory(); >+ final String osName = System.getProperty("os.name"); >+ if (jreDir == null) { >+ return new String[] {}; >+ } >+ if (osName.startsWith("Mac")) { >+ return new String[] { >+ toNativePath(jreDir + "/../Classes/classes.jar") >+ }; >+ } >+ final String vmName = System.getProperty("java.vm.name"); >+ if ("J9".equals(vmName)) { >+ return new String[] { >+ 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"); >+ } >+ }; >+ jars = new File(jreDir + "/lib/boot/").list(jarFilter); >+ for (int i = 0; i < jars.length; i++) { >+ jars[i] = toNativePath(jreDir + "/lib/boot/" + jars[i]); > } >- }; >- 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]); >+ } else { >+ ArrayList paths = new ArrayList(); >+ String[] jarsNames = new String[] { >+ "/lib/vm.jar", >+ "/lib/rt.jar", >+ "/lib/core.jar", >+ "/lib/security.jar", >+ "/lib/xml.jar", >+ "/lib/graphics.jar" >+ }; >+ addJarEntries(jreDir, jarsNames, paths); >+ jars = new String[paths.size()]; >+ paths.toArray(jars); > } >- return jars; > } >- ArrayList paths = new ArrayList(); >- String[] jarsNames = new String[] { >- "/lib/vm.jar", >- "/lib/rt.jar", >- "/lib/core.jar", >- "/lib/security.jar", >- "/lib/xml.jar", >- "/lib/graphics.jar" >- }; >- addJarEntries(jreDir, jarsNames, paths); >- String[] result = new String[paths.size()]; >- paths.toArray(result); >- return result; >+ return jars; > } > private static void addJarEntries(String jreDir, String[] jarNames, ArrayList paths) { > for (int i = 0, max = jarNames.length; i < max; i++) {
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 195509
:
73099
|
73117
|
73122
|
73141