Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 75201

Summary: MacOSXVMInstallType.detectInstallLocation() always returns null if findVMInstall succeeds
Product: [Eclipse Project] JDT Reporter: Jeff Myers <jeff.myers>
Component: DebugAssignee: Andre Weinand <andre_weinand>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: andre_weinand, fsanders, gmendel
Version: 3.0   
Target Milestone: 3.0.2   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Bug Depends on:    
Bug Blocks: 47716    
Attachments:
Description Flags
Patch for OSXVMInstallType
none
slightly modified patch for MacOSXVMInstallType.java none

Description Jeff Myers CLA 2004-09-28 14:32:22 EDT
While iterating over the installed versions of Java in the detectInstallLocation method in 
MacOSXVMInstallType, the following 
condition evaluates to false if the findVMInstall returns a valid VMInstall for the given version:
if (home.exists() && findVMInstall(version) == null && !CURRENT_JVM.equals(version)) {

The only place the defaultLocation returned by detectInstallLocation is set is within this if block, so if 
the default install location is able to be found, the method will return null.
Comment 1 Jeff Myers CLA 2004-09-28 14:38:41 EDT
Created attachment 14846 [details]
Patch for OSXVMInstallType

This patch makes detectInstallLocation() function return the VM linked as the
Current JDK in OSX.  This function should probably return install location of
the vm associated with the java.home property, as that's the vm that the
platform is currently using (the Javadoc in IVMInstallType says that it should
return the Eclipse platform's vm by default).

The patch applies to the v3.0.1 version of the org.eclipse.jdt.launching.macosx

plug-in.
Comment 2 Olivier Thomann CLA 2004-09-28 14:46:33 EDT
Move to JDT/Debug
Comment 3 Darin Wright CLA 2004-09-28 16:37:53 EDT
Andre, can you look at this one?
Comment 4 Andre Weinand CLA 2004-10-13 12:07:42 EDT
Darin, sorry, I have looked at the patch, but forgot to update this PR.
The patch helps, but is incorrect.
I have a better patch but didn't had time to release it.
But I'm still willing to fix it for M3. 
(However, that wouldn't help VE, because they sit on 3.0.1).
Comment 5 Darin Wright CLA 2004-10-13 12:18:26 EDT
Thanks Andre, please attach the patch, and Kevin can test/release if you like 
(he has a Mac test on).
Comment 6 Kevin Barnes CLA 2004-10-22 14:51:22 EDT
Andre, is there anything I can do to help you with this one?
Comment 7 Jeff Myers CLA 2004-10-22 16:22:59 EDT
Would it be possible to see about getting a fix for this in 3.0.2?  That'd be
very helpful for the VE.
Comment 8 Andre Weinand CLA 2004-10-22 18:36:33 EDT
Jeff, could you give the following patch a try?
I've created it against HEAD, but it should apply to 3.0.1 too.
Thanks.
Comment 9 Andre Weinand CLA 2004-10-22 18:37:49 EDT
Created attachment 15354 [details]
slightly modified patch for MacOSXVMInstallType.java
Comment 10 Jeff Myers CLA 2004-10-23 15:49:49 EDT
I just tried out this latest patch.  Seems to work fine.  The VE is able to compile template classes and 
launch properly with this patch in place.
Comment 11 Andre Weinand CLA 2004-10-24 17:09:41 EDT
Thanks Jeff.
I've released the patch.
Comment 12 Kevin Barnes CLA 2004-10-25 14:11:08 EDT
marking as verified
Comment 13 Darin Wright CLA 2005-01-11 22:44:43 EST
re-open to port to 3.0.2
Comment 14 Darin Wright CLA 2005-01-17 16:05:58 EST
Andre, can you release/merge this fix in to the 3.0.2 build/R3_0_maintenance 
branch?
Comment 15 Andre Weinand CLA 2005-01-18 14:29:16 EST
Yes, will do.
Comment 16 Andre Weinand CLA 2005-01-18 18:14:55 EST
released fix into the 3.0.2 build/R3_0_maintenance branch.
Comment 17 Kevin Barnes CLA 2005-02-28 17:22:46 EST
marking as VERIFIED