Bug 220654 - EEVMPage creates VM from EE file 3 times after selecting file
Summary: EEVMPage creates VM from EE file 3 times after selecting file
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 4.4 M2   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2008-02-27 15:05 EST by Curtis Windatt CLA
Modified: 2013-08-13 09:58 EDT (History)
2 users (show)

See Also:


Attachments
EE file (1.32 KB, application/octet-stream)
2013-08-12 15:32 EDT, Michael Rennie CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Curtis Windatt CLA 2008-02-27 15:05:02 EST
Put a breakpoint in JavaRuntime#createVMFromDefinitionFile().

Installed JRE Pref Page, click Add..., select Execution Environment Description, browse to an ee file.

Once an ee file has been selected, the breakpoint will be hit three times.  Each time this breakpoint is hit, we are doing a decent amount of work, especially in the call to EEVMType.getLibaryLocations() because of I/O and regex calls.

The calls are always coming from the modify listener on the text box.  However, the problem does not occur on the standard vm page.
Comment 1 Michael Rennie CLA 2013-07-11 15:01:47 EDT
We should only be calling back to JavaRuntime in the reload* method, we don't need to recreate a VMStandin to ask if the location is valid - JavaRuntime is only pinged once on startup (if editing) and once per edit to the EE location.

Pushed fix to: http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=ae12dac8b6e73b751785fab81089f5a472ff00d1
Comment 2 Dani Megert CLA 2013-08-12 11:08:20 EDT
(In reply to comment #1)
> We should only be calling back to JavaRuntime in the reload* method, we
> don't need to recreate a VMStandin to ask if the location is valid -
> JavaRuntime is only pinged once on startup (if editing) and once per edit to
> the EE location.
> 
> Pushed fix to:
> http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/
> ?id=ae12dac8b6e73b751785fab81089f5a472ff00d1

This change is not good and I reverted it. See bug 414881 for details.
Comment 3 Michael Rennie CLA 2013-08-12 15:31:05 EDT
(In reply to comment #2)

> This change is not good and I reverted it. See bug 414881 for details.

Heres and updated fix : http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/?id=0f4ebf8a8b3cd164b4ca6b0d3d7318010ac61c51

When we validate we can actually do the reload at the same time, since the validation and the reload do the same work. Also fixed an annoyance where hand editing the EE file path would move the carat to the start of the text box when a valid path was entered.

I will attach the modified EE file I used to test with.
Comment 4 Michael Rennie CLA 2013-08-12 15:32:51 EDT
Created attachment 234326 [details]
EE file

This EE file is for use on the Mac, so to use it to test some changes will need to be made:
1. change the delimiters to the platform you are using (';' - win or ':' *nix)
2. change the -Dee.home var at the top to point to a valid (or invalid) location
Comment 5 Dani Megert CLA 2013-08-13 03:38:22 EDT
(In reply to comment #3)
> (In reply to comment #2)
> 
> > This change is not good and I reverted it. See bug 414881 for details.
> 
> Heres and updated fix :
> http://git.eclipse.org/c/jdt/eclipse.jdt.debug.git/commit/
> ?id=0f4ebf8a8b3cd164b4ca6b0d3d7318010ac61c51
> 

With N20130812-2000 I was able to import my EE description file.
Comment 6 Curtis Windatt CLA 2013-08-13 09:46:54 EDT
Fix works correctly on Windows.
Comment 7 Michael Rennie CLA 2013-08-13 09:58:26 EDT
fixed.